arch/x86: Enable postcar console

Add a Kconfig value to enable the console during postcar.  Add a call
to console_init at the beginning of the postcar stage in exit_car.S.

TEST=Build and run on Galileo Gen2

Change-Id: I66e2ec83344129ede2c7d6e5627c8062e28f50ad
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/16001
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Lee Leahy 2016-07-31 11:53:28 -07:00 committed by Patrick Georgi
parent f67e2cf9cf
commit 049b46270d
4 changed files with 15 additions and 2 deletions

View File

@ -26,6 +26,11 @@ stack_top:
.text .text
.global _start .global _start
_start: _start:
#if IS_ENABLED(CONFIG_POSTCAR_CONSOLE)
/* Enable the console */
call console_init
#endif /* CONFIG_POSTCAR_CONSOLE */
/* chipset_teardown_car() is expected to disable cache-as-ram. */ /* chipset_teardown_car() is expected to disable cache-as-ram. */
call chipset_teardown_car call chipset_teardown_car

View File

@ -7,6 +7,13 @@ config BOOTBLOCK_CONSOLE
help help
Use console during the bootblock if supported Use console during the bootblock if supported
config POSTCAR_CONSOLE
bool "Enable console output during postcar."
depends on POSTCAR_STAGE
default n
help
Use console during the postcar if supported
config SQUELCH_EARLY_SMP config SQUELCH_EARLY_SMP
bool "Squelch AP CPUs from early console." bool "Squelch AP CPUs from early console."
default y default y

View File

@ -30,7 +30,7 @@ int console_log_level(int msg_level)
return (console_loglevel >= msg_level); return (console_loglevel >= msg_level);
} }
void console_init(void) asmlinkage void console_init(void)
{ {
#if !defined(__PRE_RAM__) #if !defined(__PRE_RAM__)
console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;

View File

@ -18,6 +18,7 @@
#include <stdint.h> #include <stdint.h>
#include <rules.h> #include <rules.h>
#include <arch/cpu.h>
#include <console/post_codes.h> #include <console/post_codes.h>
#include <commonlib/loglevel.h> #include <commonlib/loglevel.h>
@ -51,7 +52,7 @@ void __attribute__ ((noreturn)) die(const char *msg);
(ENV_SMM && CONFIG_DEBUG_SMI)) (ENV_SMM && CONFIG_DEBUG_SMI))
#if __CONSOLE_ENABLE__ #if __CONSOLE_ENABLE__
void console_init(void); asmlinkage void console_init(void);
int console_log_level(int msg_level); int console_log_level(int msg_level);
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
void do_putchar(unsigned char byte); void do_putchar(unsigned char byte);