libpayload: Add an option to skip console initialization on startup.

A payload may want to decide whether it uses certain input/output consoles,
or that it wants support for outputing to a particular device but not to use
that device as a console. This change adds a config option which skips the
call to console_init in start_main.

Change-Id: I32b224d4d0bd3a239b402ecb09ee907d53225735
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/1732
Tested-by: build bot (Jenkins)
Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
This commit is contained in:
Gabe Black 2012-10-05 11:43:39 -07:00 committed by Anton Kochkov
parent d94512edee
commit 4bb0731a7b
3 changed files with 14 additions and 4 deletions

View File

@ -147,6 +147,14 @@ endmenu
menu "Console Options" menu "Console Options"
config SKIP_CONSOLE_INIT
bool "Skip initializing the consoles at startup"
default n
help
Normally, libpayload will initialize console input/output on startup
before the payload itself gets control. This option disables that
behavior and leaves console initialization up to the payload.
config CBMEM_CONSOLE config CBMEM_CONSOLE
bool "Send output to the in memory CBMEM console" bool "Send output to the in memory CBMEM console"
default y default y

View File

@ -49,8 +49,9 @@ void start_main(void)
/* Gather system information. */ /* Gather system information. */
lib_get_sysinfo(); lib_get_sysinfo();
/* Set up the consoles. */ /* Optionally set up the consoles. */
console_init(); if (!CONFIG_SKIP_CONSOLE_INIT)
console_init();
/* /*
* Any other system init that has to happen before the * Any other system init that has to happen before the

View File

@ -46,8 +46,9 @@ void start_main(void)
{ {
extern int main(int argc, char **argv); extern int main(int argc, char **argv);
/* Set up the consoles. */ /* Optionally set up the consoles. */
console_init(); if (!CONFIG_SKIP_CONSOLE_INIT)
console_init();
/* Gather system information. */ /* Gather system information. */
lib_get_sysinfo(); lib_get_sysinfo();