summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2018-02-28 12:38:05 -0700
committerMartin Roth <martinroth@google.com>2018-03-02 15:22:24 +0000
commit60320182d011a8c31793f833f36f65cd5e8b50df (patch)
tree52676d96126d0c455a4411cdcc4ac66b23dc4501
parent277f4b99740e989bbe21b4ddd2451c5dbe8efea2 (diff)
console: only allow console messages after initialization
The console subsystem allows printk() to be called prior to the drivers and/or infrastructure is completely set up. In those situations don't allow messages to be added until the console is completely initialized. BUG=b:73898539 Change-Id: Idc3840132d7f95f8e22045d7484c528d828bb0de Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/24917 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/console/init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/console/init.c b/src/console/init.c
index 78c568f96e..8f71b09881 100644
--- a/src/console/init.c
+++ b/src/console/init.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/early_variables.h>
#include <console/console.h>
#include <console/uart.h>
#include <console/streams.h>
@@ -29,10 +30,13 @@
#define CONSOLE_LEVEL_CONST 0
#endif
+static int console_inited CAR_GLOBAL;
static int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
static inline int get_log_level(void)
{
+ if (car_get_var(console_inited) == 0)
+ return -1;
if (CONSOLE_LEVEL_CONST)
return get_console_loglevel();
@@ -74,6 +78,8 @@ asmlinkage void console_init(void)
console_hw_init();
+ car_set_var(console_inited, 1);
+
printk(BIOS_NOTICE, "\n\ncoreboot-%s%s %s " ENV_STRING " starting...\n",
coreboot_version, coreboot_extra_version, coreboot_build);
}