Skip to content

Commit d8902ad

Browse files
Nobuhiro Iwamatsudjbw
authored andcommitted
dmaengine: sh: Add Support SuperH DMA Engine driver
This supported all DMA channels, and it was tested in SH7722, SH7780, SH7785 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]> Acked-by: Paul Mundt <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 9134d02 commit d8902ad

File tree

7 files changed

+882
-5
lines changed

7 files changed

+882
-5
lines changed

arch/sh/drivers/dma/Kconfig

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
menu "DMA support"
22

3-
config SH_DMA_API
4-
bool
53

64
config SH_DMA
75
bool "SuperH on-chip DMA controller (DMAC) support"
86
depends on CPU_SH3 || CPU_SH4
9-
select SH_DMA_API
107
default n
118

129
config SH_DMA_IRQ_MULTI
@@ -19,6 +16,15 @@ config SH_DMA_IRQ_MULTI
1916
CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 || \
2017
CPU_SUBTYPE_SH7760
2118

19+
config SH_DMA_API
20+
depends on SH_DMA
21+
bool "SuperH DMA API support"
22+
default n
23+
help
24+
SH_DMA_API always enabled DMA API of used SuperH.
25+
If you want to use DMA ENGINE, you must not enable this.
26+
Please enable DMA_ENGINE and SH_DMAE.
27+
2228
config NR_ONCHIP_DMA_CHANNELS
2329
int
2430
depends on SH_DMA

arch/sh/drivers/dma/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# Makefile for the SuperH DMA specific kernel interface routines under Linux.
33
#
44

5-
obj-$(CONFIG_SH_DMA_API) += dma-api.o dma-sysfs.o
6-
obj-$(CONFIG_SH_DMA) += dma-sh.o
5+
obj-$(CONFIG_SH_DMA_API) += dma-sh.o dma-api.o dma-sysfs.o
76
obj-$(CONFIG_PVR2_DMA) += dma-pvr2.o
87
obj-$(CONFIG_G2_DMA) += dma-g2.o
98
obj-$(CONFIG_SH_DMABRG) += dmabrg.o

arch/sh/include/asm/dma-sh.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,17 @@ static u32 dma_base_addr[] __maybe_unused = {
115115
#define CHCR 0x0C
116116
#define DMAOR 0x40
117117

118+
/*
119+
* for dma engine
120+
*
121+
* SuperH DMA mode
122+
*/
123+
#define SHDMA_MIX_IRQ (1 << 1)
124+
#define SHDMA_DMAOR1 (1 << 2)
125+
#define SHDMA_DMAE1 (1 << 3)
126+
127+
struct sh_dmae_pdata {
128+
unsigned int mode;
129+
};
130+
118131
#endif /* __DMA_SH_H */

drivers/dma/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ config TXX9_DMAC
101101
Support the TXx9 SoC internal DMA controller. This can be
102102
integrated in chips such as the Toshiba TX4927/38/39.
103103

104+
config SH_DMAE
105+
tristate "Renesas SuperH DMAC support"
106+
depends on SUPERH && SH_DMA
107+
depends on !SH_DMA_API
108+
select DMA_ENGINE
109+
help
110+
Enable support for the Renesas SuperH DMA controllers.
111+
104112
config DMA_ENGINE
105113
bool
106114

drivers/dma/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ obj-$(CONFIG_DW_DMAC) += dw_dmac.o
99
obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
1010
obj-$(CONFIG_MX3_IPU) += ipu/
1111
obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
12+
obj-$(CONFIG_SH_DMAE) += shdma.o

0 commit comments

Comments
 (0)