Wim Vervoorn has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36545 )
Change subject: lib/cbfs: Add fallback to RO region to cbfs_boot_locate ......................................................................
lib/cbfs: Add fallback to RO region to cbfs_boot_locate
With this change cbfs_boot_locate will check the RO (COREBOOT) region if a file can not be found. By doing so it is not required to duplicate static files that are not intended to be updated to the RW regions.
This change is intended to support VBOOT on systems with a small flash device.
BUG=N/A TEST=tested on facebook fbg1701
Change-Id: I81ceaf927280cef9a3f09621c796c451e9115211 Signed-off-by: Wim Vervoorn wvervoorn@eltan.com --- M src/lib/cbfs.c 1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/36545/1
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 1e8a93f..d81583c 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -62,6 +62,17 @@ }
int ret = cbfs_locate(fh, &rdev, name, type); + if (ret) { + + printk(BIOS_DEBUG, "CBFS_BOOT_LOCATE: Fall back to RO region\n"); + if (fmap_locate_area_as_rdev("COREBOOT", &rdev)) { + printk(BIOS_ALERT, "COREBOOT region not found while looking for %s\n", + name); + return ret; + } + ret = cbfs_locate(fh, &rdev, name, type); + } + if (!ret) if (vboot_measure_cbfs_hook(fh, name)) return -1;