Skip to contentSkip to conversation

DMA: PL330: Add async dma api driver

PATCH In review Jassi Brar 2 participants 3 messages May 7, 2010 dmaengine

lore
Share & tools
lore

Jassi Brar

author
#0 lore raw

PATCH 2/2 DMA: PL330: Add async dma api driver

From: Jassi Brar <[email protected]>

Add ASYNC DMA Engine API driver for the PL330 DMAC. This driver is supposed to be reusable by various platforms that have one or more PL330 DMACs. Atm, DMA_SLAVE and DMA_MEMCPY capabilities have been implemented.

---
 drivers/dma/Kconfig        |    9 +
 drivers/dma/Makefile       |    1 +
 drivers/dma/pl330.c        |  872 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/amba/pl330.h |   54 +++
 4 files changed, 936 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dma/pl330.c
 create mode 100644 include/linux/amba/pl330.h
drivers/dma/Kconfig +9 -0
index c27f80e..388550f 100644
@@ -152,6 +152,15 @@ config AMCC_PPC440SPE_ADMA
 config ARCH_HAS_ASYNC_TX_FIND_CHANNEL
 	bool
 
+config PL330_DMA
+	tristate "ASYNC DMA API Driver for PL330"
+	select DMA_ENGINE
+	select PL330
+	help
+	  Select if your platform has one or more PL330 DMACs.
+	  You need to provide platform specific settings via
+	  platform_data for a dma-pl330 device.
+
 config DMA_ENGINE
 	bool
 
drivers/dma/Makefile +1 -0
index 22bba3d..0a6b429 100644
@@ -20,3 +20,4 @@ obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
 obj-$(CONFIG_SH_DMAE) += shdma.o
 obj-$(CONFIG_COH901318) += coh901318.o coh901318_lli.o
 obj-$(CONFIG_AMCC_PPC440SPE_ADMA) += ppc4xx/
+obj-$(CONFIG_PL330_DMA) += pl330.o
drivers/dma/pl330.c new file +872 -0

872 lines not on this page · raw message

include/linux/amba/pl330.h new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
1.6.2.5
Reviewed-by on v1 2/2
#1 lore raw

2010/5/7 Jassi Brar <[email protected]>:

Quoted 7 lines

Add ASYNC DMA Engine API driver for the PL330 DMAC. This driver is supposed to be reusable by various platforms that have one or more PL330 DMACs. Atm, DMA_SLAVE and DMA_MEMCPY capabilities have been implemented.

This needs some updating to apply and compile on Dan Williams tree, please clone async_tx from git.kernel.org and generate the patch on that tree instead. (It's my updates for generic channel status etc that collide.)

You'll also find these changes in Rothwell's -next tree.

Quoted 3 lines

(...)

+static void pl330_terminate_all(struct dma_chan *chan)

This needs to be converted to the new prototype and will look something like this:

static int
pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd)

drivers/dma/pl330.c

Quoted 3 lines
drivers/dma/pl330.c new file +3 -0
+static enum dma_status
+pl330_is_tx_complete(struct dma_chan *chan, dma_cookie_t cookie,
+ ? ? ? ? ? ? ? dma_cookie_t *done, dma_cookie_t *used)

This needs to be converted to the new prototype and will look something like this:

static enum dma_status
pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
struct dma_tx_state *txstate)

See the other drivers for examples, e.g. coh901318.c coh901318_control() and coh901318_tx_status()

(...)

Quoted 4 lines

+ ? ? ? pd->device_is_tx_complete = pl330_is_tx_complete;
+ ? ? ? pd->device_prep_slave_sg = pl330_prep_slave_sg;
+ ? ? ? pd->device_terminate_all = pl330_terminate_all;
+ ? ? ? pd->device_issue_pending = pl330_issue_pending;

Consequential updates here.

Sorry for the mess, moving target as usual...

If you fix this and test it on async_tx it's:

Yours,
Linus Walleij

author
#2 lore raw
Quoted 9 lines · Linus Walleij

2010/5/7 Jassi Brar <[email protected]>:

Quoted 7 lines

Add ASYNC DMA Engine API driver for the PL330 DMAC. This driver is supposed to be reusable by various platforms that have one or more PL330 DMACs. Atm, DMA_SLAVE and DMA_MEMCPY capabilities have been implemented.

.....

Quoted 2 lines

If you fix this and test it on async_tx it's:

Will do.
Thanks.