Werner Zeh has submitted this change. ( https://review.coreboot.org/c/coreboot/+/54680 )
Change subject: util/cbfstool/fit.c: Fix getting the topswap table ......................................................................
util/cbfstool/fit.c: Fix getting the topswap table
There is a function to fetch the fit table at both the regular address and the TS address. So reuse that function instead of attempting to find the TS fit using some pointer aritmetics that is incorrect.
Change-Id: I9114f5439202ede7e01cd0fcbb1e3c4cdb8698b0 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/54680 Reviewed-by: Rizwan Qureshi rizwan.qureshi@intel.com Reviewed-by: Meera Ravindranath meera.ravindranath@intel.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/cbfstool/fit.c 1 file changed, 1 insertion(+), 13 deletions(-)
Approvals: build bot (Jenkins): Verified Rizwan Qureshi: Looks good to me, approved Meera Ravindranath: Looks good to me, but someone else must approve
diff --git a/util/cbfstool/fit.c b/util/cbfstool/fit.c index da93143..89b0fd2 100644 --- a/util/cbfstool/fit.c +++ b/util/cbfstool/fit.c @@ -561,7 +561,7 @@ uint32_t topswap_size) { struct fit_table *fit; - uint32_t *fit_pointer = get_fit_ptr(bootblock, offset_fn, 0); + uint32_t *fit_pointer = get_fit_ptr(bootblock, offset_fn, topswap_size);
/* Ensure pointer is below 4GiB and within 16MiB of 4GiB */ if (fit_pointer[1] != 0 || fit_pointer[0] < FIT_TABLE_LOWEST_ADDRESS) { @@ -576,18 +576,6 @@ return NULL; }
- if (topswap_size) { - struct fit_table *fit2 = (struct fit_table *)((uintptr_t)fit - - topswap_size); - if (!fit_table_verified(fit2)) { - ERROR("second FIT is invalid\n"); - return NULL; - } - fit = fit2; - } - - DEBUG("Operating on table (0x%x)\n", *fit_pointer - topswap_size); - return fit; }