summaryrefslogtreecommitdiff
path: root/sound/soc/sof/ipc4-loader.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-10-03 16:30:42 +0200
committerTakashi Iwai <tiwai@suse.de>2022-10-03 16:30:42 +0200
commit86a4d29e75540e20f991e72f17aa51d0e775a397 (patch)
tree87d99ee3855d97da60074fdc9c0cdd63dd2da66b /sound/soc/sof/ipc4-loader.c
parent02f2e785c4834828876a4701926416157dfd7b26 (diff)
parentf0c8d7468af0001b80b0c86802ee28063f800987 (diff)
Merge tag 'asoc-v6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v6.1 This has been a very quiet release for the core but quite a busy one for drivers with a big crop of new drivers and lots of feature additions and fixes to existing ones: - A new string helper parse_int_array_user(). - Improvements to the SOF IPC4 code, especially around trace. - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silcon systems, Everest ES8326, Intel Sky Lake and Kaby Lake, MediaTek MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450 and Texas Instruments SRC4392 There is a conflict with the conversion of I2C remove functions to void in the cs42l42 driver which is fairly straightforward to resolve but should be highlighted to Linus.
Diffstat (limited to 'sound/soc/sof/ipc4-loader.c')
-rw-r--r--sound/soc/sof/ipc4-loader.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c
index 9fadae8fd011..e635ae515fa9 100644
--- a/sound/soc/sof/ipc4-loader.c
+++ b/sound/soc/sof/ipc4-loader.c
@@ -8,6 +8,7 @@
#include <linux/firmware.h>
#include <sound/sof/ext_manifest4.h>
#include <sound/sof/ipc4/header.h>
+#include <trace/events/sof.h>
#include "ipc4-priv.h"
#include "sof-audio.h"
#include "sof-priv.h"
@@ -40,6 +41,17 @@ static size_t sof_ipc4_fw_parse_ext_man(struct snd_sof_dev *sdev)
ext_man_hdr = (struct sof_ext_manifest4_hdr *)fw->data;
+ /*
+ * At the start of the firmware image we must have an extended manifest.
+ * Verify that the magic number is correct.
+ */
+ if (ext_man_hdr->id != SOF_EXT_MAN4_MAGIC_NUMBER) {
+ dev_err(sdev->dev,
+ "Unexpected extended manifest magic number: %#x\n",
+ ext_man_hdr->id);
+ return -EINVAL;
+ }
+
fw_hdr_offset = ipc4_data->manifest_fw_hdr_offset;
if (!fw_hdr_offset)
return -EINVAL;
@@ -146,6 +158,7 @@ static int sof_ipc4_validate_firmware(struct snd_sof_dev *sdev)
static int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev)
{
+ struct sof_ipc4_fw_data *ipc4_data = sdev->private;
const struct sof_ipc_ops *iops = sdev->ipc->ops;
struct sof_ipc4_fw_version *fw_ver;
struct sof_ipc4_tuple *tuple;
@@ -182,13 +195,14 @@ static int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev)
fw_ver->build);
break;
case SOF_IPC4_FW_CFG_DL_MAILBOX_BYTES:
- dev_vdbg(sdev->dev, "DL mailbox size: %u\n", *tuple->value);
+ trace_sof_ipc4_fw_config(sdev, "DL mailbox size", *tuple->value);
break;
case SOF_IPC4_FW_CFG_UL_MAILBOX_BYTES:
- dev_vdbg(sdev->dev, "UL mailbox size: %u\n", *tuple->value);
+ trace_sof_ipc4_fw_config(sdev, "UL mailbox size", *tuple->value);
break;
case SOF_IPC4_FW_CFG_TRACE_LOG_BYTES:
- dev_vdbg(sdev->dev, "Trace log size: %u\n", *tuple->value);
+ trace_sof_ipc4_fw_config(sdev, "Trace log size", *tuple->value);
+ ipc4_data->mtrace_log_bytes = *tuple->value;
break;
default:
break;