mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-12-04 23:00:56 -06:00
ASoC: SOF: amd: extend signed firmware pre-run for ACP7x
Parse SizeFWSigned from the ACP image header when loading signed firmware on ACP7.B/7.F platforms. Keep the legacy ACP_FIRMWARE_SIGNATURE subtraction for pre-7B platforms using quirks. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://patch.msgid.link/20260701095759.1012929-8-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/unaligned.h>
|
||||
|
||||
#include "../ops.h"
|
||||
#include "acp-dsp-offset.h"
|
||||
@@ -173,10 +174,19 @@ int acp_dsp_pre_fw_run(struct snd_sof_dev *sdev)
|
||||
|
||||
adata = sdev->pdata->hw_pdata;
|
||||
|
||||
if (adata->quirks && adata->quirks->signed_fw_image)
|
||||
if (adata->pci_rev >= ACP7B_PCI_ID) {
|
||||
if (adata->acp_sof_signed_firmware_image) {
|
||||
size_fw = get_unaligned_le32(adata->bin_buf +
|
||||
ACP_IMAGE_HDR_SIZE_FW_SIGNED_OFF);
|
||||
size_fw += ACP_IMAGE_HEADER_SIZE;
|
||||
} else {
|
||||
size_fw = adata->fw_bin_size;
|
||||
}
|
||||
} else if (adata->quirks && adata->quirks->signed_fw_image) {
|
||||
size_fw = adata->fw_bin_size - ACP_FIRMWARE_SIGNATURE;
|
||||
else
|
||||
} else {
|
||||
size_fw = adata->fw_bin_size;
|
||||
}
|
||||
|
||||
page_count = PAGE_ALIGN(size_fw) >> PAGE_SHIFT;
|
||||
adata->fw_bin_page_count = page_count;
|
||||
|
||||
@@ -113,6 +113,9 @@
|
||||
#define PROBE_STATUS_BIT BIT(31)
|
||||
|
||||
#define ACP_FIRMWARE_SIGNATURE 0x100
|
||||
#define ACP_IMAGE_HEADER_SIZE ACP_FIRMWARE_SIGNATURE
|
||||
#define ACP_IMAGE_HDR_SIZE_FW_SIGNED_OFF 0x14
|
||||
|
||||
#define ACP_ERROR_IRQ_MASK BIT(29)
|
||||
#define ACP_SDW0_IRQ_MASK BIT(21)
|
||||
#define ACP_SDW1_IRQ_MASK BIT(2)
|
||||
|
||||
Reference in New Issue
Block a user