No need to 2 IPCs to enable DMA trace. Just use one IPC.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/include/uapi/ipc.h | 3 +-- src/ipc/intel-ipc.c | 30 ++++-------------------------- 2 files changed, 5 insertions(+), 28 deletions(-)
diff --git a/src/include/uapi/ipc.h b/src/include/uapi/ipc.h index 05952ab..281e77a 100644 --- a/src/include/uapi/ipc.h +++ b/src/include/uapi/ipc.h @@ -117,8 +117,7 @@ #define SOF_IPC_STREAM_VORBIS_FREE SOF_CMD_TYPE(0x011)
/* trace and debug */ -#define SOF_IPC_TRACE_DMA_INIT SOF_CMD_TYPE(0x001) -#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x002) +#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001)
/* Get message component id */ #define SOF_IPC_MESSAGE_ID(x) (x & 0xffff) diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index 9b47ca9..f6d88ef 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -574,12 +574,14 @@ static int ipc_glb_pm_message(uint32_t header) * Debug IPC Operations. */
-static int ipc_dma_trace_init(uint32_t header) +static int ipc_dma_trace_config(uint32_t header) { + struct intel_ipc_data *iipc = ipc_get_drvdata(_ipc); + struct sof_ipc_dma_trace_params *params = _ipc->comp_data; struct sof_ipc_reply reply; int err;
- trace_ipc("Dti"); + trace_ipc_error("DA1");
/* Initialize DMA for Trace*/ err = dma_trace_init(&_ipc->dmat); @@ -588,28 +590,6 @@ static int ipc_dma_trace_init(uint32_t header) goto error; }
- /* write component values to the outbox */ - reply.hdr.size = sizeof(reply); - reply.hdr.cmd = header; - reply.error = 0; - mailbox_hostbox_write(0, &reply, sizeof(reply)); - return 0; - -error: - if (err < 0) - trace_ipc_error("eA!"); - return -EINVAL; -} - -static int ipc_dma_trace_config(uint32_t header) -{ - struct intel_ipc_data *iipc = ipc_get_drvdata(_ipc); - struct sof_ipc_dma_trace_params *params = _ipc->comp_data; - struct sof_ipc_reply reply; - int err; - - trace_ipc("DAl"); - /* use DMA to read in compressed page table ringbuffer from host */ err = get_page_descriptors(iipc, ¶ms->buffer); if (err < 0) { @@ -653,8 +633,6 @@ static int ipc_glb_debug_message(uint32_t header) trace_ipc("Idn");
switch (cmd) { - case iCS(SOF_IPC_TRACE_DMA_INIT): - return ipc_dma_trace_init(header); case iCS(SOF_IPC_TRACE_DMA_PARAMS): return ipc_dma_trace_config(header); default: