Skip to content

Commit 3309df4

Browse files
committed
riscv: dts: sophgo: sg2044: add PCIe device support for SG2044
Add PCIe device node for SG2044 and configuration for Sophgo SRD3-10. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Inochi Amaoto <[email protected]> Signed-off-by: Chen Wang <[email protected]> Signed-off-by: Chen Wang <[email protected]>
1 parent 7cc9255 commit 3309df4

File tree

2 files changed

+205
-0
lines changed

2 files changed

+205
-0
lines changed

arch/riscv/boot/dts/sophgo/sg2044-sophgo-srd3-10.dts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,36 @@
6767
status = "okay";
6868
};
6969

70+
&pcie0 {
71+
bus-range = <0x00 0xff>;
72+
linux,pci-domain = <1>;
73+
status = "okay";
74+
};
75+
76+
&pcie1 {
77+
bus-range = <0x00 0xff>;
78+
linux,pci-domain = <0>;
79+
status = "okay";
80+
};
81+
82+
&pcie2 {
83+
bus-range = <0x00 0xff>;
84+
linux,pci-domain = <3>;
85+
status = "okay";
86+
};
87+
88+
&pcie3 {
89+
bus-range = <0x00 0xff>;
90+
linux,pci-domain = <2>;
91+
status = "okay";
92+
};
93+
94+
&pcie4 {
95+
bus-range = <0x00 0xff>;
96+
linux,pci-domain = <4>;
97+
status = "okay";
98+
};
99+
70100
&pwm {
71101
status = "okay";
72102
};

arch/riscv/boot/dts/sophgo/sg2044.dtsi

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,181 @@
3232
#size-cells = <2>;
3333
ranges;
3434

35+
pcie0: pcie@6c00000000 {
36+
compatible = "sophgo,sg2044-pcie";
37+
reg = <0x6c 0x00000000 0x0 0x00001000>,
38+
<0x6c 0x00300000 0x0 0x00004000>,
39+
<0x48 0x00000000 0x0 0x00001000>,
40+
<0x6c 0x000c0000 0x0 0x00001000>;
41+
reg-names = "dbi", "atu", "config", "app";
42+
#address-cells = <3>;
43+
#size-cells = <2>;
44+
#interrupt-cells = <1>;
45+
clocks = <&clk CLK_GATE_PCIE_1G>;
46+
clock-names = "core";
47+
device_type = "pci";
48+
interrupt-map-mask = <0 0 0 7>;
49+
interrupt-map = <0 0 0 1 &pcie_intc0 0>,
50+
<0 0 0 2 &pcie_intc0 1>,
51+
<0 0 0 3 &pcie_intc0 2>,
52+
<0 0 0 4 &pcie_intc0 3>;
53+
msi-parent = <&msi>;
54+
ranges = <0x01000000 0x0 0x00000000 0x48 0x10000000 0x0 0x00200000>,
55+
<0x42000000 0x0 0x10000000 0x0 0x10000000 0x0 0x04000000>,
56+
<0x02000000 0x0 0x14000000 0x0 0x14000000 0x0 0x04000000>,
57+
<0x43000000 0x4a 0x00000000 0x4a 0x00000000 0x2 0x00000000>,
58+
<0x03000000 0x49 0x00000000 0x49 0x00000000 0x1 0x00000000>;
59+
status = "disabled";
60+
61+
pcie_intc0: interrupt-controller {
62+
#address-cells = <0>;
63+
#interrupt-cells = <1>;
64+
interrupt-parent = <&intc>;
65+
interrupts = <65 IRQ_TYPE_LEVEL_HIGH>;
66+
interrupt-controller;
67+
};
68+
};
69+
70+
pcie1: pcie@6c00400000 {
71+
compatible = "sophgo,sg2044-pcie";
72+
reg = <0x6c 0x00400000 0x0 0x00001000>,
73+
<0x6c 0x00700000 0x0 0x00004000>,
74+
<0x40 0x00000000 0x0 0x00001000>,
75+
<0x6c 0x00780000 0x0 0x00001000>;
76+
reg-names = "dbi", "atu", "config", "app";
77+
#address-cells = <3>;
78+
#size-cells = <2>;
79+
#interrupt-cells = <1>;
80+
clocks = <&clk CLK_GATE_PCIE_1G>;
81+
clock-names = "core";
82+
device_type = "pci";
83+
interrupt-map-mask = <0 0 0 7>;
84+
interrupt-map = <0 0 0 1 &pcie_intc1 0>,
85+
<0 0 0 2 &pcie_intc1 1>,
86+
<0 0 0 3 &pcie_intc1 2>,
87+
<0 0 0 4 &pcie_intc1 3>;
88+
msi-parent = <&msi>;
89+
ranges = <0x01000000 0x0 0x00000000 0x40 0x10000000 0x0 0x00200000>,
90+
<0x42000000 0x0 0x00000000 0x0 0x00000000 0x0 0x04000000>,
91+
<0x02000000 0x0 0x04000000 0x0 0x04000000 0x0 0x04000000>,
92+
<0x43000000 0x42 0x00000000 0x42 0x00000000 0x2 0x00000000>,
93+
<0x03000000 0x41 0x00000000 0x41 0x00000000 0x1 0x00000000>;
94+
status = "disabled";
95+
96+
pcie_intc1: interrupt-controller {
97+
#address-cells = <0>;
98+
#interrupt-cells = <1>;
99+
interrupt-parent = <&intc>;
100+
interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
101+
interrupt-controller;
102+
};
103+
};
104+
105+
pcie2: pcie@6c04000000 {
106+
compatible = "sophgo,sg2044-pcie";
107+
reg = <0x6c 0x04000000 0x0 0x00001000>,
108+
<0x6c 0x04300000 0x0 0x00004000>,
109+
<0x58 0x00000000 0x0 0x00001000>,
110+
<0x6c 0x040c0000 0x0 0x00001000>;
111+
reg-names = "dbi", "atu", "config", "app";
112+
#address-cells = <3>;
113+
#size-cells = <2>;
114+
#interrupt-cells = <1>;
115+
clocks = <&clk CLK_GATE_PCIE_1G>;
116+
clock-names = "core";
117+
device_type = "pci";
118+
interrupt-map-mask = <0 0 0 7>;
119+
interrupt-map = <0 0 0 1 &pcie_intc2 0>,
120+
<0 0 0 2 &pcie_intc2 1>,
121+
<0 0 0 3 &pcie_intc2 2>,
122+
<0 0 0 4 &pcie_intc2 3>;
123+
msi-parent = <&msi>;
124+
ranges = <0x01000000 0x0 0x00000000 0x58 0x10000000 0x0 0x00200000>,
125+
<0x42000000 0x0 0x30000000 0x0 0x30000000 0x0 0x04000000>,
126+
<0x02000000 0x0 0x34000000 0x0 0x34000000 0x0 0x04000000>,
127+
<0x43000000 0x5a 0x00000000 0x5a 0x00000000 0x2 0x00000000>,
128+
<0x03000000 0x59 0x00000000 0x59 0x00000000 0x1 0x00000000>;
129+
status = "disabled";
130+
131+
pcie_intc2: interrupt-controller {
132+
#address-cells = <0>;
133+
#interrupt-cells = <1>;
134+
interrupt-parent = <&intc>;
135+
interrupts = <74 IRQ_TYPE_LEVEL_HIGH>;
136+
interrupt-controller;
137+
};
138+
};
139+
140+
pcie3: pcie@6c04400000 {
141+
compatible = "sophgo,sg2044-pcie";
142+
reg = <0x6c 0x04400000 0x0 0x00001000>,
143+
<0x6c 0x04700000 0x0 0x00004000>,
144+
<0x50 0x00000000 0x0 0x00001000>,
145+
<0x6c 0x04780000 0x0 0x00001000>;
146+
reg-names = "dbi", "atu", "config", "app";
147+
#address-cells = <3>;
148+
#size-cells = <2>;
149+
#interrupt-cells = <1>;
150+
clocks = <&clk CLK_GATE_PCIE_1G>;
151+
clock-names = "core";
152+
device_type = "pci";
153+
interrupt-map-mask = <0 0 0 7>;
154+
interrupt-map = <0 0 0 1 &pcie_intc3 0>,
155+
<0 0 0 2 &pcie_intc3 1>,
156+
<0 0 0 3 &pcie_intc3 2>,
157+
<0 0 0 4 &pcie_intc3 3>;
158+
msi-parent = <&msi>;
159+
ranges = <0x01000000 0x0 0x00000000 0x50 0x10000000 0x0 0x00200000>,
160+
<0x42000000 0x0 0x20000000 0x0 0x20000000 0x0 0x04000000>,
161+
<0x02000000 0x0 0x24000000 0x0 0x24000000 0x0 0x04000000>,
162+
<0x43000000 0x52 0x00000000 0x52 0x00000000 0x2 0x00000000>,
163+
<0x03000000 0x51 0x00000000 0x51 0x00000000 0x1 0x00000000>;
164+
status = "disabled";
165+
166+
pcie_intc3: interrupt-controller {
167+
#address-cells = <0>;
168+
#interrupt-cells = <1>;
169+
interrupt-parent = <&intc>;
170+
interrupts = <73 IRQ_TYPE_LEVEL_HIGH>;
171+
interrupt-controller;
172+
};
173+
};
174+
175+
pcie4: pcie@6c08400000 {
176+
compatible = "sophgo,sg2044-pcie";
177+
reg = <0x6c 0x08400000 0x0 0x00001000>,
178+
<0x6c 0x08700000 0x0 0x00004000>,
179+
<0x60 0x00000000 0x0 0x00001000>,
180+
<0x6c 0x08780000 0x0 0x00001000>;
181+
reg-names = "dbi", "atu", "config", "app";
182+
#address-cells = <3>;
183+
#size-cells = <2>;
184+
#interrupt-cells = <1>;
185+
clocks = <&clk CLK_GATE_PCIE_1G>;
186+
clock-names = "core";
187+
device_type = "pci";
188+
interrupt-map-mask = <0 0 0 7>;
189+
interrupt-map = <0 0 0 1 &pcie_intc4 0>,
190+
<0 0 0 2 &pcie_intc4 1>,
191+
<0 0 0 3 &pcie_intc4 2>,
192+
<0 0 0 4 &pcie_intc4 3>;
193+
msi-parent = <&msi>;
194+
ranges = <0x01000000 0x0 0x00000000 0x60 0x10000000 0x0 0x00200000>,
195+
<0x42000000 0x0 0x40000000 0x0 0x40000000 0x0 0x04000000>,
196+
<0x02000000 0x0 0x44000000 0x0 0x44000000 0x0 0x04000000>,
197+
<0x43000000 0x62 0x00000000 0x62 0x00000000 0x2 0x00000000>,
198+
<0x03000000 0x61 0x00000000 0x61 0x00000000 0x1 0x00000000>;
199+
status = "disabled";
200+
201+
pcie_intc4: interrupt-controller {
202+
#address-cells = <0>;
203+
#interrupt-cells = <1>;
204+
interrupt-parent = <&intc>;
205+
interrupts = <125 IRQ_TYPE_LEVEL_HIGH>;
206+
interrupt-controller;
207+
};
208+
};
209+
35210
msi: msi-controller@6d50000000 {
36211
compatible = "sophgo,sg2044-msi";
37212
reg = <0x6d 0x50000000 0x0 0x800>,

0 commit comments

Comments
 (0)