[PATCH v2] ASoC: SOF: amd: Load alternatively signed firmware with an "_l" suffix

From: Mario Limonciello

Date: Thu Nov 05 2026 - 10:33:03 EST


Platforms ship BIOS with either a default or an alternative trust
authority. The PSP validates the signed DSP firmware image so it must
be signed with the matching scheme. Firmware for the alternative scheme
is named with an "_l" suffix before the extension
(e.g. "sof-X-code.bin" becomes "sof-X-code_l.bin").

The PSP reports the signing type in bit 6 of C2PMSG_63
(0 = default, 1 = alternative). Read it over SMN, as is already done
for the other PSP mailbox registers, when building the signed code
image name, and add the "_l" suffix for the alternative scheme.

Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx>
Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
Changes in v2:
- Clarify error
- Remove dead code for error condition
- Link to v1: https://patch.msgid.link/20261104-superm1-lms-sound-v1-1-c50b9284bcc2@xxxxxxx
---
sound/soc/sof/amd/acp.c | 29 ++++++++++++++++++++++++++++-
sound/soc/sof/amd/acp.h | 2 ++
2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 86e2402b8ffd2..7bb50b8265d8f 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -1212,6 +1212,27 @@ static int amd_sof_sdw_exit(struct snd_sof_dev *sdev)
}
#endif

+/*
+ * The PSP validates the signed DSP firmware, so it must be signed with the
+ * scheme the platform firmware uses: images for the alternative scheme are
+ * named with an "_l" suffix before the extension, the default ones have none.
+ */
+static int amd_sof_acp_get_fw_suffix(struct snd_sof_dev *sdev, const char **suffix)
+{
+ u32 val;
+ int ret;
+
+ ret = amd_smn_read(0, MP0_C2PMSG_63_REG, &val);
+ if (ret) {
+ dev_err(sdev->dev, "PSP firmware signing type read failed (err %d)\n", ret);
+ return ret;
+ }
+
+ *suffix = (val & MP0_C2PMSG_63_FW_SIGN_ALT) ? "_l" : "";
+
+ return 0;
+}
+
int amd_sof_acp_probe(struct snd_sof_dev *sdev)
{
struct pci_dev *pci = to_pci_dev(sdev->dev);
@@ -1448,8 +1469,14 @@ int amd_sof_acp7x_probe(struct snd_sof_dev *sdev)
sdev->debug_box.size = BOX_SIZE_1024;

if (adata->acp_sof_signed_firmware_image) {
+ const char *fw_suffix;
+
+ ret = amd_sof_acp_get_fw_suffix(sdev, &fw_suffix);
+ if (ret)
+ goto free_ipc_irq;
+
adata->fw_code_bin = devm_kasprintf(sdev->dev, GFP_KERNEL,
- "sof-%s-code.bin", chip->name);
+ "sof-%s-code%s.bin", chip->name, fw_suffix);
if (!adata->fw_code_bin) {
ret = -ENOMEM;
goto free_ipc_irq;
diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h
index b17a36b31ee0d..81eeeabc5cf5c 100644
--- a/sound/soc/sof/amd/acp.h
+++ b/sound/soc/sof/amd/acp.h
@@ -97,6 +97,8 @@
#define ACP_EXT_INTR_ERROR_STAT 0x20000000
#define MP0_C2PMSG_114_REG 0x3810AC8
#define MP0_C2PMSG_73_REG 0x3810A24
+#define MP0_C2PMSG_63_REG 0x38109FC
+#define MP0_C2PMSG_63_FW_SIGN_ALT BIT(6)
#define MBOX_ACP_SHA_DMA_COMMAND 0x70000
#define MBOX_ACP_IRAM_DRAM_FENCE_COMMAND 0x80000
#define MBOX_DELAY_US 1000

---
base-commit: 68e9934bd17af558b62cac8a444de28d4d5cdb9f
change-id: 20261104-superm1-lms-sound-c0f429351fc7

Best regards,
--
Mario Limonciello <mario.limonciello@xxxxxxx>