Skip to content

Commit 96286b5

Browse files
koaloVinod Koul
authored and
Vinod Koul
committed
dmaengine: Add support for BCM2835
Add support for DMA controller of BCM2835 as used in the Raspberry Pi. Currently it only supports cyclic DMA. Signed-off-by: Florian Meier <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent 0adcdee commit 96286b5

File tree

4 files changed

+770
-0
lines changed

4 files changed

+770
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
* BCM2835 DMA controller
2+
3+
The BCM2835 DMA controller has 16 channels in total.
4+
Only the lower 13 channels have an associated IRQ.
5+
Some arbitrary channels are used by the firmware
6+
(1,3,6,7 in the current firmware version).
7+
The channels 0,2 and 3 have special functionality
8+
and should not be used by the driver.
9+
10+
Required properties:
11+
- compatible: Should be "brcm,bcm2835-dma".
12+
- reg: Should contain DMA registers location and length.
13+
- interrupts: Should contain the DMA interrupts associated
14+
to the DMA channels in ascending order.
15+
- #dma-cells: Must be <1>, the cell in the dmas property of the
16+
client device represents the DREQ number.
17+
- brcm,dma-channel-mask: Bit mask representing the channels
18+
not used by the firmware in ascending order,
19+
i.e. first channel corresponds to LSB.
20+
21+
Example:
22+
23+
dma: dma@7e007000 {
24+
compatible = "brcm,bcm2835-dma";
25+
reg = <0x7e007000 0xf00>;
26+
interrupts = <1 16>,
27+
<1 17>,
28+
<1 18>,
29+
<1 19>,
30+
<1 20>,
31+
<1 21>,
32+
<1 22>,
33+
<1 23>,
34+
<1 24>,
35+
<1 25>,
36+
<1 26>,
37+
<1 27>,
38+
<1 28>;
39+
40+
#dma-cells = <1>;
41+
brcm,dma-channel-mask = <0x7f35>;
42+
};
43+
44+
DMA clients connected to the BCM2835 DMA controller must use the format
45+
described in the dma.txt file, using a two-cell specifier for each channel.
46+
47+
Example:
48+
49+
bcm2835_i2s: i2s@7e203000 {
50+
compatible = "brcm,bcm2835-i2s";
51+
reg = < 0x7e203000 0x20>,
52+
< 0x7e101098 0x02>;
53+
54+
dmas = <&dma 2>,
55+
<&dma 3>;
56+
dma-names = "tx", "rx";
57+
};

drivers/dma/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ config DMA_OMAP
301301
select DMA_ENGINE
302302
select DMA_VIRTUAL_CHANNELS
303303

304+
config DMA_BCM2835
305+
tristate "BCM2835 DMA engine support"
306+
depends on (ARCH_BCM2835 || MACH_BCM2708)
307+
select DMA_ENGINE
308+
select DMA_VIRTUAL_CHANNELS
309+
304310
config TI_CPPI41
305311
tristate "AM33xx CPPI41 DMA support"
306312
depends on ARCH_OMAP

drivers/dma/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ obj-$(CONFIG_EP93XX_DMA) += ep93xx_dma.o
3838
obj-$(CONFIG_DMA_SA11X0) += sa11x0-dma.o
3939
obj-$(CONFIG_MMP_TDMA) += mmp_tdma.o
4040
obj-$(CONFIG_DMA_OMAP) += omap-dma.o
41+
obj-$(CONFIG_DMA_BCM2835) += bcm2835-dma.o
4142
obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o
4243
obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o
4344
obj-$(CONFIG_TI_CPPI41) += cppi41.o

0 commit comments

Comments
 (0)