* [PATCH] dmaengine: omap-dma: Fix the port_window support
@ 2017-01-09 14:50 Peter Ujfalusi
2017-01-10 5:38 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2017-01-09 14:50 UTC (permalink / raw)
To: vinod.koul, dan.j.williams, tony, linux
Cc: dmaengine, linux-kernel, linux-omap, arnd
We do not yet have users of port_window. The following errors were found
when converting the tusb6010_omap.c musb driver:
- The peripheral side must have SRC_/DST_PACKED disabled
- when configuring the burst for the peripheral side the memory side
configuration were overwritten: d->csdp = ... -> d->csdp |= ...
- The EI and FI were configured for the wrong sides of the transfers.
With these changes and the converted tus6010_omap.c I was able to verify
that things are working as they expected to work.
Fixes: 201ac4861c19 ("dmaengine: omap-dma: Support for slave devices with data port window")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
Vinod,
finaly I got one n810 from Tony and managed to boot it up so I could verify the
port_window support in omap-dma. Well, it almost worked for the first try ;)
This patch is fixing the port_window initial support in omap-dma.
It is intentional that it is done in one patch as these changes need to be done
in order to get this mode working, we would not gain anything with separate
patches regarding to bisect. But I can split it up if needed.
AFAIK the port_window support is introduced in 4.10. Would it be possible to
send this patch also so for 4.11 I can start sending the tub6010_omap conversion
to DMAengine?
Regards,
Peter
drivers/dma/omap-dma.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 4ad101a47e0a..daf479cce691 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -938,21 +938,14 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
d->ccr |= CCR_DST_AMODE_POSTINC;
if (port_window) {
d->ccr |= CCR_SRC_AMODE_DBLIDX;
- d->ei = 1;
- /*
- * One frame covers the port_window and by configure
- * the source frame index to be -1 * (port_window - 1)
- * we instruct the sDMA that after a frame is processed
- * it should move back to the start of the window.
- */
- d->fi = -(port_window_bytes - 1);
if (port_window_bytes >= 64)
- d->csdp = CSDP_SRC_BURST_64 | CSDP_SRC_PACKED;
+ d->csdp |= CSDP_SRC_BURST_64;
else if (port_window_bytes >= 32)
- d->csdp = CSDP_SRC_BURST_32 | CSDP_SRC_PACKED;
+ d->csdp |= CSDP_SRC_BURST_32;
else if (port_window_bytes >= 16)
- d->csdp = CSDP_SRC_BURST_16 | CSDP_SRC_PACKED;
+ d->csdp |= CSDP_SRC_BURST_16;
+
} else {
d->ccr |= CCR_SRC_AMODE_CONSTANT;
}
@@ -962,13 +955,21 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
d->ccr |= CCR_SRC_AMODE_POSTINC;
if (port_window) {
d->ccr |= CCR_DST_AMODE_DBLIDX;
+ d->ei = 1;
+ /*
+ * One frame covers the port_window and by configure
+ * the source frame index to be -1 * (port_window - 1)
+ * we instruct the sDMA that after a frame is processed
+ * it should move back to the start of the window.
+ */
+ d->fi = -(port_window_bytes - 1);
if (port_window_bytes >= 64)
- d->csdp = CSDP_DST_BURST_64 | CSDP_DST_PACKED;
+ d->csdp |= CSDP_DST_BURST_64;
else if (port_window_bytes >= 32)
- d->csdp = CSDP_DST_BURST_32 | CSDP_DST_PACKED;
+ d->csdp |= CSDP_DST_BURST_32;
else if (port_window_bytes >= 16)
- d->csdp = CSDP_DST_BURST_16 | CSDP_DST_PACKED;
+ d->csdp |= CSDP_DST_BURST_16;
} else {
d->ccr |= CCR_DST_AMODE_CONSTANT;
}
@@ -1017,7 +1018,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
osg->addr = sg_dma_address(sgent);
osg->en = en;
osg->fn = sg_dma_len(sgent) / frame_bytes;
- if (port_window && dir == DMA_MEM_TO_DEV) {
+ if (port_window && dir == DMA_DEV_TO_MEM) {
osg->ei = 1;
/*
* One frame covers the port_window and by configure
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: omap-dma: Fix the port_window support
2017-01-09 14:50 [PATCH] dmaengine: omap-dma: Fix the port_window support Peter Ujfalusi
@ 2017-01-10 5:38 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2017-01-10 5:38 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: dan.j.williams, tony, linux, dmaengine, linux-kernel, linux-omap,
arnd
On Mon, Jan 09, 2017 at 04:50:52PM +0200, Peter Ujfalusi wrote:
> We do not yet have users of port_window. The following errors were found
> when converting the tusb6010_omap.c musb driver:
>
> - The peripheral side must have SRC_/DST_PACKED disabled
> - when configuring the burst for the peripheral side the memory side
> configuration were overwritten: d->csdp = ... -> d->csdp |= ...
> - The EI and FI were configured for the wrong sides of the transfers.
>
> With these changes and the converted tus6010_omap.c I was able to verify
> that things are working as they expected to work.
Applied now to fixes
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-10 5:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-09 14:50 [PATCH] dmaengine: omap-dma: Fix the port_window support Peter Ujfalusi
2017-01-10 5:38 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).