From 48a4a7f24453e8fd0672146d78d7790539c6a2f8 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 7 Jun 2012 18:47:13 -0700 Subject: 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 Reviewed-on: http://review.coreboot.org/1823 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Ronald G. Minnich --- src/northbridge/intel/sandybridge/pei_data.h | 4 +++- src/northbridge/intel/sandybridge/raminit.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/northbridge/intel/sandybridge') diff --git a/src/northbridge/intel/sandybridge/pei_data.h b/src/northbridge/intel/sandybridge/pei_data.h index cda08b2d3f..5bb3b38a13 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 8248fa1486..2b46873e4d 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) { -- cgit v1.2.3