Commit 0a18f9b2 authored by Caesar Wang's avatar Caesar Wang Committed by Vinod Koul

dmaengine: pl330: fix to support the burst mode

This patch fixes the burst mode that will break DMA uart on SoCFPGA.

In some cases, some SoCS didn't support the multi-burst
even if the devices who use the pl330 claim support the maxburst.

Fixes: commit 848e9776
"dmaengine: pl330: support burst mode for dev-to-mem and mem-to-dev transmit"
Reported-by: default avatarDinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
Tested-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tested-by: default avatarDinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 80abf888
...@@ -1161,7 +1161,7 @@ static inline int _ldst_devtomem(struct pl330_dmac *pl330, unsigned dry_run, ...@@ -1161,7 +1161,7 @@ static inline int _ldst_devtomem(struct pl330_dmac *pl330, unsigned dry_run,
if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP)
cond = BURST; cond = BURST;
else else
cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST; cond = SINGLE;
while (cyc--) { while (cyc--) {
off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri); off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
...@@ -1186,8 +1186,7 @@ static inline int _ldst_memtodev(struct pl330_dmac *pl330, ...@@ -1186,8 +1186,7 @@ static inline int _ldst_memtodev(struct pl330_dmac *pl330,
if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP)
cond = BURST; cond = BURST;
else else
cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST; cond = SINGLE;
while (cyc--) { while (cyc--) {
off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri); off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
...@@ -2598,7 +2597,7 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( ...@@ -2598,7 +2597,7 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
desc->rqtype = direction; desc->rqtype = direction;
desc->rqcfg.brst_size = pch->burst_sz; desc->rqcfg.brst_size = pch->burst_sz;
desc->rqcfg.brst_len = pch->burst_len; desc->rqcfg.brst_len = 1;
desc->bytes_requested = period_len; desc->bytes_requested = period_len;
fill_px(&desc->px, dst, src, period_len); fill_px(&desc->px, dst, src, period_len);
...@@ -2743,7 +2742,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, ...@@ -2743,7 +2742,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
} }
desc->rqcfg.brst_size = pch->burst_sz; desc->rqcfg.brst_size = pch->burst_sz;
desc->rqcfg.brst_len = pch->burst_len; desc->rqcfg.brst_len = 1;
desc->rqtype = direction; desc->rqtype = direction;
desc->bytes_requested = sg_dma_len(sg); desc->bytes_requested = sg_dma_len(sg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment