From 6b7f697309c3fd2051d6752aca883310ca7759f0 Mon Sep 17 00:00:00 2001 From: Maximilian Brune Date: Sat, 12 Apr 2025 16:41:28 +0200 Subject: [PATCH] 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 Change-Id: Id12c29648c0437dd082b471689ec3649314dee1c Reviewed-on: https://review.coreboot.org/c/coreboot/+/87298 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- util/amdfwtool/amdfwread.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/util/amdfwtool/amdfwread.c b/util/amdfwtool/amdfwread.c index 4dd3b0f770..f581c1b8d3 100644 --- a/util/amdfwtool/amdfwread.c +++ b/util/amdfwtool/amdfwread.c @@ -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;