[coreboot] New patch to review for coreboot: 897472c libpayload: Add an option to skip console initialization on startup.

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed Nov 7 00:22:04 CET 2012


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1732

-gerrit

commit 897472c114c21bf521630a382ea2a4eed5c241d7
Author: Gabe Black <gabeblack at google.com>
Date:   Fri Oct 5 11:43:39 2012 -0700

    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 at google.com>
---
 payloads/libpayload/Config.in           | 8 ++++++++
 payloads/libpayload/arch/i386/main.c    | 5 +++--
 payloads/libpayload/arch/powerpc/main.c | 5 +++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/payloads/libpayload/Config.in b/payloads/libpayload/Config.in
index 90a22ff..65be223 100644
--- a/payloads/libpayload/Config.in
+++ b/payloads/libpayload/Config.in
@@ -147,6 +147,14 @@ endmenu
 
 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
 	bool "Send output to the in memory CBMEM console"
 	default y
diff --git a/payloads/libpayload/arch/i386/main.c b/payloads/libpayload/arch/i386/main.c
index 36cfb69..19ac662 100644
--- a/payloads/libpayload/arch/i386/main.c
+++ b/payloads/libpayload/arch/i386/main.c
@@ -49,8 +49,9 @@ void start_main(void)
 	/* Gather system information. */
 	lib_get_sysinfo();
 
-	/* Set up the consoles. */
-	console_init();
+	/* Optionally set up the consoles. */
+	if (!CONFIG_SKIP_CONSOLE_INIT)
+		console_init();
 
 	/*
 	 * Any other system init that has to happen before the
diff --git a/payloads/libpayload/arch/powerpc/main.c b/payloads/libpayload/arch/powerpc/main.c
index 378c6f3..431cac4 100644
--- a/payloads/libpayload/arch/powerpc/main.c
+++ b/payloads/libpayload/arch/powerpc/main.c
@@ -46,8 +46,9 @@ void start_main(void)
 {
 	extern int main(int argc, char **argv);
 
-	/* Set up the consoles. */
-	console_init();
+	/* Optionally set up the consoles. */
+	if (!CONFIG_SKIP_CONSOLE_INIT)
+		console_init();
 
 	/* Gather system information. */
 	lib_get_sysinfo();




More information about the coreboot mailing list