[coreboot] New patch to review for coreboot: ad03bf0 Provide MRC with a console printing callback function

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Tue Nov 13 02:41:16 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/1823

-gerrit

commit ad03bf0e31c040444535f8155f1180d0d6fcac46
Author: Vadim Bendebury <vbendeb at chromium.org>
Date:   Thu Jun 7 18:47:13 2012 -0700

    Provide MRC with a console printing callback function
    
    Let memory initialization code use the coreboot romstage console. This
    simplifies the code and makes sure that all output is available in
    /sys/firmware/log.
    
    The pei_data structure is modified to allow passing the console output
    function pointer. Romstage console_tx_byte() is used for this purpose.
    
    Change-Id: I722cfcb9ff0cf527c12cb6cac09d77ef17b588e0
    Signed-off-by: Vadim Bendebury <vbendeb at chromium.org>
---
 src/arch/x86/lib/romstage_console.c          | 2 +-
 src/include/console/console.h                | 1 +
 src/northbridge/intel/sandybridge/pei_data.h | 4 +++-
 src/northbridge/intel/sandybridge/raminit.c  | 3 +++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/arch/x86/lib/romstage_console.c b/src/arch/x86/lib/romstage_console.c
index af2944d..f43db05 100644
--- a/src/arch/x86/lib/romstage_console.c
+++ b/src/arch/x86/lib/romstage_console.c
@@ -29,7 +29,7 @@
 #include <console/ne2k.h>
 #endif
 
-static void console_tx_byte(unsigned char byte)
+void console_tx_byte(unsigned char byte)
 {
 	if (byte == '\n')
 		console_tx_byte('\r');
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 00be96f..faffb9f 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -64,6 +64,7 @@ extern int console_loglevel;
  * we could use the same code on all architectures.
  */
 #define console_loglevel CONFIG_DEFAULT_CONSOLE_LOGLEVEL
+void console_tx_byte(unsigned char byte);
 #endif
 
 #ifndef __ROMCC__
diff --git a/src/northbridge/intel/sandybridge/pei_data.h b/src/northbridge/intel/sandybridge/pei_data.h
index cda08b2..5bb3b38 100644
--- a/src/northbridge/intel/sandybridge/pei_data.h
+++ b/src/northbridge/intel/sandybridge/pei_data.h
@@ -30,7 +30,8 @@
 #ifndef PEI_DATA_H
 #define PEI_DATA_H
 
-#define PEI_VERSION 1
+typedef void (*tx_byte_func)(unsigned char byte);
+#define PEI_VERSION 2
 struct pei_data
 {
 	uint32_t pei_version;
@@ -93,6 +94,7 @@ struct pei_data
 	 * spd_address for a given "DIMM".
 	 */
 	uint8_t spd_data[4][256];
+	tx_byte_func tx_byte;
 } __attribute__((packed));
 
 #endif
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c
index 8248fa1..2b46873 100644
--- a/src/northbridge/intel/sandybridge/raminit.c
+++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -241,6 +241,9 @@ void sdram_initialize(struct pei_data *pei_data)
 		hlt();
 	}
 
+	/* Pass console handler in pei_data */
+	pei_data->tx_byte = console_tx_byte;
+
 	/* Locate and call UEFI System Agent binary. */
 	entry = (unsigned long)cbfs_find_file("mrc.bin", 0xab);
 	if (entry) {




More information about the coreboot mailing list