Skip to content

Commit a3b834c

Browse files
committed
drivers: dma: siwx91x: DTS changes for siwx91x GPDMA driver
1. Create a YAML file for gpdma node 2. Add GPDMA node in the siwx917.dtsi Signed-off-by: Sai Santhosh Malae <[email protected]>
1 parent 2adf46b commit a3b834c

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

dts/arm/silabs/siwg917.dtsi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,20 @@
410410
#io-channel-cells = <1>;
411411
status = "disabled";
412412
};
413+
414+
gpdma0: gpdma@21080000 {
415+
compatible = "silabs,siwx91x-gpdma";
416+
#address-cells = <1>;
417+
#size-cells = <0>;
418+
reg = <0x21080000 0x1720>;
419+
interrupts = <31 0>;
420+
interrupt-names = "gpdma0";
421+
clocks = <&clock0 SIWX91X_CLK_GPDMA0>;
422+
silabs,channel-reg-base = <0x21081004>;
423+
silabs,dma-channel-count = <8>;
424+
#dma-cells = <2>;
425+
status = "disabled";
426+
};
413427
};
414428
};
415429

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
description: |
2+
Silicon Labs SiWx91x General Purpose DMA (GPDMA) Controller
3+
4+
The SiWx91x GPDMA controller provides high-performance DMA transfers for
5+
memory-to-memory, memory-to-peripheral, and peripheral-to-memory operations.
6+
It supports up to 8 channels.
7+
8+
Usage in Device Tree Overlays:
9+
10+
To enable GPDMA for a peripheral (e.g., SPI), add the following to your overlay:
11+
12+
```dts
13+
&spi0 {
14+
status = "okay";
15+
cs-gpios = <&gpiob 12 GPIO_ACTIVE_LOW>;
16+
pinctrl-0 = <&spi0_default>;
17+
pinctrl-names = "default";
18+
19+
dmas = <&gpdma0 0 11>, <&gpdma0 1 10>;
20+
dma-names = "tx", "rx";
21+
22+
slow@0 {
23+
compatible = "test-spi-loopback-slow";
24+
reg = <0>;
25+
spi-max-frequency = <500000>;
26+
};
27+
fast@1 {
28+
compatible = "test-spi-loopback-fast";
29+
reg = <1>;
30+
spi-max-frequency = <10000000>;
31+
};
32+
};
33+
34+
&gpdma0 {
35+
status = "okay";
36+
};
37+
```
38+
39+
DMA Configuration:
40+
- Channel 0: Used for TX (transmit) operations
41+
- Channel 1: Used for RX (receive) operations
42+
- Slot 11: Peripheral slot for SPI TX
43+
- Slot 10: Peripheral slot for SPI RX
44+
45+
The GPDMA controller automatically handles descriptor management and
46+
interrupt generation for transfer completion and error conditions.
47+
48+
compatible: "silabs,siwx91x-gpdma"
49+
50+
include: dma-controller.yaml
51+
52+
properties:
53+
reg:
54+
required: true
55+
56+
silabs,channel-reg-base:
57+
type: int
58+
const: 0x21081004
59+
description: |
60+
Base address for channel specific registers.
61+
62+
silabs,dma-channel-count:
63+
type: int
64+
const: 8
65+
description: |
66+
Base address for channel specific registers.
67+
68+
"#dma-cells":
69+
const: 2
70+
71+
# Parameter syntax
72+
dma-cells:
73+
- channel
74+
- slot

0 commit comments

Comments
 (0)