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/printk.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/printk.c')
-rw-r--r-- | src/console/printk.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/console/printk.c b/src/console/printk.c index 0a9d3bf8ae..6050620dca 100644 --- a/src/console/printk.c +++ b/src/console/printk.c @@ -17,6 +17,7 @@ * blatantly copied from linux/kernel/printk.c */ +#include <console/cbmem_console.h> #include <console/console.h> #include <console/streams.h> #include <console/vtxprintf.h> @@ -36,18 +37,24 @@ void do_putchar(unsigned char byte) static void wrap_putchar(unsigned char byte, void *data) { - do_putchar(byte); + console_tx_byte(byte); +} + +static void wrap_putchar_cbmemc(unsigned char byte, void *data) +{ + __cbmemc_tx_byte(byte); } int vprintk(int msg_level, const char *fmt, va_list args) { - int i; + int i, log_this; if (IS_ENABLED(CONFIG_SQUELCH_EARLY_SMP) && ENV_CACHE_AS_RAM && !boot_cpu()) return 0; - if (!console_log_level(msg_level)) + log_this = console_log_level(msg_level); + if (log_this < CONSOLE_LOG_FAST) return 0; DISABLE_TRACE; @@ -59,9 +66,12 @@ int vprintk(int msg_level, const char *fmt, va_list args) spin_lock(&console_lock); #endif - i = vtxprintf(wrap_putchar, fmt, args, NULL); - - console_tx_flush(); + if (log_this == CONSOLE_LOG_FAST) { + i = vtxprintf(wrap_putchar_cbmemc, fmt, args, NULL); + } else { + i = vtxprintf(wrap_putchar, fmt, args, NULL); + console_tx_flush(); + } #ifdef __PRE_RAM__ #if IS_ENABLED(CONFIG_HAVE_ROMSTAGE_CONSOLE_SPINLOCK) |