parent
caa0e5b553
commit
4a01ad9260
|
@ -194,7 +194,6 @@ void start_armboot (void)
|
|||
|
||||
env_init(); /* initialize environment */
|
||||
serial_init(); /* serial communications setup */
|
||||
console_init_f(); /* stage 1 init of console */
|
||||
|
||||
for (initcall = __u_boot_initcalls_start; initcall < __u_boot_initcalls_end; initcall++) {
|
||||
result = (*initcall)();
|
||||
|
|
|
@ -27,29 +27,6 @@
|
|||
#include <console.h>
|
||||
#include <exports.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef CONFIG_AMIGAONEG3SE
|
||||
int console_changed = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CFG_CONSOLE_IS_IN_ENV
|
||||
/*
|
||||
* if overwrite_console returns 1, the stdin, stderr and stdout
|
||||
* are switched to the serial port, else the settings in the
|
||||
* environment are used
|
||||
*/
|
||||
#ifdef CFG_CONSOLE_OVERWRITE_ROUTINE
|
||||
extern int overwrite_console (void);
|
||||
#define OVERWRITE_CONSOLE overwrite_console ()
|
||||
#else
|
||||
#define OVERWRITE_CONSOLE 0
|
||||
#endif /* CFG_CONSOLE_OVERWRITE_ROUTINE */
|
||||
|
||||
#endif /* CFG_CONSOLE_IS_IN_ENV */
|
||||
|
||||
/** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/
|
||||
|
||||
void serial_printf (const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
@ -66,54 +43,6 @@ void serial_printf (const char *fmt, ...)
|
|||
|
||||
serial_puts (printbuffer);
|
||||
}
|
||||
#if 0
|
||||
int fgetc (int file)
|
||||
{
|
||||
if (file < MAX_FILES)
|
||||
return stdio_devices[file]->getc ();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ftstc (int file)
|
||||
{
|
||||
if (file < MAX_FILES)
|
||||
return stdio_devices[file]->tstc ();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void fputc (int file, const char c)
|
||||
{
|
||||
if (file < MAX_FILES)
|
||||
stdio_devices[file]->putc (c);
|
||||
}
|
||||
|
||||
void fputs (int file, const char *s)
|
||||
{
|
||||
if (file < MAX_FILES)
|
||||
stdio_devices[file]->puts (s);
|
||||
}
|
||||
|
||||
void fprintf (int file, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
uint i;
|
||||
char printbuffer[CFG_PBSIZE];
|
||||
|
||||
va_start (args, fmt);
|
||||
|
||||
/* For this to work, printbuffer must be larger than
|
||||
* anything we ever want to print.
|
||||
*/
|
||||
i = vsprintf (printbuffer, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
/* Send to desired file */
|
||||
fputs (file, printbuffer);
|
||||
}
|
||||
#endif
|
||||
/** U-Boot INITIAL CONSOLE-COMPATIBLE FUNCTION *****************************/
|
||||
|
||||
int getc (void)
|
||||
{
|
||||
|
@ -127,21 +56,11 @@ int tstc (void)
|
|||
|
||||
void putc (const char c)
|
||||
{
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (gd->flags & GD_FLG_SILENT)
|
||||
return;
|
||||
#endif
|
||||
|
||||
serial_putc (c);
|
||||
}
|
||||
|
||||
void puts (const char *s)
|
||||
{
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (gd->flags & GD_FLG_SILENT)
|
||||
return;
|
||||
#endif
|
||||
|
||||
serial_puts (s);
|
||||
}
|
||||
|
||||
|
@ -182,7 +101,7 @@ static int ctrlc_disabled = 0; /* see disable_ctrl() */
|
|||
static int ctrlc_was_pressed = 0;
|
||||
int ctrlc (void)
|
||||
{
|
||||
if (!ctrlc_disabled && gd->have_console) {
|
||||
if (!ctrlc_disabled) {
|
||||
if (tstc ()) {
|
||||
switch (getc ()) {
|
||||
case 0x03: /* ^C - Control C */
|
||||
|
@ -216,16 +135,3 @@ void clear_ctrlc (void)
|
|||
{
|
||||
ctrlc_was_pressed = 0;
|
||||
}
|
||||
|
||||
/* Called before relocation - use serial functions */
|
||||
int console_init_f (void)
|
||||
{
|
||||
gd->have_console = 1;
|
||||
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (getenv("silent") != NULL)
|
||||
gd->flags |= GD_FLG_SILENT;
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue