From 4ecd42f9b52cd01b659c21f62e5ca2e79f5da4ab Mon Sep 17 00:00:00 2001 From: Julien Viard de Galbert Date: Tue, 20 Feb 2018 15:01:27 +0100 Subject: console: Introduce a way for mainboard to override the loglevel This change adds a config option to allow mainboard to override the console loglevel. When the option is set, the platform has to define the function get_console_loglevel returning a valid loglevel value. This allows a mainboard to sample a GPIO to switch the loglevel value between different environments (qualification vs production) without re-flashing. Change-Id: Id6cc72b8fe5c4c50a6f83ce80e6440b078eec6e2 Signed-off-by: Julien Viard de Galbert Reviewed-on: https://review.coreboot.org/23712 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Nico Huber --- src/console/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/console/init.c') diff --git a/src/console/init.c b/src/console/init.c index 422315ad2a..78c568f96e 100644 --- a/src/console/init.c +++ b/src/console/init.c @@ -34,7 +34,7 @@ static int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; static inline int get_log_level(void) { if (CONSOLE_LEVEL_CONST) - return CONFIG_DEFAULT_CONSOLE_LOGLEVEL; + return get_console_loglevel(); return console_loglevel; } @@ -49,7 +49,7 @@ static inline void set_log_level(int new_level) static void init_log_level(void) { - int debug_level = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; + int debug_level = get_console_loglevel(); if (CONSOLE_LEVEL_CONST) return; -- cgit v1.2.3