diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2021-05-19 15:40:10 +0200 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2021-05-27 14:38:34 +0000 |
commit | f2b710430879765c4238730d7270c94e08573883 (patch) | |
tree | f6841b4f7e24f9f336ba36fad45e0eaf90f7658b /util | |
parent | 3164b645ab3b12e475305be67093f34cde4ff6df (diff) |
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>
Diffstat (limited to 'util')
-rw-r--r-- | util/cbfstool/fit.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/util/cbfstool/fit.c b/util/cbfstool/fit.c index da931432e9..89b0fd28d9 100644 --- a/util/cbfstool/fit.c +++ b/util/cbfstool/fit.c @@ -561,7 +561,7 @@ struct fit_table *fit_get_table(struct buffer *bootblock, 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 @@ struct fit_table *fit_get_table(struct buffer *bootblock, 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; } |