From e613d704d12592dfc371d81957a3d83b0742fa7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 12 Feb 2019 14:16:21 +0200 Subject: console: Split loglevel for fast and slow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For fast CBMEM console use minimum BIOS_DEBUG level. For other consoles, Kconfig and/or nvram settings apply. Change-Id: Iff56a0a3182f258200cac80e013957d598cc2130 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/31370 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/console/init.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/console/init.c') diff --git a/src/console/init.c b/src/console/init.c index 7d1f31a38b..b7cc43aef2 100644 --- a/src/console/init.c +++ b/src/console/init.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -64,7 +65,18 @@ static void init_log_level(void) int console_log_level(int msg_level) { - return (get_log_level() >= msg_level); + int log_level = get_log_level(); + + if (log_level < 0) + return CONSOLE_LOG_NONE; + + if (msg_level <= log_level) + return CONSOLE_LOG_ALL; + + if (IS_ENABLED(CONFIG_CONSOLE_CBMEM) && (msg_level <= BIOS_DEBUG)) + return CONSOLE_LOG_FAST; + + return 0; } asmlinkage void console_init(void) -- cgit v1.2.3