From 973d0faf65d7a756f6f1c61d6c7e03d2d2ad9a22 Mon Sep 17 00:00:00 2001 From: Maximilian Brune Date: Wed, 26 Mar 2025 17:23:15 +0100 Subject: [PATCH] util/amdfwtool: Move needs_ish and combo_new_rab to data_parse.c Move these functions for better readability. Signed-off-by: Maximilian Brune Change-Id: Ib609d967e23b4ca1937e00ec72a669751ef09714 Reviewed-on: https://review.coreboot.org/c/coreboot/+/87019 Reviewed-by: Patrick Rudolph Reviewed-by: Ana Carolina Cabral Tested-by: build bot (Jenkins) --- util/amdfwtool/amdfwtool.c | 8 -------- util/amdfwtool/amdfwtool.h | 1 - util/amdfwtool/data_parse.c | 10 +++++++++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 07736dd595..9e9ada79a7 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1687,11 +1687,6 @@ static bool is_initial_alignment_required(enum platform soc_id) } } -static bool needs_new_combo_layout(enum platform soc_id) -{ - return needs_ish(soc_id); -} - int main(int argc, char **argv) { int retval = 0; @@ -1719,9 +1714,6 @@ int main(int argc, char **argv) open_process_config(cb_config.config, &cb_config); - if (cb_config.use_combo && needs_new_combo_layout(cb_config.soc_id)) - cb_config.combo_new_rab = true; - ctx.rom = malloc(ctx.rom_size); if (!ctx.rom) { fprintf(stderr, "Error: Failed to allocate memory\n"); diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 2327584813..dbc1c4adc0 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -500,7 +500,6 @@ void process_signed_psp_firmwares(const char *signed_rom, uint64_t signed_start_addr, enum platform soc_id); int find_bios_entry(amd_bios_type type); -bool needs_ish(enum platform platform_type); #define EFS_FILE_SUFFIX ".efs" #define TMP_FILE_SUFFIX ".tmp" diff --git a/util/amdfwtool/data_parse.c b/util/amdfwtool/data_parse.c index 8e75d652fa..13922d63c9 100644 --- a/util/amdfwtool/data_parse.c +++ b/util/amdfwtool/data_parse.c @@ -792,7 +792,7 @@ static uint8_t process_one_line(char *oneline, regmatch_t *match, char *dir, return 1; } -bool needs_ish(enum platform platform_type) +static bool needs_ish(enum platform platform_type) { if (platform_type == PLATFORM_MENDOCINO || platform_type == PLATFORM_PHOENIX || platform_type == PLATFORM_GLINDA || platform_type == PLATFORM_FAEGAN) @@ -801,6 +801,11 @@ bool needs_ish(enum platform platform_type) return false; } +static bool needs_new_combo_layout(enum platform soc_id) +{ + return needs_ish(soc_id); +} + static bool is_second_gen(enum platform platform_type) { switch (platform_type) { @@ -877,6 +882,9 @@ uint8_t process_config(FILE *config, amd_cb_config *cb_config) if (cb_config->need_ish) cb_config->recovery_ab = true; + if (cb_config->use_combo && needs_new_combo_layout(cb_config->soc_id)) + cb_config->combo_new_rab = true; + if (cb_config->recovery_ab) cb_config->multi_level = true;