summaryrefslogtreecommitdiff
path: root/util/amdfwtool/amdfwtool.c
diff options
context:
space:
mode:
authorZheng Bao <fishbaozi@gmail.com>2022-08-18 15:45:27 +0800
committerFred Reitberger <reitbergerfred@gmail.com>2023-03-08 12:55:15 +0000
commitb2ae6a5a3a22d45f27e649d24777ae36f031f0ee (patch)
tree157e964e0c69fa2db3e14df29dde7e71e70e6e06 /util/amdfwtool/amdfwtool.c
parent2f6b7d557d9792efabefb8965f52b1537c2655ca (diff)
amdfwtool: combo: Create the combo header earlier
There will be a loop to set up the combo layout. The combo header only needs to be created once. This change is actually to move the creation of combo header outside of the loop. Change-Id: If6ba3d10dfc598133b9adbbb2b6658f356455608 Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66854 Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/amdfwtool/amdfwtool.c')
-rw-r--r--util/amdfwtool/amdfwtool.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index 8c780801db..9b523fcc27 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -2159,6 +2159,7 @@ int main(int argc, char **argv)
psp_directory_table *pspdir = NULL;
psp_directory_table *pspdir2 = NULL;
psp_directory_table *pspdir2_b = NULL;
+ psp_combo_directory *psp_combo_dir = NULL;
int fuse_defined = 0;
int targetfd;
char *output = NULL, *config = NULL;
@@ -2587,6 +2588,10 @@ int main(int argc, char **argv)
signed_start_addr,
cb_config.soc_id);
+ if (cb_config.use_combo) {
+ psp_combo_dir = new_combo_dir(&ctx);
+ }
+
if (cb_config.multi_level) {
/* Do 2nd PSP directory followed by 1st */
pspdir2 = new_psp_dir(&ctx, cb_config.multi_level);
@@ -2619,15 +2624,14 @@ int main(int argc, char **argv)
fill_psp_directory_to_efs(amd_romsig, pspdir, &ctx, &cb_config);
if (cb_config.use_combo) {
- psp_combo_directory *combo_dir = new_combo_dir(&ctx);
- fill_psp_directory_to_efs(amd_romsig, combo_dir, &ctx, &cb_config);
+ fill_psp_directory_to_efs(amd_romsig, psp_combo_dir, &ctx, &cb_config);
/* 0 -Compare PSP ID, 1 -Compare chip family ID */
- combo_dir->entries[0].id_sel = 0;
- combo_dir->entries[0].id = get_psp_id(cb_config.soc_id);
- combo_dir->entries[0].lvl2_addr =
+ psp_combo_dir->entries[0].id_sel = 0;
+ psp_combo_dir->entries[0].id = get_psp_id(cb_config.soc_id);
+ psp_combo_dir->entries[0].lvl2_addr =
BUFF_TO_RUN_MODE(ctx, pspdir, AMD_ADDR_REL_BIOS);
- fill_dir_header(combo_dir, 1, PSP2_COOKIE, &ctx);
+ fill_dir_header(psp_combo_dir, 1, PSP2_COOKIE, &ctx);
}
if (have_bios_tables(amd_bios_table)) {