aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/ipc4-loader.c
diff options
context:
space:
mode:
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;