summaryrefslogtreecommitdiffstats
path: root/drivers/dma/xilinx
diff options
context:
space:
mode:
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>2018-01-03 01:42:09 -0500
committerVinod Koul <vinod.koul@intel.com>2018-01-08 05:54:50 -0500
commit48c62fb051af3850e631b573e5393a2b0808ef10 (patch)
treed11fe7508abfb19bf0a5ebe97298b5d5728cc9bc /drivers/dma/xilinx
parent3093186898b06a2eda0bf02329fff6754b6cbfe3 (diff)
dmaengine: xilinx_dma: properly configure the SG mode bit in the driver for cdma
If the hardware is configured for Scatter Gather(SG) mode, and hardware is idle, in the control register SG mode bit must be set to a 0 then back to 1 by the software, to force the CDMA SG engine to use a new value written to the CURDESC_PNTR register, failure to do so could result errors from the dmaengine. This patch updates the same. Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/xilinx')
-rw-r--r--drivers/dma/xilinx/xilinx_dma.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 88d317de6908..e32ebe0837af 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1204,6 +1204,12 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan)
1204 } 1204 }
1205 1205
1206 if (chan->has_sg) { 1206 if (chan->has_sg) {
1207 dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
1208 XILINX_CDMA_CR_SGMODE);
1209
1210 dma_ctrl_set(chan, XILINX_DMA_REG_DMACR,
1211 XILINX_CDMA_CR_SGMODE);
1212
1207 xilinx_write(chan, XILINX_DMA_REG_CURDESC, 1213 xilinx_write(chan, XILINX_DMA_REG_CURDESC,
1208 head_desc->async_tx.phys); 1214 head_desc->async_tx.phys);
1209 1215
@@ -2052,6 +2058,10 @@ static int xilinx_dma_terminate_all(struct dma_chan *dchan)
2052 chan->cyclic = false; 2058 chan->cyclic = false;
2053 } 2059 }
2054 2060
2061 if ((chan->xdev->dma_config->dmatype == XDMA_TYPE_CDMA) && chan->has_sg)
2062 dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
2063 XILINX_CDMA_CR_SGMODE);
2064
2055 return 0; 2065 return 0;
2056} 2066}
2057 2067