util/amdfwtool/amdfwread.c: Properly error out in relative_offset()

The addresses and their modes should now all be correct and we can
therefore treat the case where `addr` and `mode` do not match as an
actual error.

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: Id12c29648c0437dd082b471689ec3649314dee1c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87298
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
Maximilian Brune 2025-04-12 16:41:28 +02:00 committed by Matt DeVillier
commit 6b7f697309

View file

@ -30,10 +30,7 @@ static uint64_t relative_offset(uint32_t header_offset, uint64_t addr, uint64_t
case AMD_ADDR_PHYSICAL:
if (addr < SPI_ROM_BASE || addr > (SPI_ROM_BASE + FILE_REL_MASK)) {
ERR("Invalid address(%lx) or mode(%lx)\n", addr, mode);
/* TODO: fix amdfwtool to program the right address/mode. In guybrush,
* lots of addresses are marked as physical, but they are relative to
* BIOS. Until that is fixed, just leave an error message. */
// exit(1);
exit(1);
}
return addr & FILE_REL_MASK;