diff --git a/common/Kconfig b/common/Kconfig index d6efe6590a..bb7cf884f3 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -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 diff --git a/common/console.c b/common/console.c index 1446b6268f..3e96261ad7 100644 --- a/common/console.c +++ b/common/console.c @@ -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);