From da43c41f98dc38446e9c3726b54c84cdff8af374 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Sun, 19 Feb 2023 13:14:53 +0800 Subject: amdfwtool: Fill the address in EFS header as "relative to BIOS" If ctx.address_mode is "physical", it will keep as "physical". If ctx.address_mode is "relative to table", it will be changed as "relative to BIOS". Because the "current table" is the whole flash, the code worked well. TEST=Binary identical test on amd/birman amd/chausie amd/majolica amd/gardenia pcengines/apu2 amd/mandolin Change-Id: I9acb54cc5de149d8a705bb05bf351c44b7d3ced1 Signed-off-by: Zheng Bao Reviewed-on: https://review.coreboot.org/c/coreboot/+/73120 Tested-by: build bot (Jenkins) Reviewed-by: Fred Reitberger --- util/amdfwtool/amdfwtool.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'util/amdfwtool') diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 594cc531bc..daca1abbcb 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -2577,7 +2577,8 @@ int main(int argc, char **argv) switch (cb_config.soc_id) { case PLATFORM_UNKNOWN: - amd_romsig->psp_directory = BUFF_TO_RUN(ctx, pspdir); + amd_romsig->psp_directory = + BUFF_TO_RUN_MODE(ctx, pspdir, AMD_ADDR_REL_BIOS); break; case PLATFORM_CEZANNE: case PLATFORM_MENDOCINO: @@ -2590,17 +2591,20 @@ int main(int argc, char **argv) case PLATFORM_LUCIENNE: case PLATFORM_RENOIR: default: - amd_romsig->new_psp_directory = BUFF_TO_RUN(ctx, pspdir); + amd_romsig->new_psp_directory = + BUFF_TO_RUN_MODE(ctx, pspdir, AMD_ADDR_REL_BIOS); break; } if (cb_config.use_combo) { psp_combo_directory *combo_dir = new_combo_dir(&ctx); - amd_romsig->combo_psp_directory = BUFF_TO_RUN(ctx, combo_dir); + amd_romsig->combo_psp_directory = + BUFF_TO_RUN_MODE(ctx, combo_dir, AMD_ADDR_REL_BIOS); /* 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 = BUFF_TO_RUN(ctx, pspdir); + combo_dir->entries[0].lvl2_addr = + BUFF_TO_RUN_MODE(ctx, pspdir, AMD_ADDR_REL_BIOS); combo_dir->header.lookup = 1; fill_dir_header(combo_dir, 1, PSP2_COOKIE, &ctx); @@ -2644,7 +2648,8 @@ int main(int argc, char **argv) case PLATFORM_LUCIENNE: case PLATFORM_CEZANNE: if (!cb_config.recovery_ab) - amd_romsig->bios3_entry = BUFF_TO_RUN(ctx, biosdir); + amd_romsig->bios3_entry = + BUFF_TO_RUN_MODE(ctx, biosdir, AMD_ADDR_REL_BIOS); break; case PLATFORM_MENDOCINO: case PLATFORM_PHOENIX: @@ -2655,7 +2660,8 @@ int main(int argc, char **argv) case PLATFORM_RAVEN: case PLATFORM_PICASSO: default: - amd_romsig->bios1_entry = BUFF_TO_RUN(ctx, biosdir); + amd_romsig->bios1_entry = + BUFF_TO_RUN_MODE(ctx, biosdir, AMD_ADDR_REL_BIOS); break; } } -- cgit v1.2.3