summaryrefslogtreecommitdiff
path: root/util/amdfwtool/amdfwtool.c
diff options
context:
space:
mode:
authorZheng Bao <fishbaozi@gmail.com>2023-10-09 17:36:08 +0800
committerFelix Held <felix-coreboot@felixheld.de>2024-03-06 11:05:43 +0000
commita640b123f505e964524bf3f4dab3d8e89d754038 (patch)
tree4587a7295e974a8a057a5304fe3ed2030ae77faf /util/amdfwtool/amdfwtool.c
parente35c502a57aca65d1cb417dd1c999f69d16c1a7b (diff)
amdfwtool: Change&Record the current table in integration function
Align with the function integrating PSP FWs. And it is the integration function's responsibility. TEST=Identical test on all AMD platforms Change-Id: I1a98614f3a5756a462b01085e9565b52cf9a9343 Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78280 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'util/amdfwtool/amdfwtool.c')
-rw-r--r--util/amdfwtool/amdfwtool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index 0e18fe322b..e81059dd23 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -1088,7 +1088,6 @@ static void *new_bios_dir(context *ctx, bool multi)
ptr = BUFF_CURRENT(*ctx);
((bios_directory_hdr *) ptr)->additional_info = 0;
((bios_directory_hdr *) ptr)->additional_info_fields.address_mode = ctx->address_mode;
- ctx->current_table = ctx->current;
adjust_current_pointer(ctx,
sizeof(bios_directory_hdr) + MAX_BIOS_ENTRIES * sizeof(bios_directory_entry),
1);
@@ -1179,6 +1178,7 @@ static void integrate_bios_firmwares(context *ctx,
int apob_idx;
uint32_t size;
uint64_t source;
+ uint32_t current_table_save;
/* This function can create a primary table, a secondary table, or a
* flattened table which contains all applicable types. These if-else
@@ -1196,6 +1196,8 @@ static void integrate_bios_firmwares(context *ctx,
else
level = BDT_BOTH;
+ current_table_save = ctx->current_table;
+ ctx->current_table = (char *)biosdir - ctx->rom;
adjust_current_pointer(ctx, 0, TABLE_ALIGNMENT);
for (i = 0, count = 0; fw_table[i].type != AMD_BIOS_INVALID; i++) {
@@ -1396,6 +1398,7 @@ static void integrate_bios_firmwares(context *ctx,
}
fill_dir_header(biosdir, count, cookie, ctx, cb_config);
+ ctx->current_table = current_table_save;
}
static int set_efs_table(uint8_t soc_id, amd_cb_config *cb_config,