From 9e4d1aae900a7c816ec583f6935c1c6a1f79ff76 Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Mon, 27 Jan 2020 11:19:58 +0100 Subject: [PATCH] dw-dma: add method to retrieve lli from memory Implements new platform specific method, which allows for retrieving linked list item from memory. The best example are cAVS platforms, which need read it through uncached memory region. Rest of the platforms currently don't need the implementation, since they don't support hardware linked list. Signed-off-by: Tomasz Lauda --- src/drivers/dw/dma.c | 8 ++++---- src/platform/intel/cavs/include/cavs/drivers/dw-dma.h | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/drivers/dw/dma.c b/src/drivers/dw/dma.c index b1407c699..2e1c4ce57 100644 --- a/src/drivers/dw/dma.c +++ b/src/drivers/dw/dma.c @@ -816,7 +816,7 @@ static void dw_dma_verify_transfer(struct dma_chan_data *channel, { struct dw_dma_chan_data *dw_chan = dma_chan_get_data(channel); #if CONFIG_HW_LLI - struct dw_lli *ll_uncached = cache_to_uncache(dw_chan->lli_current); + struct dw_lli *lli = platform_dw_dma_lli_get(dw_chan->lli_current); switch (next->status) { case DMA_CB_STATUS_END: @@ -825,11 +825,11 @@ static void dw_dma_verify_transfer(struct dma_chan_data *channel, DW_CHAN_MASK(channel->index)); /* fallthrough */ default: - while (ll_uncached->ctrl_hi & DW_CTLH_DONE(1)) { - ll_uncached->ctrl_hi &= ~DW_CTLH_DONE(1); + while (lli->ctrl_hi & DW_CTLH_DONE(1)) { + lli->ctrl_hi &= ~DW_CTLH_DONE(1); dw_chan->lli_current = (struct dw_lli *)dw_chan->lli_current->llp; - ll_uncached = cache_to_uncache(dw_chan->lli_current); + lli = platform_dw_dma_lli_get(dw_chan->lli_current); } break; } diff --git a/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h b/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h index 030cc7e37..3e664f8ee 100644 --- a/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h +++ b/src/platform/intel/cavs/include/cavs/drivers/dw-dma.h @@ -85,6 +85,11 @@ static inline void platform_dw_dma_llp_disable(struct dma *dma, shim_read(DW_CHLLPC(dma, chan)) & ~SHIM_GPDMA_CHLLPC_EN); } +static inline struct dw_lli *platform_dw_dma_lli_get(struct dw_lli *lli) +{ + return cache_to_uncache(lli); +} + #endif /* __CAVS_LIB_DW_DMA_H__ */ #else