@@ -249,11 +249,6 @@ static void dma_trace_buffer_free(struct dma_trace_data *d)
249249
250250static 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
435335static 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