common: console: support disable console in & out

Set CONFIG_DISABLE_CONSOLE priority higher than CONFIG_DEBUG_UART,
otherwise there maybe some early message is printed by CONFIG_DEBUG_UART.

Change-Id: I235a49646b154e10e724e3d63e0ceecdd862c636
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-07-16 15:16:47 +08:00 committed by Jianhong Chen
parent ab4c011acf
commit c7abde102f
2 changed files with 10 additions and 5 deletions

View File

@ -255,6 +255,11 @@ config CONSOLE_DISABLE_CTRLC
help
This disable ctrl+c when CONFIG_BOOTDELAY is 0.
config DISABLE_CONSOLE
bool "disable console in & out"
help
This disable console in & out.
config IDENT_STRING
string "Board specific string to be added to uboot version string"
help

View File

@ -520,6 +520,11 @@ static inline void print_pre_console_buffer(int flushpoint) {}
void putc(const char c)
{
#ifdef CONFIG_DISABLE_CONSOLE
if (!gd || gd->flags & GD_FLG_DISABLE_CONSOLE)
return;
#endif
#ifdef CONFIG_DEBUG_UART
/* if we don't have a console yet, use the debug UART */
if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
@ -536,11 +541,6 @@ void putc(const char c)
return;
#endif
#ifdef CONFIG_DISABLE_CONSOLE
if (gd->flags & GD_FLG_DISABLE_CONSOLE)
return;
#endif
if (!gd->have_console)
return pre_console_putc(c);