Attention is currently required from: Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/84131?usp=email
to review the following change.
Change subject: amdfwtool: Add a unified function to add combo entries ......................................................................
amdfwtool: Add a unified function to add combo entries
TEST=Binary identical test on all AMD SOC platform with use_combo
Change-Id: I41c5c6fb5acf92604dd06becf1eda680a1fab545 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c 1 file changed, 16 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/84131/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 5be5a00..852a627 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1471,6 +1471,20 @@ ctx->current_table = current_table_save; }
+static void add_combo_entry(void *combo_dir, void *dir, uint32_t combo_index, + context *ctx, amd_cb_config *cb_config) +{ + psp_combo_directory *cdir = combo_dir; + /* 0 -Compare PSP ID, 1 -Compare chip family ID */ + assert_fw_entry(combo_index, MAX_COMBO_ENTRIES, ctx); + cdir->entries[combo_index].id_sel = 0; + cdir->entries[combo_index].id = get_psp_id(cb_config->soc_id); + cdir->entries[combo_index].lvl2_addr = + BUFF_TO_RUN_MODE(*ctx, dir, AMD_ADDR_REL_BIOS); + + fill_dir_header(combo_dir, combo_index + 1, ctx); +} + static int set_efs_table(uint8_t soc_id, amd_cb_config *cb_config, embedded_firmware *amd_romsig) { @@ -1748,14 +1762,7 @@ fill_psp_directory_to_efs(ctx.amd_romsig_ptr, ctx.pspdir, &ctx, &cb_config); } else { fill_psp_directory_to_efs(ctx.amd_romsig_ptr, ctx.psp_combo_dir, &ctx, &cb_config); - /* 0 -Compare PSP ID, 1 -Compare chip family ID */ - assert_fw_entry(combo_index, MAX_COMBO_ENTRIES, &ctx); - ctx.psp_combo_dir->entries[combo_index].id_sel = 0; - ctx.psp_combo_dir->entries[combo_index].id = get_psp_id(cb_config.soc_id); - ctx.psp_combo_dir->entries[combo_index].lvl2_addr = - BUFF_TO_RUN_MODE(ctx, ctx.pspdir, AMD_ADDR_REL_BIOS); - - fill_dir_header(ctx.psp_combo_dir, combo_index + 1, &ctx); + add_combo_entry(ctx.psp_combo_dir, ctx.pspdir, combo_index, &ctx, &cb_config); }
if (have_bios_tables(amd_bios_table)) { @@ -1788,14 +1795,7 @@ */ fill_bios_directory_to_efs(ctx.amd_romsig_ptr, ctx.bhd_combo_dir, &ctx, &cb_config); - assert_fw_entry(combo_index, MAX_COMBO_ENTRIES, &ctx); - ctx.bhd_combo_dir->entries[combo_index].id_sel = 0; - ctx.bhd_combo_dir->entries[combo_index].id = - get_psp_id(cb_config.soc_id); - ctx.bhd_combo_dir->entries[combo_index].lvl2_addr = - BUFF_TO_RUN_MODE(ctx, ctx.biosdir, AMD_ADDR_REL_BIOS); - - fill_dir_header(ctx.bhd_combo_dir, combo_index + 1, &ctx); + add_combo_entry(ctx.bhd_combo_dir, ctx.biosdir, combo_index, &ctx, &cb_config); } } if (cb_config.debug)