summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/ipc3-priv.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-05-20 14:56:35 +0100
committerMark Brown <broonie@kernel.org>2022-05-20 14:56:35 +0100
commite5cd20e0d6713138444cc3f3f982712cf9a36143 (patch)
treec5eaa370df0dfb42ab13727c385aa297209caa21 /sound/soc/sof/ipc3-priv.h
parentf7a344468105ef8c54086dfdc800e6f5a8417d3e (diff)
parent0683532999ab3890f44f832cd47feee9e2374c22 (diff)
downloadlinux-e5cd20e0d6713138444cc3f3f982712cf9a36143.tar.gz
linux-e5cd20e0d6713138444cc3f3f982712cf9a36143.tar.bz2
linux-e5cd20e0d6713138444cc3f3f982712cf9a36143.zip
ASoC: SOF: Introduce generic (in)firmware tracing infrastructure
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com> From the kernel point of view there are only few ops that needs to be exposed: Hi, SOF is using dma-trace (or dtrace) as a firmware tracing method, which is only supported with IPC3 and it is not applicable for IPC4. Currently the dtrace is 'open managed' regardless of IPC version (we do force disable it for IPC4, but the dtrace calls remain in place). From the kernel point of view there are only few ops that needs to be exposed by the firmware tracing support and everything else is IPC private, should not be known by the core. This series converts the current dma-trace as ipc3 specific firmware tracing sub-component and moves all private data out from generic code. Regards, Peter --- Peter Ujfalusi (8): ASoC: SOF: Introduce IPC independent ops for firmware tracing support ASoC: SOF: Rename dtrace_is_supported flag to fw_trace_is_supported ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation ASoC: SOF: Switch to IPC generic firmware tracing ASoC: SOF: ipc3-dtrace: Move host ops wrappers from generic header to private ASoC: SOF: Modify the host trace_init parameter list to include dmab ASoC: SOF: Introduce opaque storage of private data for firmware tracing ASoC: SOF: ipc3-dtrace: Move dtrace related variables local from sof_dev sound/soc/sof/Makefile | 1 + sound/soc/sof/amd/acp-trace.c | 4 +- sound/soc/sof/amd/acp.h | 2 +- sound/soc/sof/core.c | 13 +- sound/soc/sof/debug.c | 2 +- sound/soc/sof/intel/hda-dsp.c | 2 +- sound/soc/sof/intel/hda-trace.c | 4 +- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/ipc.c | 6 + sound/soc/sof/ipc3-dtrace.c | 649 ++++++++++++++++++++++++++++++++ sound/soc/sof/ipc3-priv.h | 38 ++ sound/soc/sof/ipc3.c | 3 +- sound/soc/sof/ops.c | 2 +- sound/soc/sof/ops.h | 26 -- sound/soc/sof/pm.c | 8 +- sound/soc/sof/sof-priv.h | 53 +-- sound/soc/sof/trace.c | 621 ++---------------------------- 17 files changed, 767 insertions(+), 669 deletions(-) create mode 100644 sound/soc/sof/ipc3-dtrace.c -- 2.36.1
Diffstat (limited to 'sound/soc/sof/ipc3-priv.h')
-rw-r--r--sound/soc/sof/ipc3-priv.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/sound/soc/sof/ipc3-priv.h b/sound/soc/sof/ipc3-priv.h
index 82f9d0cbfb93..f5044202f3c5 100644
--- a/sound/soc/sof/ipc3-priv.h
+++ b/sound/soc/sof/ipc3-priv.h
@@ -16,6 +16,7 @@ extern const struct sof_ipc_pcm_ops ipc3_pcm_ops;
extern const struct sof_ipc_tplg_ops ipc3_tplg_ops;
extern const struct sof_ipc_tplg_control_ops tplg_ipc3_control_ops;
extern const struct sof_ipc_fw_loader_ops ipc3_loader_ops;
+extern const struct sof_ipc_fw_tracing_ops ipc3_dtrace_ops;
/* helpers for fw_ready and ext_manifest parsing */
int sof_ipc3_get_ext_windows(struct snd_sof_dev *sdev,
@@ -24,4 +25,41 @@ int sof_ipc3_get_cc_info(struct snd_sof_dev *sdev,
const struct sof_ipc_ext_data_hdr *ext_hdr);
int sof_ipc3_validate_fw_version(struct snd_sof_dev *sdev);
+/* dtrace position update */
+int ipc3_dtrace_posn_update(struct snd_sof_dev *sdev,
+ struct sof_ipc_dma_trace_posn *posn);
+
+/* dtrace platform callback wrappers */
+static inline int sof_dtrace_host_init(struct snd_sof_dev *sdev,
+ struct snd_dma_buffer *dmatb,
+ struct sof_ipc_dma_trace_params_ext *dtrace_params)
+{
+ struct snd_sof_dsp_ops *dsp_ops = sdev->pdata->desc->ops;
+
+ if (dsp_ops->trace_init)
+ return dsp_ops->trace_init(sdev, dmatb, dtrace_params);
+
+ return 0;
+}
+
+static inline int sof_dtrace_host_release(struct snd_sof_dev *sdev)
+{
+ struct snd_sof_dsp_ops *dsp_ops = sdev->pdata->desc->ops;
+
+ if (dsp_ops->trace_release)
+ return dsp_ops->trace_release(sdev);
+
+ return 0;
+}
+
+static inline int sof_dtrace_host_trigger(struct snd_sof_dev *sdev, int cmd)
+{
+ struct snd_sof_dsp_ops *dsp_ops = sdev->pdata->desc->ops;
+
+ if (dsp_ops->trace_trigger)
+ return dsp_ops->trace_trigger(sdev, cmd);
+
+ return 0;
+}
+
#endif