From b173fdcd3cd8581cdc9c350099ddb02fb60e3258 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Wed, 22 Mar 2017 20:41:42 +0100 Subject: common: spl: add config to suppress console output This adds a Kconfig DISABLE_CONSOLE_IN_SPL which allows to suppress any console output in the SPL. Signed-off-by: Max Krummenacher Acked-by: Marcel Ziswiler --- common/Kconfig | 7 +++++++ common/console.c | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index 913d21a9ec..78b7693590 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -246,6 +246,13 @@ config SILENT_CONSOLE_UPDATE_ON_RELOC (e.g. NAND). This option makes the value of the 'silent' environment variable take effect at relocation. +config SPL_DISABLE_CONSOLE + bool "Support a disabled console in SPL" + default y if SILENT_CONSOLE + help + This option disables the console, meaning that no + output will appear on the console devices. + config PRE_CONSOLE_BUFFER bool "Buffer characters before the console is available" help diff --git a/common/console.c b/common/console.c index e1d84763bd..1a7f31f3e5 100644 --- a/common/console.c +++ b/common/console.c @@ -505,6 +505,10 @@ void putc(const char c) void puts(const char *s) { +#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DISABLE_CONSOLE)) + return; +#else + #ifdef CONFIG_SANDBOX if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) { os_puts(s); @@ -546,6 +550,7 @@ void puts(const char *s) pre_console_puts(s); serial_puts(s); } +#endif } #ifdef CONFIG_CONSOLE_RECORD -- cgit v1.2.3