[PATCH] simplify silent console
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
7fc4c71a14
commit
ada4d40091
@ -494,13 +494,7 @@ int console_init_r (void)
|
|||||||
/* suppress all output if splash screen is enabled and we have
|
/* suppress all output if splash screen is enabled and we have
|
||||||
a bmp to display */
|
a bmp to display */
|
||||||
if (getenv("splashimage") != NULL)
|
if (getenv("splashimage") != NULL)
|
||||||
outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
|
gd->flags |= GD_FLG_SILENT;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
|
||||||
/* Suppress all output if "silent" mode requested */
|
|
||||||
if (gd->flags & GD_FLG_SILENT)
|
|
||||||
outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Scan devices looking for input and output devices */
|
/* Scan devices looking for input and output devices */
|
||||||
|
@ -112,16 +112,8 @@ static __inline__ int abortboot(int bootdelay)
|
|||||||
u_int presskey_max = 0;
|
u_int presskey_max = 0;
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
|
||||||
if (gd->flags & GD_FLG_SILENT) {
|
|
||||||
/* Restore serial console */
|
|
||||||
console_assign (stdout, "serial");
|
|
||||||
console_assign (stderr, "serial");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
# ifdef CONFIG_AUTOBOOT_PROMPT
|
# ifdef CONFIG_AUTOBOOT_PROMPT
|
||||||
printf (CONFIG_AUTOBOOT_PROMPT, bootdelay);
|
printf(CONFIG_AUTOBOOT_PROMPT, bootdelay);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef CONFIG_AUTOBOOT_DELAY_STR
|
# ifdef CONFIG_AUTOBOOT_DELAY_STR
|
||||||
@ -195,18 +187,12 @@ static __inline__ int abortboot(int bootdelay)
|
|||||||
}
|
}
|
||||||
# if DEBUG_BOOTKEYS
|
# if DEBUG_BOOTKEYS
|
||||||
if (!abort)
|
if (!abort)
|
||||||
puts ("key timeout\n");
|
puts("key timeout\n");
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
#ifdef CONFIG_SILENT_CONSOLE
|
||||||
if (abort) {
|
if (abort)
|
||||||
/* permanently enable normal console output */
|
gd->flags &= ~GD_FLG_SILENT;
|
||||||
gd->flags &= ~(GD_FLG_SILENT);
|
|
||||||
} else if (gd->flags & GD_FLG_SILENT) {
|
|
||||||
/* Restore silent console */
|
|
||||||
console_assign (stdout, "nulldev");
|
|
||||||
console_assign (stderr, "nulldev");
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return abort;
|
return abort;
|
||||||
@ -222,14 +208,6 @@ static __inline__ int abortboot(int bootdelay)
|
|||||||
{
|
{
|
||||||
int abort = 0;
|
int abort = 0;
|
||||||
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
|
||||||
if (gd->flags & GD_FLG_SILENT) {
|
|
||||||
/* Restore serial console */
|
|
||||||
console_assign (stdout, "serial");
|
|
||||||
console_assign (stderr, "serial");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_MENUPROMPT
|
#ifdef CONFIG_MENUPROMPT
|
||||||
printf(CONFIG_MENUPROMPT, bootdelay);
|
printf(CONFIG_MENUPROMPT, bootdelay);
|
||||||
#else
|
#else
|
||||||
@ -244,8 +222,8 @@ static __inline__ int abortboot(int bootdelay)
|
|||||||
if (bootdelay >= 0) {
|
if (bootdelay >= 0) {
|
||||||
if (tstc()) { /* we got a key press */
|
if (tstc()) { /* we got a key press */
|
||||||
(void) getc(); /* consume input */
|
(void) getc(); /* consume input */
|
||||||
puts ("\b\b\b 0");
|
puts("\b\b\b 0");
|
||||||
abort = 1; /* don't auto boot */
|
abort = 1; /* don't auto boot */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -266,23 +244,17 @@ static __inline__ int abortboot(int bootdelay)
|
|||||||
# endif
|
# endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
udelay (10000);
|
udelay(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("\b\b\b%2d ", bootdelay);
|
printf("\b\b\b%2d ", bootdelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
putc ('\n');
|
putc('\n');
|
||||||
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
#ifdef CONFIG_SILENT_CONSOLE
|
||||||
if (abort) {
|
if (abort)
|
||||||
/* permanently enable normal console output */
|
gd->flags &= ~GD_FLG_SILENT;
|
||||||
gd->flags &= ~(GD_FLG_SILENT);
|
|
||||||
} else if (gd->flags & GD_FLG_SILENT) {
|
|
||||||
/* Restore silent console */
|
|
||||||
console_assign (stdout, "nulldev");
|
|
||||||
console_assign (stderr, "nulldev");
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return abort;
|
return abort;
|
||||||
|
Loading…
Reference in New Issue
Block a user