aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorZheng Bao <fishbaozi@gmail.com>2023-02-19 13:14:53 +0800
committerFred Reitberger <reitbergerfred@gmail.com>2023-02-28 12:54:03 +0000
commitda43c41f98dc38446e9c3726b54c84cdff8af374 (patch)
treec4033ec1e8809b1d04dd2f930e4d39e45f4f41ad /util
parent222903e57a497f6d4b1b293e713caab66a23d862 (diff)
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 <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/73120 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Diffstat (limited to 'util')
-rw-r--r--util/amdfwtool/amdfwtool.c18
1 files changed, 12 insertions, 6 deletions
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;
}
}