From 616f1e57ef5d4de811f8958a551fef6217dc7b1f Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Thu, 8 Feb 2018 20:48:13 +0800 Subject: [PATCH] dw-dma: enable DW_USE_HW_LLI mode for APL/CNL. Fix the dma not stop issue for using Hardware Link List mode. Only enable it for APL/CNL at the moment. Signed-off-by: Keyon Jie --- src/drivers/dw-dma.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c index c56650933..f6db7448b 100644 --- a/src/drivers/dw-dma.c +++ b/src/drivers/dw-dma.c @@ -236,8 +236,12 @@ #define trace_dma_error(__e) trace_error(TRACE_CLASS_DMA, __e) #define tracev_dma(__e) tracev_event(TRACE_CLASS_DMA, __e) -/* HW Linked list support currently disabled - needs debug for missing IRQs !!! */ +/* HW Linked list support, only enabled for APL/CNL at the moment */ +#if defined CONFIG_APOLLOLAKE || defined CONFIG_CANNONLAKE +#define DW_USE_HW_LLI 1 +#else #define DW_USE_HW_LLI 0 +#endif /* number of tries to wait for reset */ #define DW_DMA_CFG_TRIES 10000 @@ -922,6 +926,11 @@ static void dw_dma_irq_handler(void *data) next.size = DMA_RELOAD_LLI; p->chan[i].cb(p->chan[i].cb_data, DMA_IRQ_TYPE_BLOCK, &next); + if (next.size == DMA_RELOAD_END) { + trace_dma("LSo"); + /* disable channel, finished */ + dw_write(dma, DW_DMA_CHAN_EN, CHAN_DISABLE(i)); + } } #endif /* end of a transfer */