Wim Vervoorn has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36543 )
Change subject: drivers/intel/fsp1_1: Do not use prog_locate if VBOOT_STARTS_IN_ROMSTAGE ......................................................................
drivers/intel/fsp1_1: Do not use prog_locate if VBOOT_STARTS_IN_ROMSTAGE
If VBOOT_STARTS_IN_ROMSTAGE is enabled prog_locate should be not be used before memory is available. Doing so will cause the vboot_locate to be called too early.
As an alternative the cbfs routines are used to provide the same result.
BUG=N/A TEST=tested on facebook fbg1701
Change-Id: Id5e8fd78458c09dd3896bfd142bd49c2c3d686df Signed-off-by: Wim Vervoorn wvervoorn@eltan.com --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 13 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/36543/1
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c index 2039c9c..dc54782 100644 --- a/src/drivers/intel/fsp1_1/car.c +++ b/src/drivers/intel/fsp1_1/car.c @@ -13,6 +13,7 @@
#include <arch/romstage.h> #include <arch/symbols.h> +#include <cbfs.h> #include <cbmem.h> #include <console/console.h> #include <commonlib/helpers.h> @@ -41,7 +42,18 @@ * is still enabled. We can directly access work buffer here. */ struct prog fsp = PROG_INIT(PROG_REFCODE, "fsp.bin");
- if (prog_locate(&fsp)) + if (CONFIG(VBOOT_STARTS_IN_ROMSTAGE)) { + + struct cbfsf file; + + if (cbfs_boot_locate(&file, prog_name(&fsp), NULL)) + die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin"); + + cbfsf_file_type(&file, &fsp.cbfs_type); + + cbfs_file_data(prog_rdev(&fsp), &file); + + } else if (prog_locate(&fsp)) die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin");
/* This leaks a mapping which this code assumes is benign as