summaryrefslogtreecommitdiff
path: root/drivers/dma/mcf-edma-main.c
diff options
context:
space:
mode:
authorFrank Li <Frank.Li@nxp.com>2023-08-21 12:16:15 -0400
committerVinod Koul <vkoul@kernel.org>2023-08-22 20:11:03 +0530
commit7536f8b371adcc1c4f7ed7ca579da24bdeb14b6f (patch)
treea6d96de1ffccaf1f85a16aab35ab86d30baca125 /drivers/dma/mcf-edma-main.c
parent9b05554c5ca6829a60c610191d45f244d8726e95 (diff)
dmaengine: fsl-edma: move tcd into struct fsl_dma_chan
Relocates the tcd into the fsl_dma_chan structure. This adjustment reduces the need to reference back to fsl_edma_engine, paving the way for EDMA V3 support. Unified the edma_writel and edma_writew functions for accessing TCD (Transfer Control Descriptor) registers. A new macro is added that can automatically detect whether a 32-bit or 16-bit access should be used based on the structure field definition. This provide better support 64-bit TCD with future v5 version. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202305271951.gmRobs3a-lkp@intel.com/ Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20230821161617.2142561-11-Frank.Li@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/mcf-edma-main.c')
-rw-r--r--drivers/dma/mcf-edma-main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
index ec8a8e1930b5..a903461da5bd 100644
--- a/drivers/dma/mcf-edma-main.c
+++ b/drivers/dma/mcf-edma-main.c
@@ -199,7 +199,9 @@ static int mcf_edma_probe(struct platform_device *pdev)
mcf_chan->dma_dir = DMA_NONE;
mcf_chan->vchan.desc_free = fsl_edma_free_desc;
vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev);
- iowrite32(0x0, &regs->tcd[i].csr);
+ mcf_chan->tcd = mcf_edma->membase + EDMA_TCD
+ + i * sizeof(struct fsl_edma_hw_tcd);
+ iowrite32(0x0, &mcf_chan->tcd->csr);
}
iowrite32(~0, regs->inth);