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/+/84233?usp=email
to review the following change.
Change subject: amdfwtool: Add combo new layout for new family ......................................................................
amdfwtool: Add combo new layout for new family
The A/B recovery layout has a new way to support combo. It packs multiple entries into PSP L1 directory.
TEST=Identical test on all AMD platform
Change-Id: If573cdeaeb56e95d2fed235c9337fab82d622757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c M util/amdfwtool/amdfwtool.h 2 files changed, 11 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/84233/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 1d94e06..6aac03a 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1610,6 +1610,8 @@
open_process_config(cb_config.config, &cb_config);
+ if (cb_config.soc_id == PLATFORM_PHOENIX) + cb_config.combo_new_rab = true; ctx.rom = malloc(ctx.rom_size); if (!ctx.rom) { fprintf(stderr, "Error: Failed to allocate memory\n"); @@ -1664,7 +1666,7 @@ cb_config.signed_start_addr, cb_config.soc_id);
- if (cb_config.use_combo) { + if (cb_config.use_combo && !cb_config.combo_new_rab) { ctx.psp_combo_dir = new_combo_dir(&ctx, PSP2_COOKIE);
adjust_current_pointer(&ctx, 0, 0x1000U); @@ -1677,11 +1679,11 @@ if (cb_config.config) cb_config.combo_config[0] = cb_config.config;
+ ctx.pspdir = NULL; do { if (cb_config.use_combo && cb_config.debug) printf("Processing %dth combo entry\n", combo_index);
- ctx.pspdir = NULL; ctx.pspdir2 = NULL; ctx.pspdir2_b = NULL; ctx.biosdir = NULL; @@ -1735,7 +1737,9 @@ */ ctx.pspdir2_b = NULL; /* More explicitly */ } - integrate_psp_firmwares(&ctx, + if ((combo_index == 0 && cb_config.combo_new_rab) || + !cb_config.combo_new_rab) + integrate_psp_firmwares(&ctx, amd_psp_fw_table, PSP_COOKIE, &cb_config); integrate_psp_levels(&ctx, &cb_config); } else { @@ -1744,9 +1748,10 @@ amd_psp_fw_table, PSP_COOKIE, &cb_config); }
- if (!cb_config.use_combo) { + if (!cb_config.use_combo || (cb_config.combo_new_rab && combo_index == 0)) { + /* For new combo layout, there is only 1 PSP level 1 directory. */ fill_psp_directory_to_efs(ctx.amd_romsig_ptr, ctx.pspdir, &ctx, &cb_config); - } else { + } else if (cb_config.use_combo && !cb_config.combo_new_rab) { 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); diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 7ca7d89..60a3754 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -426,6 +426,7 @@ bool recovery_ab_single_copy; bool need_ish; bool use_combo; + bool combo_new_rab; bool have_apcb_bk; enum platform soc_id;