diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-02-12 14:16:21 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-02-27 11:10:00 +0000 |
commit | e613d704d12592dfc371d81957a3d83b0742fa7d (patch) | |
tree | b21785796ec4446f1c18c74526e22a97b5cd7318 /src/console/init.c | |
parent | 7132f259bf83f1118893550c0bc914c11081ea84 (diff) |
console: Split loglevel for fast and slow
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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/31370
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/console/init.c')
-rw-r--r-- | src/console/init.c | 14 |
1 files changed, 13 insertions, 1 deletions
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 <arch/early_variables.h> +#include <commonlib/helpers.h> #include <console/console.h> #include <console/uart.h> #include <console/streams.h> @@ -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) |