From 8da2fa06f87484ac1861d8f7985621287f4a38b2 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 6 Jun 2018 10:35:45 +0200 Subject: 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 is needed when VBOOT_SEPARATE_VERSTAGE is selected. Change-Id: Ia73d468ab23932f92331ef40b8e8066cef55af2c Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/26883 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/northbridge/intel/haswell/raminit.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/northbridge/intel/haswell/raminit.c') diff --git a/src/northbridge/intel/haswell/raminit.c b/src/northbridge/intel/haswell/raminit.c index 55a7339d4e..21767b9416 100644 --- a/src/northbridge/intel/haswell/raminit.c +++ b/src/northbridge/intel/haswell/raminit.c @@ -120,6 +120,8 @@ static void report_memory_config(void) void sdram_initialize(struct pei_data *pei_data) { unsigned long entry; + uint32_t type = CBFS_TYPE_MRC; + struct cbfsf f; printk(BIOS_DEBUG, "Starting UEFI PEI System Agent\n"); @@ -142,9 +144,15 @@ void sdram_initialize(struct pei_data *pei_data) /* 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 + */ + if (cbfs_locate_file_in_region(&f, "COREBOOT", "mrc.bin", &type) < 0) + die("mrc.bin not found!"); + /* We don't care about leaking the mapping */ + entry = (unsigned long)rdev_mmap_full(&f.data); if (entry) { int rv; asm volatile ( -- cgit v1.2.3