From a640b123f505e964524bf3f4dab3d8e89d754038 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Mon, 9 Oct 2023 17:36:08 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78280 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- util/amdfwtool/amdfwtool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util/amdfwtool/amdfwtool.c') 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, -- cgit v1.2.3