Skip to content

Commit 2e53071

Browse files
cameledMaureenHelm
authored andcommitted
dts: arm: introduce gd32 spi interface
Add gd32 spi initial support. Signed-off-by: HaiLong Yang <[email protected]>
1 parent 465c038 commit 2e53071

File tree

6 files changed

+149
-1
lines changed

6 files changed

+149
-1
lines changed

dts/arm/gigadevice/gd32f403/gd32f403.dtsi

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,39 @@
9595
label = "USART_4";
9696
};
9797

98+
spi0: spi@40013000 {
99+
compatible = "gd,gd32-spi";
100+
reg = <0x40013000 0x400>;
101+
interrupts = <35 0>;
102+
rcu-periph-clock = <0x60c>;
103+
status = "disabled";
104+
label = "SPI_0";
105+
#address-cells = <1>;
106+
#size-cells = <0>;
107+
};
108+
109+
spi1: spi@40003800 {
110+
compatible = "gd,gd32-spi";
111+
reg = <0x40003800 0x400>;
112+
interrupts = <36 0>;
113+
rcu-periph-clock = <0x70e>;
114+
status = "disabled";
115+
label = "SPI_1";
116+
#address-cells = <1>;
117+
#size-cells = <0>;
118+
};
119+
120+
spi2: spi@40003c00 {
121+
compatible = "gd,gd32-spi";
122+
reg = <0x40003c00 0x400>;
123+
interrupts = <51 0>;
124+
rcu-periph-clock = <0x70f>;
125+
status = "disabled";
126+
label = "SPI_2";
127+
#address-cells = <1>;
128+
#size-cells = <0>;
129+
};
130+
98131
exti: interrupt-controller@40010400 {
99132
compatible = "gd,gd32-exti";
100133
interrupt-controller;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2021 BrainCo Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <gigadevice/gd32f4xx/gd32f4xx.dtsi>
8+
9+
/ {
10+
soc {
11+
spi3: spi@40013400 {
12+
compatible = "gd,gd32-spi";
13+
reg = <0x40013400 0x400>;
14+
interrupts = <84 0>;
15+
rcu-periph-clock = <0x110d>;
16+
status = "disabled";
17+
label = "SPI_3";
18+
#address-cells = <1>;
19+
#size-cells = <0>;
20+
};
21+
22+
spi4: spi@40015000 {
23+
compatible = "gd,gd32-spi";
24+
reg = <0x40015000 0x400>;
25+
interrupts = <85 0>;
26+
rcu-periph-clock = <0x1114>;
27+
status = "disabled";
28+
label = "SPI_4";
29+
#address-cells = <1>;
30+
#size-cells = <0>;
31+
};
32+
33+
spi5: spi@40015400 {
34+
compatible = "gd,gd32-spi";
35+
reg = <0x40015400 0x400>;
36+
interrupts = <86 0>;
37+
rcu-periph-clock = <0x1115>;
38+
status = "disabled";
39+
label = "SPI_5";
40+
#address-cells = <1>;
41+
#size-cells = <0>;
42+
};
43+
};
44+
};

dts/arm/gigadevice/gd32f4xx/gd32f450ik.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
#include <mem.h>
8-
#include <gigadevice/gd32f4xx/gd32f4xx.dtsi>
8+
#include <gigadevice/gd32f4xx/gd32f450.dtsi>
99

1010
/ {
1111
soc {

dts/arm/gigadevice/gd32f4xx/gd32f4xx.dtsi

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,39 @@
171171
label = "I2C_2";
172172
};
173173

174+
spi0: spi@40013000 {
175+
compatible = "gd,gd32-spi";
176+
reg = <0x40013000 0x400>;
177+
interrupts = <35 0>;
178+
rcu-periph-clock = <0x110c>;
179+
status = "disabled";
180+
label = "SPI_0";
181+
#address-cells = <1>;
182+
#size-cells = <0>;
183+
};
184+
185+
spi1: spi@40003800 {
186+
compatible = "gd,gd32-spi";
187+
reg = <0x40003800 0x400>;
188+
interrupts = <36 0>;
189+
rcu-periph-clock = <0x100e>;
190+
status = "disabled";
191+
label = "SPI_1";
192+
#address-cells = <1>;
193+
#size-cells = <0>;
194+
};
195+
196+
spi2: spi@40003c00 {
197+
compatible = "gd,gd32-spi";
198+
reg = <0x40003c00 0x400>;
199+
interrupts = <51 0>;
200+
rcu-periph-clock = <0x100f>;
201+
status = "disabled";
202+
label = "SPI_2";
203+
#address-cells = <1>;
204+
#size-cells = <0>;
205+
};
206+
174207
syscfg: syscfg@40013800 {
175208
compatible = "gd,gd32-syscfg";
176209
reg = <0x40013800 0x400>;

dts/bindings/spi/gd,gd32-spi.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2021 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: GigaDevice GD32 SPI
5+
6+
compatible: "gd,gd32-spi"
7+
8+
include: [spi-controller.yaml, pinctrl-device.yaml]
9+
10+
properties:
11+
reg:
12+
required: true
13+
14+
interrupts:
15+
required: true
16+
17+
rcu-periph-clock:
18+
type: int
19+
description: Peripheral RCU(Reset Clock Unit) Clock ID
20+
required: true
21+
22+
pinctrl-0:
23+
required: true
24+
25+
pinctrl-names:
26+
required: true

dts/riscv/gigadevice/gd32vf103.dtsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@
123123
label = "I2C_0";
124124
};
125125

126+
spi0: spi@40013000 {
127+
compatible = "gd,gd32-spi";
128+
reg = <0x40013000 0x400>;
129+
interrupts = <54 0>;
130+
interrupt-parent = <&eclic>;
131+
rcu-periph-clock = <0x60c>;
132+
status = "disabled";
133+
label = "SPI_0";
134+
#address-cells = <1>;
135+
#size-cells = <0>;
136+
};
137+
126138
afio: afio@40010000 {
127139
compatible = "gd,gd32-afio";
128140
reg = <0x40010000 0x400>;

0 commit comments

Comments
 (0)