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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79368 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
This commit is contained in:
parent
aa13aeadc0
commit
85541960df
1 changed files with 13 additions and 0 deletions
|
|
@ -1227,6 +1227,19 @@ static void validate_layout(char *image, int size)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue