Skip to contentSkip to conversation

added support for "run twice" mem2mem transfers

PATCH New Tobias Wirtl (none) 1 participant 1 message Sep 27, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 added support for "run twice" mem2mem transfers

-it's possible to run a prepared mem2mem channel more than 1 time

---
 drivers/dma/imx-sdma.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/dma/imx-sdma.c +0 -0
index 325827e..03d94b5 100644
@@ -945,7 +945,7 @@ static dma_cookie_t sdma_tx_submit(struct

dma_async_tx_descriptor *tx)
spin_lock_irq(&sdma->lock);
=20
cookie =3D sdma_assign_cookie(sdma);
-
+=09
sdma_enable_channel(tx->chan->chan_id);
=20
spin_unlock_irq(&sdma->lock);
@@ -1038,7 +1038,8 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_memcpy(
if (sdma->busy)
return NULL;
sdma->busy =3D 1;
- sdma->flags =3D 0;
+=09
+ sdma->flags =3D IMX_DMA_SG_LOOP; //if the prepared transfer is
used again
=09
sdma->direction =3D DMA_FROM_DEVICE; //doesn't matter
=09
@@ -1054,7 +1055,7 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_memcpy(
bd->ext_buffer_addr =3D dest; bd->mode.count =3D len;
bd->mode.command =3D 0;

-        bd->mode.status =3D BD_DONE | BD_EXTD | BD_CONT | BD_INTR;
+        bd->mode.status =3D BD_DONE | BD_EXTD | BD_INTR | BD_WRAP;

//BD_DONE | BD_EXTD | BD_CONT | BD_INTR | BD_WRAP; =20
sdma->num_bd =3D 1;
=20
--=20
1.7.0.4

=20