linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: ti: omap-dma: Configure LCH_TYPE for OMAP1
@ 2018-11-19 10:40 Peter Ujfalusi
  2018-11-19 18:46 ` Aaro Koskinen
  0 siblings, 1 reply; 34+ messages in thread
From: Peter Ujfalusi @ 2018-11-19 10:40 UTC (permalink / raw)
  To: vkoul, dan.j.williams
  Cc: dmaengine, linux-kernel, aaro.koskinen, tony, linux-omap, rmk+kernel

When the channel is configured for slave operation the LCH_TYPE needs to be
set to LCh-P. For memcpy channels the LCH_TYPE must be set to LCh-2D.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/dma/ti/omap-dma.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c
index a4a931ddf6f6..a18cfd497f04 100644
--- a/drivers/dma/ti/omap-dma.c
+++ b/drivers/dma/ti/omap-dma.c
@@ -185,6 +185,10 @@ enum {
 
 	CLNK_CTRL_ENABLE_LNK	= BIT(15),
 
+	/* OMAP1 only */
+	LCH_CTRL_LCH_2D		= 0,
+	LCH_CTRL_LCH_P		= 2,
+
 	CDP_DST_VALID_INC	= 0 << 0,
 	CDP_DST_VALID_RELOAD	= 1 << 0,
 	CDP_DST_VALID_REUSE	= 2 << 0,
@@ -529,6 +533,7 @@ static void omap_dma_start_sg(struct omap_chan *c, struct omap_desc *d)
 
 static void omap_dma_start_desc(struct omap_chan *c)
 {
+	struct omap_dmadev *od = to_omap_dma_dev(c->vc.chan.device);
 	struct virt_dma_desc *vd = vchan_next_desc(&c->vc);
 	struct omap_desc *d;
 	unsigned cxsa, cxei, cxfi;
@@ -570,6 +575,12 @@ static void omap_dma_start_desc(struct omap_chan *c)
 	omap_dma_chan_write(c, CSDP, d->csdp);
 	omap_dma_chan_write(c, CLNK_CTRL, d->clnk_ctrl);
 
+	if (dma_omap1() && !__dma_omap15xx(od->plat->dma_attr)) {
+		if (is_slave_direction(d->dir))
+			omap_dma_chan_write(c, LCH_CTRL, LCH_CTRL_LCH_P);
+		else
+			omap_dma_chan_write(c, LCH_CTRL, LCH_CTRL_LCH_2D);
+	}
 	omap_dma_start_sg(c, d);
 }
 
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2018-12-18 15:55 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 10:40 [PATCH] dmaengine: ti: omap-dma: Configure LCH_TYPE for OMAP1 Peter Ujfalusi
2018-11-19 18:46 ` Aaro Koskinen
2018-11-20  7:28   ` Peter Ujfalusi
2018-11-20 21:04     ` Aaro Koskinen
2018-11-22  8:31       ` Peter Ujfalusi
2018-11-22 22:01         ` Aaro Koskinen
2018-11-23 11:45           ` Peter Ujfalusi
2018-11-24  0:17             ` Aaro Koskinen
2018-11-24 17:48               ` Russell King - ARM Linux
2018-11-24 19:06                 ` Aaro Koskinen
2018-11-24 19:29                   ` Russell King - ARM Linux
2018-11-22 10:29       ` Russell King - ARM Linux
2018-11-22 15:12         ` Russell King - ARM Linux
2018-11-22 22:24           ` Aaro Koskinen
2018-11-23  0:25             ` Russell King - ARM Linux
2018-11-23  1:23               ` Aaro Koskinen
2018-11-23 11:54               ` Peter Ujfalusi
2018-11-23 12:35           ` Peter Ujfalusi
2018-11-23 15:43             ` Russell King - ARM Linux
2018-11-23 16:16               ` Russell King - ARM Linux
2018-11-23 23:27                 ` Russell King - ARM Linux
2018-11-23 18:52             ` Aaro Koskinen
2018-11-24 20:09               ` Russell King - ARM Linux
2018-11-25  1:07                 ` Tony Lindgren
2018-11-25  1:11                   ` Tony Lindgren
2018-11-25 11:11                   ` Russell King - ARM Linux
2018-11-25 11:57                     ` Russell King - ARM Linux
2018-11-25 16:58                     ` Aaro Koskinen
2018-11-25 17:14                       ` Tony Lindgren
2018-12-17 23:47                         ` Aaro Koskinen
2018-12-18 15:55                           ` Tony Lindgren
2018-12-17 19:16           ` Aaro Koskinen
2018-12-18 10:11             ` Peter Ujfalusi
2018-11-23 11:49         ` Peter Ujfalusi

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).