From fe344ea5079810cffcf2aa294a574359e538fd93 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 20 Mar 2025 17:27:37 +0100 Subject: [PATCH] util/amdfwtool: add PLATFORM_FAEGAN Add the PLATFORM_FAEGAN element to the 'platform' enum and use it in the code. The Faegan SoC is similar to the Glinda SoC, but has a different PSP ID. Change-Id: I40a3e9981696fc02a44fbf300d1b47060a4a398b Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/86940 Reviewed-by: Maximilian Brune Tested-by: build bot (Jenkins) Reviewed-by: Ana Carolina Cabral --- util/amdfwtool/amdfwtool.c | 7 +++++++ util/amdfwtool/amdfwtool.h | 1 + util/amdfwtool/data_parse.c | 6 +++++- util/amdfwtool/signed_psp.c | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index c2a83ea637..73a13c3a8a 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -631,6 +631,7 @@ static void fill_psp_directory_to_efs(embedded_firmware *amd_romsig, void *pspdi case PLATFORM_LUCIENNE: case PLATFORM_RENOIR: case PLATFORM_GENOA: + case PLATFORM_FAEGAN: default: /* for combo, it is also combo_psp_directory */ amd_romsig->new_psp_directory = @@ -662,6 +663,7 @@ static void fill_bios_directory_to_efs(embedded_firmware *amd_romsig, void *bios case PLATFORM_MENDOCINO: case PLATFORM_PHOENIX: case PLATFORM_GLINDA: + case PLATFORM_FAEGAN: break; case PLATFORM_CARRIZO: case PLATFORM_STONEYRIDGE: @@ -704,6 +706,9 @@ static uint32_t get_psp_id(enum platform soc_id) case PLATFORM_GENOA: psp_id = 0xBC0C0111; break; + case PLATFORM_FAEGAN: + psp_id = 0xbc0e1000; + break; case PLATFORM_CARRIZO: default: psp_id = 0; @@ -1557,6 +1562,7 @@ static int set_efs_table(uint8_t soc_id, amd_cb_config *cb_config, case PLATFORM_PHOENIX: case PLATFORM_GLINDA: case PLATFORM_GENOA: + case PLATFORM_FAEGAN: amd_romsig->spi_readmode_f17_mod_30_3f = cb_config->efs_spi_readmode; amd_romsig->spi_fastspeed_f17_mod_30_3f = cb_config->efs_spi_speed; switch (cb_config->efs_spi_micron_flag) { @@ -1615,6 +1621,7 @@ static bool is_initial_alignment_required(enum platform soc_id) case PLATFORM_MENDOCINO: case PLATFORM_PHOENIX: case PLATFORM_GLINDA: + case PLATFORM_FAEGAN: return false; default: return true; diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 3c773f70d5..24a7dd3bf0 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -29,6 +29,7 @@ enum platform { PLATFORM_PHOENIX, PLATFORM_GLINDA, PLATFORM_GENOA, + PLATFORM_FAEGAN, }; typedef enum _amd_fw_type { diff --git a/util/amdfwtool/data_parse.c b/util/amdfwtool/data_parse.c index 64ec4d7e33..154d34dc6a 100644 --- a/util/amdfwtool/data_parse.c +++ b/util/amdfwtool/data_parse.c @@ -117,6 +117,8 @@ static enum platform identify_platform(char *soc_name) return PLATFORM_GLINDA; else if (!strcasecmp(soc_name, "Genoa")) return PLATFORM_GENOA; + else if (!strcasecmp(soc_name, "Faegan")) + return PLATFORM_FAEGAN; else return PLATFORM_UNKNOWN; } @@ -725,7 +727,8 @@ static uint8_t process_one_line(char *oneline, regmatch_t *match, char *dir, bool needs_ish(enum platform platform_type) { - if (platform_type == PLATFORM_MENDOCINO || platform_type == PLATFORM_PHOENIX || platform_type == PLATFORM_GLINDA) + if (platform_type == PLATFORM_MENDOCINO || platform_type == PLATFORM_PHOENIX || + platform_type == PLATFORM_GLINDA || platform_type == PLATFORM_FAEGAN) return true; else return false; @@ -746,6 +749,7 @@ static bool is_second_gen(enum platform platform_type) case PLATFORM_PHOENIX: case PLATFORM_GLINDA: case PLATFORM_GENOA: + case PLATFORM_FAEGAN: return true; case PLATFORM_UNKNOWN: default: diff --git a/util/amdfwtool/signed_psp.c b/util/amdfwtool/signed_psp.c index 24f76e8762..18215a04c2 100644 --- a/util/amdfwtool/signed_psp.c +++ b/util/amdfwtool/signed_psp.c @@ -40,6 +40,7 @@ static uint16_t get_psp_fw_type(enum platform soc_id, struct amd_fw_header *head case PLATFORM_MENDOCINO: case PLATFORM_PHOENIX: case PLATFORM_GLINDA: + case PLATFORM_FAEGAN: /* Fallback to fw_type if fw_id is not populated, which serves the same purpose on older SoCs. */ return header->fw_id ? header->fw_id : header->fw_type;