Maximilian Brune has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79368?usp=email )
Change subject: util/ifdtool/ifdtool.c: Add validation exception ......................................................................
util/ifdtool/ifdtool.c: Add validation exception
When validating the FMAP against the IFD, the BIOS region is a somewhat specical case, since the FMAP BIOS region usually does not match the IFD BIOS region. Instead the FMAP region usually resides somewhere inside the IFD BIOS region and the where depends on CONFIG_CBFS_SIZE.
Signed-off-by: Maximilian Brune maximilian.brune@9elements.com Change-Id: I920a0ee246cfd2b4ae0870256357d4f285e1730d --- M util/ifdtool/ifdtool.c 1 file changed, 13 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/79368/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 43451b1..f799729 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1181,6 +1181,19 @@ matches++; // found a match between FMAP and IFD region
if ((uint)region.base != area->offset || (uint)region.size != area->size) { + if (i == REGION_BIOS) { + /* + * BIOS FMAP region is a special case + * Coreboots FMAP BIOS region depends on the CONFIG_CBFS_SIZE + * while the IFD BIOS region is always of static size. + * Therefore we just make sure that the BIOS region of the FMAP + * is inside the region specified by the IFD + */ + if ((uint)region.base <= area->offset && + ((uint)region.base + region.size) >= (area->offset + area->size)) { + continue; + } + } printf("Region mismatch between %s and %s\n", region_names[i].terse, area->name); printf(" Descriptor region %s:\n", region_names[i].terse); printf(" offset: 0x%08x\n", region.base);