Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84531?usp=email )
Change subject: amdfwtool: Merge all the steps for A/B recovery into one branch ......................................................................
amdfwtool: Merge all the steps for A/B recovery into one branch
Clean up the code to make it more logical. This is for later changes to reorder the PSP Level 1, Level 2, ISH and BIOS tables.
TEST=Identical test on all AMD platform
Change-Id: I5f7213fd42c7f0ff5ecd9e504a6654cdfb1e3513 Signed-off-by: Zheng Bao fishbaozi@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/84531 Reviewed-by: Maximilian Brune maximilian.brune@9elements.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/amdfwtool/amdfwtool.c 1 file changed, 6 insertions(+), 19 deletions(-)
Approvals: Maximilian Brune: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 0de0475..89aff6a 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1770,34 +1770,21 @@ /* Do 2nd PSP directory followed by 1st */ integrate_psp_firmwares(&ctx, amd_psp_fw_table, PSPL2_COOKIE, &cb_config); - if (cb_config.recovery_ab) + if (cb_config.recovery_ab) { integrate_bios_firmwares(&ctx, amd_bios_table, BHDL2_COOKIE, &cb_config); - - if (cb_config.recovery_ab && !cb_config.recovery_ab_single_copy) { - /* Create a copy of PSP Directory 2 in the backup slot B. - Related biosdir2_b copy will be created later. */ - integrate_psp_firmwares(&ctx, + if (!cb_config.recovery_ab_single_copy) { + integrate_psp_firmwares(&ctx, amd_psp_fw_table, PSPL2_COOKIE, &cb_config); - integrate_bios_firmwares(&ctx, + integrate_bios_firmwares(&ctx, amd_bios_table, BHDL2_COOKIE, &cb_config); - } else { - /* - * Either the platform is using only - * one slot or B is same as above - * directories for A. Skip creating - * pspdir2_b here to save flash space. - * Related biosdir2_b will be skipped - * automatically. - */ - ctx.pspdir2_b = NULL; /* More explicitly */ + } + integrate_bios_levels(&ctx, &cb_config); } if (!cb_config.combo_new_rab || combo_index == 0) integrate_psp_firmwares(&ctx, amd_psp_fw_table, PSP_COOKIE, &cb_config); integrate_psp_levels(&ctx, &cb_config); - if (cb_config.recovery_ab) - integrate_bios_levels(&ctx, &cb_config); } else { /* flat: PSP 1 cookie and no pointer to 2nd table */ integrate_psp_firmwares(&ctx,