summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/ipc4-loader.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2022-09-09 14:43:30 +0300
committerMark Brown <broonie@kernel.org>2022-09-09 18:48:48 +0100
commitf4ea22f7aa7536560097d765be56445933d07e0d (patch)
treed43f6b698ee8114389ebc0cf395ea1d122d439c4 /sound/soc/sof/ipc4-loader.c
parenta5d0147ac9f8ea6c08d00b28f0468c9cb3fdfde8 (diff)
downloadlinux-stable-f4ea22f7aa7536560097d765be56445933d07e0d.tar.gz
linux-stable-f4ea22f7aa7536560097d765be56445933d07e0d.tar.bz2
linux-stable-f4ea22f7aa7536560097d765be56445933d07e0d.zip
ASoC: SOF: ipc4: Add support for mtrace log extraction
One of the debugging/logging features for an IPC4 based firmware is the use of the debug window to deliver log messages to host via the shared SRAM. The initial implementation of the mtrace supports only TGL/MTL style of logging, but can be extended to support other types, like APL, SKL, CNL, etc. The window is split into 16 'slots' where the first slot contains the descriptors for the remaining 15 slots. Each DSP core logs to a separate slot and the slot allocation is not fixed, we can not assume that the first slot is always used by core0 for example. The firmware sends LOG_BUFFER_STATUS message when new log batch is available from one of the cores (after it updated the write_ptr in the given slot). Host should update the read_ptr in the same slot when it has taken out log data. The patch also updates the sof_ipc4_fw_data struct with parameters needed for the mtrace to be enabled and used safely. Co-developed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Rander Wang <rander.wang@intel.com> Co-developed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220909114332.31393-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ipc4-loader.c')
-rw-r--r--sound/soc/sof/ipc4-loader.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c
index 8bd2132b4f41..c678f05d0ef5 100644
--- a/sound/soc/sof/ipc4-loader.c
+++ b/sound/soc/sof/ipc4-loader.c
@@ -157,6 +157,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;
@@ -200,6 +201,7 @@ static int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev)
break;
case SOF_IPC4_FW_CFG_TRACE_LOG_BYTES:
dev_vdbg(sdev->dev, "Trace log size: %u\n", *tuple->value);
+ ipc4_data->mtrace_log_bytes = *tuple->value;
break;
default:
break;