summaryrefslogtreecommitdiff
path: root/src/include/console
diff options
context:
space:
mode:
authorJulien Viard de Galbert <jviarddegalbert@online.net>2018-02-20 15:01:27 +0100
committerNico Huber <nico.h@gmx.de>2018-02-23 08:44:59 +0000
commit4ecd42f9b52cd01b659c21f62e5ca2e79f5da4ab (patch)
tree28e1c06999c26fb71ee46b395fb7750afadb41de /src/include/console
parent8f825e0cd02ca25f86b677fba78b565b22798f5d (diff)
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 <jviarddegalbert@online.net> Reviewed-on: https://review.coreboot.org/23712 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/include/console')
-rw-r--r--src/include/console/console.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/console/console.h b/src/include/console/console.h
index aa935e4579..1ecf89c288 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -64,6 +64,18 @@ void do_putchar(unsigned char byte);
#define printk(LEVEL, fmt, args...) \
do { do_printk(LEVEL, fmt, ##args); } while (0)
+#if IS_ENABLED(CONFIG_CONSOLE_OVERRIDE_LOGLEVEL)
+/*
+ * This function should be implemented at mainboard level.
+ * The returned value will _replace_ the loglevel value;
+ */
+int get_console_loglevel(void);
+#else
+static inline int get_console_loglevel(void)
+{
+ return CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
+}
+#endif
#else
static inline void console_init(void) {}
static inline int console_log_level(int msg_level) { return 0; }