Martin L Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73517 )
Change subject: soc/amd/common/psp: Only set SPL fuses if an SPL file is present ......................................................................
soc/amd/common/psp: Only set SPL fuses if an SPL file is present
Use the presence of an SPL (Software Patch Level) file to trigger the function that reads and writes the SPL fuses. The current Kconfig option will be used to decide to write the fuses. This allows us to see the state of the SPL update bit which determines whether or not SPL fusing is allowed and needed before enabling the fusing.
- Refactor a bit to prepare for following changes. - Update phrasing
Signed-off-by: Martin Roth gaumless@gmail.com Change-Id: I7bd2798b984673a4bd3c72f3cab52f1c9a786c67 --- M src/soc/amd/common/block/psp/psp_gen2.c 1 file changed, 33 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/73517/1
diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c index 65043e5..f7ee5bb 100644 --- a/src/soc/amd/common/block/psp/psp_gen2.c +++ b/src/soc/amd/common/block/psp/psp_gen2.c @@ -116,23 +116,29 @@
static void psp_set_spl_fuse(void *unused) { - if (!CONFIG(SOC_AMD_COMMON_BLOCK_PSP_FUSE_SPL)) - return; - int cmd_status = 0; struct mbox_cmd_late_spl_buffer buffer = { .header = { .size = sizeof(buffer) } }; + uint32_t c2p38 = soc_read_c2p38();
- if (soc_read_c2p38() & CORE_2_PSP_MSG_38_FUSE_SPL) { - printk(BIOS_DEBUG, "PSP: Fuse SPL requested\n"); - cmd_status = send_psp_command(MBOX_BIOS_CMD_SET_SPL_FUSE, &buffer); - psp_print_cmd_status(cmd_status, NULL); + if (c2p38 & CORE_2_PSP_MSG_38_FUSE_SPL) { + printk(BIOS_DEBUG, "PSP: SPL Fusing may be updated.\n"); } else { - printk(BIOS_DEBUG, "PSP: Fuse SPL not requested\n"); + printk(BIOS_DEBUG, "PSP: SPL Fusing not currently required.\n"); + return; } + + if (!CONFIG(SOC_AMD_COMMON_BLOCK_PSP_FUSE_SPL)) + return; + + printk(BIOS_DEBUG, "PSP: SPL Fusing Update Requested.\n"); + cmd_status = send_psp_command(MBOX_BIOS_CMD_SET_SPL_FUSE, &buffer); + psp_print_cmd_status(cmd_status, NULL); }
+#if CONFIG(HAVE_SPL_FILE) BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_ENTRY, psp_set_spl_fuse, NULL); +#endif