From 4bfb36ed68154d8ee6fc77a6b2bf79938cae9e8a Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Sat, 11 Feb 2023 22:13:36 +0800 Subject: amdfwtool: use SoC ID info instead of misleading comboable flag Since it actually depends on the SoC type whether the old PSP directory table pointer or the new comboable PSP directory table pointer is used in EFS, get this information from the SoC ID instead of passing the comboable flag for the SoCs that need to use the new comboable PSP directory table pointer. TEST=Binary identical on amd/majolica, pcengines/apu2, amd/gardenia Change-Id: I0c3f21065939d1b13c2607aba16cbef74dd8d389 Signed-off-by: Zheng Bao Reviewed-on: https://review.coreboot.org/c/coreboot/+/73020 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- util/amdfwtool/amdfwtool.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'util/amdfwtool/amdfwtool.c') diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index a4abe1e781..ac25bd2087 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1726,7 +1726,6 @@ enum { AMDFW_OPT_XHCI = 128, AMDFW_OPT_IMC, AMDFW_OPT_GEC, - AMDFW_OPT_COMBO, AMDFW_OPT_RECOVERY_AB, AMDFW_OPT_RECOVERY_AB_SINGLE_COPY, AMDFW_OPT_USE_COMBO, @@ -1781,7 +1780,6 @@ static struct option long_options[] = { {"imc", required_argument, 0, AMDFW_OPT_IMC }, {"gec", required_argument, 0, AMDFW_OPT_GEC }, /* PSP Directory Table items */ - {"combo-capable", no_argument, 0, AMDFW_OPT_COMBO }, {"recovery-ab", no_argument, 0, AMDFW_OPT_RECOVERY_AB }, {"recovery-ab-single-copy", no_argument, 0, AMDFW_OPT_RECOVERY_AB_SINGLE_COPY }, {"use-combo", no_argument, 0, AMDFW_OPT_USE_COMBO }, @@ -2063,7 +2061,6 @@ int main(int argc, char **argv) psp_directory_table *pspdir = NULL; psp_directory_table *pspdir2 = NULL; psp_directory_table *pspdir2_b = NULL; - bool comboable = false; int fuse_defined = 0; int targetfd; char *output = NULL, *config = NULL; @@ -2107,9 +2104,6 @@ int main(int argc, char **argv) register_fw_filename(AMD_FW_GEC, sub, optarg); sub = instance = 0; break; - case AMDFW_OPT_COMBO: - comboable = true; - break; case AMDFW_OPT_RECOVERY_AB: cb_config.recovery_ab = true; break; @@ -2532,10 +2526,24 @@ int main(int argc, char **argv) amd_psp_fw_table, PSP_COOKIE, &cb_config); } - if (comboable) - amd_romsig->new_psp_directory = BUFF_TO_RUN(ctx, pspdir); - else + switch (cb_config.soc_id) { + case PLATFORM_UNKNOWN: amd_romsig->psp_directory = BUFF_TO_RUN(ctx, pspdir); + break; + case PLATFORM_CEZANNE: + case PLATFORM_MENDOCINO: + case PLATFORM_PHOENIX: + case PLATFORM_GLINDA: + case PLATFORM_CARRIZO: + case PLATFORM_STONEYRIDGE: + case PLATFORM_RAVEN: + case PLATFORM_PICASSO: + case PLATFORM_LUCIENNE: + case PLATFORM_RENOIR: + default: + amd_romsig->new_psp_directory = BUFF_TO_RUN(ctx, pspdir); + break; + } if (cb_config.use_combo) { psp_combo_directory *combo_dir = new_combo_dir(&ctx); -- cgit v1.2.3