summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2022-03-23 19:58:44 +0100
committerArthur Heymans <arthur@aheymans.xyz>2022-04-01 09:29:19 +0000
commit8b82c6b91bc5d9c78504b50b537feef424b6043a (patch)
treebb999c1f4ae9c0177320f812e4e20c2a327184f4 /util
parentdd6b0610e3013563e0c326936cc92e3e384525a9 (diff)
downloadcoreboot-8b82c6b91bc5d9c78504b50b537feef424b6043a.tar.gz
coreboot-8b82c6b91bc5d9c78504b50b537feef424b6043a.tar.bz2
coreboot-8b82c6b91bc5d9c78504b50b537feef424b6043a.zip
util/ifittool: Fix clearing FIT when setting the pointer
When setting the FIT pointer, the FIT table is only known later in the codeflow. Change-Id: I658f4fffa997d1f7beaf6d6ae37d2885ae602e5c Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63035 Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/cbfstool/ifittool.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/util/cbfstool/ifittool.c b/util/cbfstool/ifittool.c
index c2a5221f0cdf..88a973c5afc8 100644
--- a/util/cbfstool/ifittool.c
+++ b/util/cbfstool/ifittool.c
@@ -308,13 +308,12 @@ int main(int argc, char *argv[])
ERROR("FIT not found.\n");
return 1;
}
- }
-
- if (clear_table) {
- if (fit_clear_table(fit)) {
- partitioned_file_close(image_file);
- ERROR("Failed to clear table.\n");
- return 1;
+ if (clear_table) {
+ if (fit_clear_table(fit)) {
+ partitioned_file_close(image_file);
+ ERROR("Failed to clear table.\n");
+ return 1;
+ }
}
}
@@ -394,6 +393,15 @@ int main(int argc, char *argv[])
return 1;
}
fit = fit_get_table(&bootblock, convert_to_from_top_aligned, topswap_size);
+
+ if (clear_table) {
+ if (fit_clear_table(fit)) {
+ partitioned_file_close(image_file);
+ ERROR("Failed to clear table.\n");
+ return 1;
+ }
+ }
+
break;
}
case DEL_OP: