diff options
| author | wdenk <wdenk> | 2003-10-10 10:05:42 +0000 | 
|---|---|---|
| committer | wdenk <wdenk> | 2003-10-10 10:05:42 +0000 | 
| commit | f72da3406bf6f1c1bce9aa03b07d070413a916af (patch) | |
| tree | 5494a96d6da4706d1add61cb36d8bace834fbb8f /common/main.c | |
| parent | 5da627a424b3ad2d38a81886ba4a18e5123a6788 (diff) | |
| download | olio-uboot-2014.01-f72da3406bf6f1c1bce9aa03b07d070413a916af.tar.xz olio-uboot-2014.01-f72da3406bf6f1c1bce9aa03b07d070413a916af.zip | |
Added config option CONFIG_SILENT_CONSOLE.  See doc/README.silentLABEL_2003_10_10_1200
for more information
Diffstat (limited to 'common/main.c')
| -rw-r--r-- | common/main.c | 33 | 
1 files changed, 30 insertions, 3 deletions
| diff --git a/common/main.c b/common/main.c index d08bc47d7..73f8ff9f0 100644 --- a/common/main.c +++ b/common/main.c @@ -193,6 +193,18 @@ static __inline__ int abortboot(int bootdelay)  {  	int abort = 0; +#ifdef CONFIG_SILENT_CONSOLE +	{ +		DECLARE_GLOBAL_DATA_PTR; + +		if (gd->flags & GD_FLG_SILENT) { +			/* Restore serial console */ +			console_assign (stdout, "serial"); +			console_assign (stderr, "serial"); +		} +	} +#endif +  #ifdef CONFIG_MENUPROMPT  	printf(CONFIG_MENUPROMPT, bootdelay);  #else @@ -207,13 +219,13 @@ static __inline__ int abortboot(int bootdelay)  	if (bootdelay >= 0) {  		if (tstc()) {	/* we got a key press	*/  			(void) getc();  /* consume input	*/ -			printf ("\b\b\b 0\n"); -			return 1; 	/* don't auto boot	*/ +			printf ("\b\b\b 0"); +			abort = 1; 	/* don't auto boot	*/  		}  	}  #endif -	while (bootdelay > 0) { +	while ((bootdelay > 0) && (!abort)) {  		int i;  		--bootdelay; @@ -237,6 +249,21 @@ static __inline__ int abortboot(int bootdelay)  	putc ('\n'); +#ifdef CONFIG_SILENT_CONSOLE +	{ +		DECLARE_GLOBAL_DATA_PTR; + +		if (abort) { +			/* permanently enable normal console output */ +			gd->flags &= ~(GD_FLG_SILENT); +		} else if (gd->flags & GD_FLG_SILENT) { +			/* Restore silent console */ +			console_assign (stdout, "nulldev"); +			console_assign (stderr, "nulldev"); +		} +	} +#endif +  	return abort;  }  # endif	/* CONFIG_AUTOBOOT_KEYED */ |