From: Mario Limonciello <mario.limonciello@amd.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: <sound-open-firmware@alsa-project.org>,
<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH] ASoC: SOF: amd: Load alternatively signed firmware with an "_l" suffix
Date: Wed, 4 Nov 2026 15:53:27 -0600 [thread overview]
Message-ID: <20261104-superm1-lms-sound-v1-1-c50b9284bcc2@amd.com> (raw)
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@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
sound/soc/sof/amd/acp.c | 33 ++++++++++++++++++++++++++++++++-
sound/soc/sof/amd/acp.h | 2 ++
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 86e2402b8ffd2..2f1a8be8460d4 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -1212,6 +1212,31 @@ 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, "failed to read PSP firmware signing type: %d\n", ret);
+ return ret;
+ }
+
+ /* all ones means the register isn't accessible */
+ if (val == 0xffffffff)
+ return -EIO;
+
+ *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 +1473,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@amd.com>
next reply other threads:[~2026-11-04 21:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 21:53 Mario Limonciello [this message]
2026-11-05 14:03 ` Péter Ujfalusi
2026-11-05 14:07 ` Mark Brown
2026-11-05 14:16 ` Mario Limonciello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261104-superm1-lms-sound-v1-1-c50b9284bcc2@amd.com \
--to=mario.limonciello@amd.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®