dmaengine: sh: Add Support SuperH DMA Engine driver
PATCH v4 1/1 dmaengine: sh: Add Support SuperH DMA Engine driver
This supported all DMA channels, and it was tested in SH7722, SH7780 and SH7763.
This can not use with SH DMA API.
Signed-off-by Nobuhiro Iwamatsu <[email protected]>
Reviewed-by Matt Fleming <[email protected]>
Acked-by Maciej Sosnowski <[email protected]>
---
V4: Reflect Dan's comments.
arch/sh/drivers/dma/Kconfig | 12 +- arch/sh/drivers/dma/Makefile | 3 +- arch/sh/include/asm/dma-sh.h | 13 + drivers/dma/Kconfig | 8 + drivers/dma/Makefile | 2 + drivers/dma/shdma.c | 782 ++++++++++++++++++++++++++++++++++++++++++ drivers/dma/shdma.h | 63 ++++ 7 files changed, 878 insertions(+), 5 deletions(-) create mode 100644 drivers/dma/shdma.c create mode 100644 drivers/dma/shdma.h
arch/sh/drivers/dma/Kconfig +9 -3
@@ -1,12 +1,9 @@ menu "DMA support" -config SH_DMA_API - bool config SH_DMA bool "SuperH on-chip DMA controller (DMAC) support" depends on CPU_SH3 || CPU_SH4 - select SH_DMA_API default n config SH_DMA_IRQ_MULTI
@@ -18,6 +15,15 @@ config SH_DMA_IRQ_MULTI CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7764 || \ CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 +config SH_DMA_API + depends on SH_DMA + bool "SuperH DMA API support" + default n + help + SH_DMA_API always enabled DMA API of used SuperH. + If you want to use DMA ENGINE, you must not enable this. + Please enable DMA_ENGINE and SH_DMAE. + config NR_ONCHIP_DMA_CHANNELS int depends on SH_DMA
arch/sh/drivers/dma/Makefile +1 -2
@@ -2,8 +2,7 @@ # Makefile for the SuperH DMA specific kernel interface routines under Linux. # -obj-$(CONFIG_SH_DMA_API) += dma-api.o dma-sysfs.o -obj-$(CONFIG_SH_DMA) += dma-sh.o +obj-$(CONFIG_SH_DMA_API) += dma-sh.o dma-api.o dma-sysfs.o obj-$(CONFIG_PVR2_DMA) += dma-pvr2.o obj-$(CONFIG_G2_DMA) += dma-g2.o obj-$(CONFIG_SH_DMABRG) += dmabrg.o
arch/sh/include/asm/dma-sh.h +13 -0
@@ -115,4 +115,17 @@ static u32 dma_base_addr[] __maybe_unused = {#define CHCR 0x0C#define DMAOR 0x40 +/* +* for dma engine +* +* SuperH DMA mode +*/ +#define SHDMA_MIX_IRQ (1 << 1) +#define SHDMA_DMAOR1 (1 << 2) +#define SHDMA_DMAE1 (1 << 3) + +struct sh_dmae_pdata { +unsigned int mode; +}; +#endif /* __DMA_SH_H */
drivers/dma/Kconfig +8 -0
@@ -81,6 +81,14 @@ config MX3_IPU_IRQS To avoid bloating the irq_desc[] array we allocate a sufficient number of IRQ slots and map them dynamically to specific sources. +config SH_DMAE + tristate "Renesas SuperH DMAC support" + depends on SUPERH && SH_DMA + depends on !SH_DMA_API + select DMA_ENGINE + help + Enable support for the Renesas SuperH DMA controllers. + config DMA_ENGINE bool
drivers/dma/Makefile +2 -0
@@ -8,3 +8,5 @@ obj-$(CONFIG_FSL_DMA) += fsldma.o obj-$(CONFIG_MV_XOR) += mv_xor.o obj-$(CONFIG_DW_DMAC) += dw_dmac.o obj-$(CONFIG_MX3_IPU) += ipu/ +obj-$(CONFIG_SH_DMAE) += shdma.o +
drivers/dma/shdma.c new file +780 -0
780 lines not on this page · raw message
drivers/dma/shdma.h new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
1.6.2.1