[coreboot-gerrit] Change in coreboot[master]: nb/intel/haswell: Always locate mrc.bin in the COREBOOT fmap region

Arthur Heymans (Code Review) gerrit at coreboot.org
Wed Jun 6 10:41:16 CEST 2018


Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/26883


Change subject: nb/intel/haswell: Always locate mrc.bin in the COREBOOT fmap region
......................................................................

nb/intel/haswell: Always locate mrc.bin in the COREBOOT fmap region

This binary needs to be at a specific offset and will therefore always
be located in the COREBOOT fmap region.

This will be useful with C_ENVIRONMENT_BOOTBLOCK where romstages in
FW_MAIN_x will still need the same binary.

Change-Id: Ia73d468ab23932f92331ef40b8e8066cef55af2c
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
M src/northbridge/intel/haswell/Kconfig
M src/northbridge/intel/haswell/raminit.c
2 files changed, 16 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/26883/1

diff --git a/src/northbridge/intel/haswell/Kconfig b/src/northbridge/intel/haswell/Kconfig
index 3a47195..692744b 100644
--- a/src/northbridge/intel/haswell/Kconfig
+++ b/src/northbridge/intel/haswell/Kconfig
@@ -84,4 +84,9 @@
 	  VBIOS. On those systems we need to wait for a bit before executing
 	  the VBIOS.
 
+config RO_REGION_ONLY
+	string
+	depends on CHROMEOS
+	default "mrc.bin"
+
 endif
diff --git a/src/northbridge/intel/haswell/raminit.c b/src/northbridge/intel/haswell/raminit.c
index e5e2b93..cdbb1a9 100644
--- a/src/northbridge/intel/haswell/raminit.c
+++ b/src/northbridge/intel/haswell/raminit.c
@@ -120,6 +120,9 @@
 void sdram_initialize(struct pei_data *pei_data)
 {
 	unsigned long entry;
+	uint32_t type = CBFS_TYPE_MRC;
+	struct cbfsf f;
+	size_t fsize;
 
 	printk(BIOS_DEBUG, "Starting UEFI PEI System Agent\n");
 
@@ -142,9 +145,14 @@
 	/* Pass console handler in pei_data */
 	pei_data->tx_byte = do_putchar;
 
-	/* Locate and call UEFI System Agent binary. */
-	entry = (unsigned long)cbfs_boot_map_with_leak("mrc.bin",
-							CBFS_TYPE_MRC, NULL);
+	/*
+	 * Locate and call UEFI System Agent binary. The binary needs to be at
+	 * a fixed offset in the flash and can therefore only reside in the
+	 * COREBOOT fmap region
+	 */
+	cbfs_locate_file_in_region(&f, "COREBOOT", "mrc.bin", &type);
+	fsize = region_device_sz(&f.data);
+	entry = (unsigned long)rdev_mmap(&f.data, 0, fsize);
 	if (entry) {
 		int rv;
 		asm volatile (

-- 
To view, visit https://review.coreboot.org/26883
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia73d468ab23932f92331ef40b8e8066cef55af2c
Gerrit-Change-Number: 26883
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180606/c55adbd0/attachment.html>


More information about the coreboot-gerrit mailing list