console: Add Kconfig debug option DEBUG_CONSOLE_INIT

Under normal circumstances no printk() goes through until
console_hw_init() has completed. This is wanted behaviour,
except when you need to debug the setup of one of consoles.

Change-Id: Ifc2bb22bf930009ee229d4461f512ada3018307b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/30558
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Kyösti Mälkki 2018-12-31 15:22:34 +02:00
parent 67618dd250
commit 6627795289
2 changed files with 15 additions and 0 deletions

View File

@ -782,6 +782,18 @@ config DEBUG_ACPI
If unsure, say N. If unsure, say N.
config DEBUG_CONSOLE_INIT
bool "Debug console initialisation code"
default n
help
With this option printk()'s are attempted before console hardware
initialisation has been completed. Your mileage may vary.
Typically you will need to modify source in console_hw_init() such
that a working console appears before the one you want to debug.
If unsure, say N.
# Only visible if debug level is DEBUG (7) or SPEW (8) as it does additional # Only visible if debug level is DEBUG (7) or SPEW (8) as it does additional
# printk(BIOS_DEBUG, ...) calls. # printk(BIOS_DEBUG, ...) calls.
config REALMODE_DEBUG config REALMODE_DEBUG

View File

@ -72,6 +72,9 @@ asmlinkage void console_init(void)
{ {
init_log_level(); init_log_level();
if (IS_ENABLED(CONFIG_DEBUG_CONSOLE_INIT))
car_set_var(console_inited, 1);
#if IS_ENABLED(CONFIG_EARLY_PCI_BRIDGE) #if IS_ENABLED(CONFIG_EARLY_PCI_BRIDGE)
if (!ENV_SMM && !ENV_RAMSTAGE) if (!ENV_SMM && !ENV_RAMSTAGE)
pci_early_bridge_init(); pci_early_bridge_init();