Skip to content

Commit 4b22a55

Browse files
committed
trace: remove CONFIG_DMA_GW
Remote this altenrative DMA client code implementation used on Intel platforms and XTOS. This has not in-tree users anymore, so this is unused and can be removed. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 07a3eea commit 4b22a55

4 files changed

Lines changed: 0 additions & 156 deletions

File tree

Kconfig.sof

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ config HOST_PTABLE
55
bool
66
default n
77

8-
config DMA_GW
9-
bool
10-
default n
11-
128
config COMPILER_WORKAROUND_CACHE_ATTR
139
bool
1410
default n

src/include/sof/trace/dma-trace.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ struct dma_trace_buf {
3030
struct dma_trace_data {
3131
struct dma_sg_config config;
3232
struct dma_trace_buf dmatb;
33-
#if CONFIG_DMA_GW
34-
struct dma_sg_config gw_config;
35-
#endif
3633
struct dma_copy dc;
3734
struct sof_ipc_dma_trace_posn posn;
3835
struct ipc_msg *msg;

src/ipc/dma-copy.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ SOF_DEFINE_REG_UUID(dma_copy);
2323

2424
DECLARE_TR_CTX(dmacpy_tr, SOF_UUID(dma_copy_uuid), LOG_LEVEL_INFO);
2525

26-
#if !CONFIG_DMA_GW
2726
static struct dma_sg_elem *sg_get_elem_at(struct dma_sg_config *host_sg,
2827
int32_t *offset)
2928
{
@@ -49,43 +48,11 @@ static struct dma_sg_elem *sg_get_elem_at(struct dma_sg_config *host_sg,
4948
tr_err(&dmacpy_tr, "host offset in beyond end of SG buffer");
5049
return NULL;
5150
}
52-
#endif
5351

5452
/* Copy DSP memory to host memory.
5553
* Copies DSP memory to host in a single PAGE_SIZE or smaller block. Does not
5654
* waits/sleeps and can be used in IRQ context.
5755
*/
58-
#if CONFIG_DMA_GW
59-
60-
int dma_copy_to_host(struct dma_copy *dc, struct dma_sg_config *host_sg,
61-
int32_t host_offset, void *local_ptr, int32_t size)
62-
{
63-
int ret;
64-
65-
/* tell gateway to copy */
66-
ret = dma_copy_legacy(dc->chan, size, DMA_COPY_BLOCKING);
67-
if (ret < 0)
68-
return ret;
69-
70-
/* bytes copied */
71-
return size;
72-
}
73-
74-
int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
75-
int32_t host_offset, void *local_ptr, int32_t size)
76-
{
77-
int ret;
78-
79-
/* tell gateway to copy */
80-
ret = dma_copy_legacy(dc->chan, size, 0);
81-
if (ret < 0)
82-
return ret;
83-
84-
/* bytes copied */
85-
return size;
86-
}
87-
88-
#else /* CONFIG_DMA_GW */
8956

9057
static int
9158
dma_copy_to_host_flags(struct dma_copy *dc, struct dma_sg_config *host_sg,
@@ -153,8 +120,6 @@ int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
153120
DMA_COPY_ONE_SHOT);
154121
}
155122

156-
#endif /* CONFIG_DMA_GW */
157-
158123
int dma_copy_new(struct dma_copy *dc)
159124
{
160125
uint32_t dir, cap, dev;
@@ -169,14 +134,12 @@ int dma_copy_new(struct dma_copy *dc)
169134
return -ENODEV;
170135
}
171136

172-
#if !CONFIG_DMA_GW
173137
/* get DMA channel from DMAC0 */
174138
dc->chan = dma_channel_get_legacy(dc->dmac, CONFIG_TRACE_CHANNEL);
175139
if (!dc->chan) {
176140
tr_err(&dmacpy_tr, "dc->chan is NULL");
177141
return -ENODEV;
178142
}
179-
#endif
180143

181144
return 0;
182145
}

src/trace/dma-trace.c

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,6 @@ static void dma_trace_buffer_free(struct dma_trace_data *d)
249249

250250
static int dma_trace_buffer_init(struct dma_trace_data *d)
251251
{
252-
#if CONFIG_DMA_GW
253-
struct dma_sg_config *config = &d->gw_config;
254-
uint32_t elem_size, elem_addr, elem_num;
255-
int ret;
256-
#endif
257252
struct dma_trace_buf *buffer = &d->dmatb;
258253
void *buf;
259254
k_spinlock_key_t key;
@@ -309,30 +304,6 @@ static int dma_trace_buffer_init(struct dma_trace_data *d)
309304

310305
k_spin_unlock(&d->lock, key);
311306

312-
#if CONFIG_DMA_GW
313-
/* size of every trace record */
314-
elem_size = sizeof(uint64_t) * 2;
315-
316-
/* Initialize address of local elem */
317-
elem_addr = (uint32_t)buffer->addr;
318-
319-
/* the number of elem list */
320-
elem_num = DMA_TRACE_LOCAL_SIZE / elem_size;
321-
322-
config->direction = DMA_DIR_LMEM_TO_HMEM;
323-
config->src_width = sizeof(uint32_t);
324-
config->dest_width = sizeof(uint32_t);
325-
config->cyclic = 0;
326-
327-
ret = dma_sg_alloc(&config->elem_array, SOF_MEM_FLAG_USER,
328-
config->direction, elem_num, elem_size,
329-
elem_addr, 0);
330-
if (ret < 0) {
331-
dma_trace_buffer_free(d);
332-
return ret;
333-
}
334-
#endif
335-
336307
#ifdef __ZEPHYR__
337308
#define ZEPHYR_VER_OPT " zephyr:" STRINGIFY(BUILD_VERSION)
338309
#else
@@ -361,77 +332,6 @@ static int dma_trace_buffer_init(struct dma_trace_data *d)
361332
return 0;
362333
}
363334

364-
#if CONFIG_DMA_GW
365-
366-
static int dma_trace_start(struct dma_trace_data *d)
367-
{
368-
int err = 0;
369-
370-
/* DMA Controller initialization is platform-specific */
371-
if (!d || !d->dc.dmac) {
372-
mtrace_printf(LOG_LEVEL_ERROR,
373-
"dma_trace_start failed: no DMAC!");
374-
return -ENODEV;
375-
}
376-
377-
if (d->dc.chan) {
378-
/* We already have DMA channel for dtrace, stop it */
379-
mtrace_printf(LOG_LEVEL_WARNING,
380-
"dma_trace_start(): DMA reconfiguration (active stream_tag: %u)",
381-
d->active_stream_tag);
382-
383-
schedule_task_cancel(&d->dmat_work);
384-
err = dma_stop_legacy(d->dc.chan);
385-
if (err < 0) {
386-
mtrace_printf(LOG_LEVEL_ERROR,
387-
"dma_trace_start(): DMA channel failed to stop");
388-
} else if (d->active_stream_tag != d->stream_tag) {
389-
/* Re-request a channel if different tag is provided */
390-
mtrace_printf(LOG_LEVEL_WARNING,
391-
"dma_trace_start(): stream_tag change from %u to %u",
392-
d->active_stream_tag, d->stream_tag);
393-
394-
dma_channel_put_legacy(d->dc.chan);
395-
d->dc.chan = NULL;
396-
err = dma_copy_set_stream_tag(&d->dc, d->stream_tag);
397-
}
398-
} else {
399-
err = dma_copy_set_stream_tag(&d->dc, d->stream_tag);
400-
}
401-
402-
if (err < 0)
403-
return err;
404-
405-
/* Reset host buffer information as host is re-configuring dtrace */
406-
d->posn.host_offset = 0;
407-
408-
d->active_stream_tag = d->stream_tag;
409-
410-
err = dma_set_config_legacy(d->dc.chan, &d->gw_config);
411-
if (err < 0) {
412-
mtrace_printf(LOG_LEVEL_ERROR, "dma_set_config() failed: %d", err);
413-
goto error;
414-
}
415-
416-
err = dma_start_legacy(d->dc.chan);
417-
if (err == 0)
418-
return 0;
419-
420-
error:
421-
dma_channel_put_legacy(d->dc.chan);
422-
d->dc.chan = NULL;
423-
424-
return err;
425-
}
426-
427-
static int dma_trace_get_avail_data(struct dma_trace_data *d,
428-
struct dma_trace_buf *buffer,
429-
int avail)
430-
{
431-
/* align data to HD-DMA burst size */
432-
return ALIGN_DOWN(avail, d->dma_copy_align);
433-
}
434-
#else
435335
static int dma_trace_get_avail_data(struct dma_trace_data *d,
436336
struct dma_trace_buf *buffer,
437337
int avail)
@@ -464,8 +364,6 @@ static int dma_trace_get_avail_data(struct dma_trace_data *d,
464364
return size;
465365
}
466366

467-
#endif /* CONFIG_DMA_GW */
468-
469367
/** Invoked remotely by SOF_IPC_TRACE_DMA_PARAMS* Depends on
470368
* dma_trace_init_complete()
471369
*/
@@ -478,16 +376,6 @@ int dma_trace_enable(struct dma_trace_data *d)
478376
if (err < 0)
479377
return err;
480378

481-
#if CONFIG_DMA_GW
482-
/*
483-
* GW DMA need finish DMA config and start before
484-
* host driver trigger start DMA
485-
*/
486-
err = dma_trace_start(d);
487-
if (err < 0)
488-
goto out;
489-
#endif
490-
491379
/* validate DMA context */
492380
if (!d->dc.dmac || !d->dc.chan) {
493381
tr_err_atomic(&dt_tr, "dma_trace_enable(): not valid");

0 commit comments

Comments
 (0)