Skip to content

Commit 0f66569

Browse files
AaronDotchenhuacai
authored andcommitted
LoongArch: dts: DeviceTree for Loongson-2K0500
Add DeviceTree file for Loongson-2K0500 processor, which integrates one 64-bit 2-issue superscalar LA264 processor core. Signed-off-by: Binbin Zhou <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 5f346a6 commit 0f66569

File tree

3 files changed

+356
-0
lines changed

3 files changed

+356
-0
lines changed

arch/loongarch/boot/dts/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

3+
dtb-y = loongson-2k0500-ref.dtb
4+
35
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_NAME))
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (C) 2023 Loongson Technology Corporation Limited
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include "loongson-2k0500.dtsi"
9+
10+
/ {
11+
compatible = "loongson,ls2k0500-ref", "loongson,ls2k0500";
12+
model = "Loongson-2K0500 Reference Board";
13+
14+
aliases {
15+
ethernet0 = &gmac0;
16+
ethernet1 = &gmac1;
17+
serial0 = &uart0;
18+
};
19+
20+
chosen {
21+
stdout-path = "serial0:115200n8";
22+
};
23+
24+
memory@200000 {
25+
device_type = "memory";
26+
reg = <0x0 0x00200000 0x0 0x0ee00000>,
27+
<0x0 0x90000000 0x0 0x60000000>;
28+
};
29+
30+
reserved-memory {
31+
#address-cells = <2>;
32+
#size-cells = <2>;
33+
ranges;
34+
35+
linux,cma {
36+
compatible = "shared-dma-pool";
37+
reusable;
38+
size = <0x0 0x2000000>;
39+
linux,cma-default;
40+
};
41+
};
42+
};
43+
44+
&gmac0 {
45+
status = "okay";
46+
47+
phy-mode = "rgmii";
48+
bus_id = <0x0>;
49+
};
50+
51+
&gmac1 {
52+
status = "okay";
53+
54+
phy-mode = "rgmii";
55+
bus_id = <0x1>;
56+
};
57+
58+
&i2c0 {
59+
status = "okay";
60+
61+
#address-cells = <1>;
62+
#size-cells = <0>;
63+
eeprom@57{
64+
compatible = "atmel,24c16";
65+
reg = <0x57>;
66+
pagesize = <16>;
67+
};
68+
};
69+
70+
&ehci0 {
71+
status = "okay";
72+
};
73+
74+
&ohci0 {
75+
status = "okay";
76+
};
77+
78+
&sata {
79+
status = "okay";
80+
};
81+
82+
&uart0 {
83+
status = "okay";
84+
};
85+
86+
&rtc0 {
87+
status = "okay";
88+
};
Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (C) 2023 Loongson Technology Corporation Limited
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <dt-bindings/interrupt-controller/irq.h>
9+
10+
/ {
11+
#address-cells = <2>;
12+
#size-cells = <2>;
13+
14+
cpus {
15+
#address-cells = <1>;
16+
#size-cells = <0>;
17+
18+
cpu0: cpu@0 {
19+
compatible = "loongson,la264";
20+
device_type = "cpu";
21+
reg = <0x0>;
22+
clocks = <&cpu_clk>;
23+
};
24+
};
25+
26+
cpu_clk: cpu-clk {
27+
compatible = "fixed-clock";
28+
#clock-cells = <0>;
29+
clock-frequency = <500000000>;
30+
};
31+
32+
cpuintc: interrupt-controller {
33+
compatible = "loongson,cpu-interrupt-controller";
34+
#interrupt-cells = <1>;
35+
interrupt-controller;
36+
};
37+
38+
bus@10000000 {
39+
compatible = "simple-bus";
40+
ranges = <0x0 0x10000000 0x0 0x10000000 0x0 0x10000000>,
41+
<0x0 0x02000000 0x0 0x02000000 0x0 0x02000000>,
42+
<0x0 0x20000000 0x0 0x20000000 0x0 0x10000000>,
43+
<0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>,
44+
<0xfe 0x0 0xfe 0x0 0x0 0x40000000>;
45+
#address-cells = <2>;
46+
#size-cells = <2>;
47+
48+
isa@16400000 {
49+
compatible = "isa";
50+
#size-cells = <1>;
51+
#address-cells = <2>;
52+
ranges = <1 0x0 0x0 0x16400000 0x4000>;
53+
};
54+
55+
liointc0: interrupt-controller@1fe11400 {
56+
compatible = "loongson,liointc-2.0";
57+
reg = <0x0 0x1fe11400 0x0 0x40>,
58+
<0x0 0x1fe11040 0x0 0x8>;
59+
reg-names = "main", "isr0";
60+
61+
interrupt-controller;
62+
#interrupt-cells = <2>;
63+
interrupt-parent = <&cpuintc>;
64+
interrupts = <2>;
65+
interrupt-names = "int0";
66+
67+
loongson,parent_int_map = <0xffffffff>, /* int0 */
68+
<0x00000000>, /* int1 */
69+
<0x00000000>, /* int2 */
70+
<0x00000000>; /* int3 */
71+
};
72+
73+
liointc1: interrupt-controller@1fe11440 {
74+
compatible = "loongson,liointc-2.0";
75+
reg = <0x0 0x1fe11440 0x0 0x40>,
76+
<0x0 0x1fe11048 0x0 0x8>;
77+
reg-names = "main", "isr0";
78+
79+
interrupt-controller;
80+
#interrupt-cells = <2>;
81+
interrupt-parent = <&cpuintc>;
82+
interrupts = <4>;
83+
interrupt-names = "int2";
84+
85+
loongson,parent_int_map = <0x00000000>, /* int0 */
86+
<0x00000000>, /* int1 */
87+
<0xffffffff>, /* int2 */
88+
<0x00000000>; /* int3 */
89+
};
90+
91+
eiointc: interrupt-controller@1fe11600 {
92+
compatible = "loongson,ls2k0500-eiointc";
93+
reg = <0x0 0x1fe11600 0x0 0xea00>;
94+
interrupt-controller;
95+
#interrupt-cells = <1>;
96+
interrupt-parent = <&cpuintc>;
97+
interrupts = <3>;
98+
};
99+
100+
gmac0: ethernet@1f020000 {
101+
compatible = "snps,dwmac-3.70a";
102+
reg = <0x0 0x1f020000 0x0 0x10000>;
103+
interrupt-parent = <&liointc0>;
104+
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
105+
interrupt-names = "macirq";
106+
status = "disabled";
107+
};
108+
109+
gmac1: ethernet@1f030000 {
110+
compatible = "snps,dwmac-3.70a";
111+
reg = <0x0 0x1f030000 0x0 0x10000>;
112+
interrupt-parent = <&liointc0>;
113+
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
114+
interrupt-names = "macirq";
115+
status = "disabled";
116+
};
117+
118+
sata: sata@1f040000 {
119+
compatible = "snps,spear-ahci";
120+
reg = <0x0 0x1f040000 0x0 0x10000>;
121+
interrupt-parent = <&eiointc>;
122+
interrupts = <75>;
123+
status = "disabled";
124+
};
125+
126+
ehci0: usb@1f050000 {
127+
compatible = "generic-ehci";
128+
reg = <0x0 0x1f050000 0x0 0x8000>;
129+
interrupt-parent = <&eiointc>;
130+
interrupts = <71>;
131+
status = "disabled";
132+
};
133+
134+
ohci0: usb@1f058000 {
135+
compatible = "generic-ohci";
136+
reg = <0x0 0x1f058000 0x0 0x8000>;
137+
interrupt-parent = <&eiointc>;
138+
interrupts = <72>;
139+
status = "disabled";
140+
};
141+
142+
uart0: serial@1ff40800 {
143+
compatible = "ns16550a";
144+
reg = <0x0 0x1ff40800 0x0 0x10>;
145+
clock-frequency = <100000000>;
146+
interrupt-parent = <&eiointc>;
147+
interrupts = <2>;
148+
no-loopback-test;
149+
status = "disabled";
150+
};
151+
152+
i2c0: i2c@1ff48000 {
153+
compatible = "loongson,ls2k-i2c";
154+
reg = <0x0 0x1ff48000 0x0 0x0800>;
155+
interrupt-parent = <&eiointc>;
156+
interrupts = <14>;
157+
status = "disabled";
158+
};
159+
160+
i2c@1ff48800 {
161+
compatible = "loongson,ls2k-i2c";
162+
reg = <0x0 0x1ff48800 0x0 0x0800>;
163+
interrupt-parent = <&eiointc>;
164+
interrupts = <15>;
165+
status = "disabled";
166+
};
167+
168+
i2c@1ff49000 {
169+
compatible = "loongson,ls2k-i2c";
170+
reg = <0x0 0x1ff49000 0x0 0x0800>;
171+
interrupt-parent = <&eiointc>;
172+
interrupts = <16>;
173+
status = "disabled";
174+
};
175+
176+
i2c@1ff49800 {
177+
compatible = "loongson,ls2k-i2c";
178+
reg = <0x0 0x1ff49800 0x0 0x0800>;
179+
interrupt-parent = <&eiointc>;
180+
interrupts = <17>;
181+
status = "disabled";
182+
};
183+
184+
i2c@1ff4a000 {
185+
compatible = "loongson,ls2k-i2c";
186+
reg = <0x0 0x1ff4a000 0x0 0x0800>;
187+
interrupt-parent = <&eiointc>;
188+
interrupts = <18>;
189+
status = "disabled";
190+
};
191+
192+
i2c@1ff4a800 {
193+
compatible = "loongson,ls2k-i2c";
194+
reg = <0x0 0x1ff4a800 0x0 0x0800>;
195+
interrupt-parent = <&eiointc>;
196+
interrupts = <19>;
197+
status = "disabled";
198+
};
199+
200+
pmc: power-management@1ff6c000 {
201+
compatible = "loongson,ls2k0500-pmc", "syscon";
202+
reg = <0x0 0x1ff6c000 0x0 0x58>;
203+
interrupt-parent = <&eiointc>;
204+
interrupts = <56>;
205+
loongson,suspend-address = <0x0 0x1c000500>;
206+
207+
syscon-reboot {
208+
compatible = "syscon-reboot";
209+
offset = <0x30>;
210+
mask = <0x1>;
211+
};
212+
213+
syscon-poweroff {
214+
compatible = "syscon-poweroff";
215+
regmap = <&pmc>;
216+
offset = <0x14>;
217+
mask = <0x3c00>;
218+
value = <0x3c00>;
219+
};
220+
};
221+
222+
rtc0: rtc@1ff6c100 {
223+
compatible = "loongson,ls2k0500-rtc", "loongson,ls7a-rtc";
224+
reg = <0x0 0x1ff6c100 0x0 0x100>;
225+
interrupt-parent = <&eiointc>;
226+
interrupts = <35>;
227+
status = "disabled";
228+
};
229+
230+
pcie@1a000000 {
231+
compatible = "loongson,ls2k-pci";
232+
reg = <0x0 0x1a000000 0x0 0x02000000>,
233+
<0xfe 0x0 0x0 0x20000000>;
234+
#address-cells = <3>;
235+
#size-cells = <2>;
236+
device_type = "pci";
237+
bus-range = <0x0 0x5>;
238+
ranges = <0x01000000 0x0 0x00004000 0x0 0x16404000 0x0 0x00004000>,
239+
<0x02000000 0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>;
240+
241+
pcie@0,0 {
242+
reg = <0x0000 0x0 0x0 0x0 0x0>;
243+
#address-cells = <3>;
244+
#size-cells = <2>;
245+
device_type = "pci";
246+
interrupt-parent = <&eiointc>;
247+
#interrupt-cells = <1>;
248+
interrupt-map-mask = <0x0 0x0 0x0 0x0>;
249+
interrupt-map = <0x0 0x0 0x0 0x0 &eiointc 81>;
250+
ranges;
251+
};
252+
253+
pcie@1,0 {
254+
reg = <0x0800 0x0 0x0 0x0 0x0>;
255+
#address-cells = <3>;
256+
#size-cells = <2>;
257+
device_type = "pci";
258+
interrupt-parent = <&eiointc>;
259+
#interrupt-cells = <1>;
260+
interrupt-map-mask = <0x0 0x0 0x0 0x0>;
261+
interrupt-map = <0x0 0x0 0x0 0x0 &eiointc 82>;
262+
ranges;
263+
};
264+
};
265+
};
266+
};

0 commit comments

Comments
 (0)