DMA: PL330: Add dma api driver
PATCH 1/1 DMA: PL330: Add dma api driver
Add 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.
---
Note:-
a) This patch is revised to apply over
async_tx of http://www.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx.git
b) This api driver depends upon the PL330 Core driver being merged.
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6115/1
drivers/dma/Kconfig | 9 + drivers/dma/Makefile | 1 + drivers/dma/pl330.c | 865 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/amba/pl330.h | 45 +++ 4 files changed, 920 insertions(+), 0 deletions(-) create mode 100644 drivers/dma/pl330.c create mode 100644 include/linux/amba/pl330.h
drivers/dma/Kconfig +9 -0
@@ -166,6 +166,15 @@ config TIMB_DMA config ARCH_HAS_ASYNC_TX_FIND_CHANNEL bool +config PL330_DMA + tristate "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
@@ -22,3 +22,4 @@ obj-$(CONFIG_COH901318) += coh901318.o coh901318_lli.o obj-$(CONFIG_AMCC_PPC440SPE_ADMA) += ppc4xx/ obj-$(CONFIG_TIMB_DMA) += timb_dma.o obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o +obj-$(CONFIG_PL330_DMA) += pl330.o
drivers/dma/pl330.c new file +865 -0
865 lines not on this page · raw message
include/linux/amba/pl330.h new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
1.6.2.5
2010/5/12 Jassi Brar <[email protected]>:
Quoted 7 lines
Add 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_SLAVEandDMA_MEMCPYcapabilities have been implemented.Signed-off-by Jassi Brar <[email protected]>
Really looking good now!
Yours,
Linus Walleij
Quoted 8 lines · Linus Walleij
2010/5/12 Jassi Brar <[email protected]>:
Quoted 6 lines
Add 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_SLAVEandDMA_MEMCPYcapabilities have been implemented.
Quoted 5 lines
Quoted 1 line
Signed-off-by Jassi Brar <[email protected]>Reviewed-by Linus Walleij <[email protected]>Really looking good now!
Thanks.
Now that the core driver has been accepted by Russell,
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6132/1
this api driver too could be merged by DMA API maintainers?
regards,
jassi
Hi Jassi,
Looks good, one comment:
Quoted 7 lines · Jassi Brar
Add 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_SLAVEandDMA_MEMCPYcapabilities have been implemented.Signed-off-by Jassi Brar <[email protected]>
[..]
Quoted 5 lines
(quoted diff) +5
-0+static void dma_pl330_rqcb(void *token, enum pl330_op_err err) +{ + ? ? ? struct dma_pl330_desc *desc = token; + ? ? ? struct dma_pl330_chan *pch = desc->pchan; + ? ? ? unsigned long flags;
Review
Quoted 10 lines
(quoted diff) +10
-0+ + ? ? ? /* If desc aborted */ + ? ? ? if (!pch) + ? ? ? ? ? ? ? return; + + ? ? ? spin_lock_irqsave(&pch->lock, flags); + + ? ? ? desc->status = DONE; + + ? ? ? spin_unlock_irqrestore(&pch->lock, flags);
I don't think you need the lock here. Assigning an integer is atomic, and you reschedule the tasklet.
Since this patch depends on the generic bits in Russell's tree I need to wait until after the ARM tree is pulled to take it through the dma tree. So, for now...
Quoted 12 lines · Dan Williams
Quoted 10 lines · Jassi Brar
(quoted diff) +10
-0+static void dma_pl330_rqcb(void *token, enum pl330_op_err err) +{ + ? ? ? struct dma_pl330_desc *desc = token; + ? ? ? struct dma_pl330_chan *pch = desc->pchan; + ? ? ? unsigned long flags; + + ? ? ? /* If desc aborted */ + ? ? ? if (!pch) + ? ? ? ? ? ? ? return; +
Quoted 8 lines
drivers/dma/pl330.c
Quoted 5 lines
+ ? ? ?
spin_lock_irqsave(&pch->lock, flags);drivers/dma/pl330.c new file +4
-0+ + ? ? ? desc->status = DONE; + + ? ? ? spin_unlock_irqrestore(&pch->lock, flags);I don't think you need the lock here. ?Assigning an integer is atomic, and you reschedule the tasklet.
yes right
Quoted 5 lines
Since this patch depends on the generic bits in Russell's tree I need to wait until after the ARM tree is pulled to take it through the dma tree. ?So, for now...
Acked-by Dan Williams <[email protected]>
Thanks