amdfwtool: Move ISH before PSP L2
The amdfw.rom will be divided into 3 parts: PSP Level 1, PSP Level 2A, PSP Level 2B. The two ISHs are close to L1 and can be combined as a CBFS module. To do that, move the new_psp_dir for L1 and L2 to separated branches. The final sequence is EFS, PSP L1, ISH A, ISH B, PSP L2A, BIOS L2A, PSP L2B, BIOS L2B. TEST=Google/Skyrim Change-Id: Id69268619893d78d9b5330052a4fd5b501263f75 Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84533 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
This commit is contained in:
parent
c1c83df3b5
commit
e38056bef8
1 changed files with 24 additions and 15 deletions
|
|
@ -967,11 +967,6 @@ static void integrate_psp_levels(context *ctx,
|
|||
current_table_save = ctx->current_table;
|
||||
ctx->current_table = BUFF_TO_RUN_MODE(*ctx, pspdir, AMD_ADDR_REL_BIOS);
|
||||
if (recovery_ab && (pspdir2 != NULL)) {
|
||||
if (cb_config->need_ish) { /* Need ISH */
|
||||
ctx->ish_a_dir = new_ish_dir(ctx);
|
||||
if (pspdir2_b != NULL)
|
||||
ctx->ish_b_dir = new_ish_dir(ctx);
|
||||
}
|
||||
integrate_psp_ab(ctx, pspdir, pspdir2, ctx->ish_a_dir,
|
||||
AMD_FW_RECOVERYAB_A, cb_config->soc_id);
|
||||
if (pspdir2_b != NULL)
|
||||
|
|
@ -1012,7 +1007,7 @@ static void integrate_psp_firmwares(context *ctx,
|
|||
unsigned int i, count;
|
||||
int level;
|
||||
uint32_t size;
|
||||
psp_directory_table *pspdir;
|
||||
psp_directory_table *pspdir = NULL;
|
||||
uint64_t addr;
|
||||
uint32_t current_table_save;
|
||||
bool recovery_ab = cb_config->recovery_ab;
|
||||
|
|
@ -1023,17 +1018,31 @@ static void integrate_psp_firmwares(context *ctx,
|
|||
* is passed, clearly a 2nd-level table is intended. However, a
|
||||
* 1st-level cookie may indicate level 1 or flattened.
|
||||
*/
|
||||
pspdir = new_psp_dir(ctx, cb_config->multi_level, cookie);
|
||||
current_table_save = ctx->current_table;
|
||||
|
||||
if (cookie == PSP_COOKIE) {
|
||||
ctx->pspdir = pspdir;
|
||||
if (recovery_ab)
|
||||
ctx->pspdir_bak = new_psp_dir(ctx, cb_config->multi_level, cookie);
|
||||
if (!cb_config->combo_new_rab || ctx->combo_index == 0) {
|
||||
pspdir = new_psp_dir(ctx, cb_config->multi_level, cookie);
|
||||
ctx->pspdir = pspdir;
|
||||
if (recovery_ab)
|
||||
ctx->pspdir_bak = new_psp_dir(ctx, cb_config->multi_level, cookie);
|
||||
}
|
||||
/* The ISH tables are with PSP L1. */
|
||||
if (cb_config->need_ish && ctx->ish_a_dir == NULL) /* Need ISH */
|
||||
ctx->ish_a_dir = new_ish_dir(ctx);
|
||||
if (cb_config->need_ish && ctx->ish_b_dir == NULL) /* Need ISH */
|
||||
ctx->ish_b_dir = new_ish_dir(ctx);
|
||||
} else if (cookie == PSPL2_COOKIE) {
|
||||
if (ctx->pspdir2 == NULL)
|
||||
if (ctx->pspdir2 == NULL) {
|
||||
pspdir = new_psp_dir(ctx, cb_config->multi_level, cookie);
|
||||
ctx->pspdir2 = pspdir;
|
||||
else if (ctx->pspdir2_b == NULL)
|
||||
} else if (ctx->pspdir2_b == NULL) {
|
||||
pspdir = new_psp_dir(ctx, cb_config->multi_level, cookie);
|
||||
ctx->pspdir2_b = pspdir;
|
||||
}
|
||||
}
|
||||
if (pspdir == NULL) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!cb_config->multi_level)
|
||||
|
|
@ -1053,7 +1062,7 @@ static void integrate_psp_firmwares(context *ctx,
|
|||
else
|
||||
level = PSP_BOTH_AB;
|
||||
}
|
||||
current_table_save = ctx->current_table;
|
||||
|
||||
ctx->current_table = BUFF_TO_RUN_MODE(*ctx, pspdir, AMD_ADDR_REL_BIOS);
|
||||
adjust_current_pointer(ctx, 0, TABLE_ALIGNMENT);
|
||||
|
||||
|
|
@ -1153,6 +1162,7 @@ static void integrate_psp_firmwares(context *ctx,
|
|||
}
|
||||
|
||||
fill_dir_header(pspdir, count, ctx);
|
||||
out:
|
||||
ctx->current_table = current_table_save;
|
||||
}
|
||||
|
||||
|
|
@ -1824,8 +1834,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (cb_config.multi_level) {
|
||||
/* PSP L1 */
|
||||
if (!cb_config.combo_new_rab || ctx.combo_index == 0)
|
||||
integrate_psp_firmwares(&ctx,
|
||||
integrate_psp_firmwares(&ctx,
|
||||
amd_psp_fw_table, PSP_COOKIE, &cb_config);
|
||||
/* PSP L2 & BIOS L2 (if AB recovery) */
|
||||
integrate_psp_firmwares(&ctx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue