Skip to content

Commit 6428fcf

Browse files
kelvincheungtsbogend
authored andcommitted
MIPS: dts: loongson: Add LS1B-DEMO board
Add a device tree for LS1B-DEMO board, supporting CPU, clock, INTC, UART, Ethernet, GPIO, USB host, RTC, watchdog, DMA, NAND, and AC97. Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent cfbb794 commit 6428fcf

6 files changed

Lines changed: 463 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17016,6 +17016,7 @@ M: Keguang Zhang <keguang.zhang@gmail.com>
1701617016
L: linux-mips@vger.kernel.org
1701717017
S: Maintained
1701817018
F: Documentation/devicetree/bindings/*/loongson,ls1*.yaml
17019+
F: arch/mips/boot/dts/loongson/loongson1*
1701917020
F: arch/mips/include/asm/mach-loongson32/
1702017021
F: arch/mips/loongson32/
1702117022
F: drivers/*/*loongson1*

arch/mips/boot/dts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ subdir-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += img
88
subdir-$(CONFIG_MACH_INGENIC) += ingenic
99
subdir-$(CONFIG_LANTIQ) += lantiq
1010
subdir-$(CONFIG_MACH_LOONGSON64) += loongson
11+
subdir-$(CONFIG_MACH_LOONGSON32) += loongson
1112
subdir-$(CONFIG_SOC_VCOREIII) += mscc
1213
subdir-$(CONFIG_MIPS_MALTA) += mti
1314
subdir-$(CONFIG_LEGACY_BOARD_SEAD3) += mti

arch/mips/boot/dts/loongson/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_4core_rs780e.dtb
55
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_8core_rs780e.dtb
66
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64g_4core_ls7a.dtb
77
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64v_4core_virtio.dtb
8+
9+
dtb-$(CONFIG_MACH_LOONGSON32) += ls1b-demo.dtb
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <dt-bindings/clock/loongson,ls1x-clk.h>
9+
#include <dt-bindings/interrupt-controller/irq.h>
10+
11+
/ {
12+
#address-cells = <1>;
13+
#size-cells = <1>;
14+
15+
xtal: clock {
16+
compatible = "fixed-clock";
17+
clock-output-names = "xtal";
18+
#clock-cells = <0>;
19+
};
20+
21+
cpus {
22+
#address-cells = <1>;
23+
#size-cells = <0>;
24+
25+
cpu0: cpu@0 {
26+
reg = <0>;
27+
device_type = "cpu";
28+
clocks = <&clkc LS1X_CLKID_CPU>;
29+
#clock-cells = <1>;
30+
};
31+
};
32+
33+
cpu_intc: interrupt-controller {
34+
compatible = "mti,cpu-interrupt-controller";
35+
interrupt-controller;
36+
#interrupt-cells = <1>;
37+
#address-cells = <0>;
38+
};
39+
40+
soc: bus@1fd00000 {
41+
compatible = "simple-bus";
42+
#address-cells = <1>;
43+
#size-cells = <1>;
44+
ranges = <0x0 0x1fd00000 0x130000>;
45+
46+
intc0: interrupt-controller@1040 {
47+
compatible = "loongson,ls1x-intc";
48+
reg = <0x1040 0x18>;
49+
interrupt-controller;
50+
interrupt-parent = <&cpu_intc>;
51+
interrupts = <2>;
52+
#interrupt-cells = <2>;
53+
};
54+
55+
intc1: interrupt-controller@1058 {
56+
compatible = "loongson,ls1x-intc";
57+
reg = <0x1058 0x18>;
58+
interrupt-controller;
59+
interrupt-parent = <&cpu_intc>;
60+
interrupts = <3>;
61+
#interrupt-cells = <2>;
62+
};
63+
64+
intc2: interrupt-controller@1070 {
65+
compatible = "loongson,ls1x-intc";
66+
reg = <0x1070 0x18>;
67+
interrupt-controller;
68+
interrupt-parent = <&cpu_intc>;
69+
interrupts = <4>;
70+
#interrupt-cells = <2>;
71+
};
72+
73+
intc3: interrupt-controller@1088 {
74+
compatible = "loongson,ls1x-intc";
75+
reg = <0x1088 0x18>;
76+
interrupt-controller;
77+
interrupt-parent = <&cpu_intc>;
78+
interrupts = <5>;
79+
#interrupt-cells = <2>;
80+
};
81+
82+
gpio0: gpio@10c0 {
83+
compatible = "loongson,ls1x-gpio";
84+
reg = <0x10c0 0x4>;
85+
gpio-controller;
86+
#gpio-cells = <2>;
87+
};
88+
89+
gpio1: gpio@10c4 {
90+
compatible = "loongson,ls1x-gpio";
91+
reg = <0x10c4 0x4>;
92+
gpio-controller;
93+
#gpio-cells = <2>;
94+
};
95+
};
96+
97+
apb: bus@1fe40000 {
98+
compatible = "simple-bus";
99+
#address-cells = <1>;
100+
#size-cells = <1>;
101+
ranges = <0x0 0x1fe40000 0xc0000>;
102+
103+
uart0: serial@0 {
104+
compatible = "ns16550a";
105+
reg = <0x0 0x8>;
106+
clocks = <&clkc LS1X_CLKID_APB>;
107+
interrupt-parent = <&intc0>;
108+
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
109+
status = "disabled";
110+
};
111+
112+
uart1: serial@4000 {
113+
compatible = "ns16550a";
114+
reg = <0x4000 0x8>;
115+
clocks = <&clkc LS1X_CLKID_APB>;
116+
interrupt-parent = <&intc0>;
117+
status = "disabled";
118+
};
119+
120+
uart2: serial@8000 {
121+
compatible = "ns16550a";
122+
reg = <0x8000 0x8>;
123+
clocks = <&clkc LS1X_CLKID_APB>;
124+
interrupt-parent = <&intc0>;
125+
status = "disabled";
126+
};
127+
128+
uart3: serial@c000 {
129+
compatible = "ns16550a";
130+
reg = <0xc000 0x8>;
131+
clocks = <&clkc LS1X_CLKID_APB>;
132+
interrupt-parent = <&intc0>;
133+
status = "disabled";
134+
};
135+
};
136+
};
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
4+
*/
5+
6+
/dts-v1/;
7+
#include "loongson1.dtsi"
8+
9+
/ {
10+
cpu_opp_table: opp-table {
11+
compatible = "operating-points-v2";
12+
opp-shared;
13+
14+
opp-44000000 {
15+
opp-hz = /bits/ 64 <44000000>;
16+
};
17+
opp-47142000 {
18+
opp-hz = /bits/ 64 <47142000>;
19+
};
20+
opp-50769000 {
21+
opp-hz = /bits/ 64 <50769000>;
22+
};
23+
opp-55000000 {
24+
opp-hz = /bits/ 64 <55000000>;
25+
};
26+
opp-60000000 {
27+
opp-hz = /bits/ 64 <60000000>;
28+
};
29+
opp-66000000 {
30+
opp-hz = /bits/ 64 <66000000>;
31+
};
32+
opp-73333000 {
33+
opp-hz = /bits/ 64 <73333000>;
34+
};
35+
opp-82500000 {
36+
opp-hz = /bits/ 64 <82500000>;
37+
};
38+
opp-94285000 {
39+
opp-hz = /bits/ 64 <94285000>;
40+
};
41+
opp-110000000 {
42+
opp-hz = /bits/ 64 <110000000>;
43+
};
44+
opp-132000000 {
45+
opp-hz = /bits/ 64 <132000000>;
46+
};
47+
opp-165000000 {
48+
opp-hz = /bits/ 64 <165000000>;
49+
};
50+
opp-220000000 {
51+
opp-hz = /bits/ 64 <220000000>;
52+
};
53+
};
54+
55+
clkc: clock-controller@1fe78030 {
56+
compatible = "loongson,ls1b-clk";
57+
reg = <0x1fe78030 0x8>;
58+
clocks = <&xtal>;
59+
#clock-cells = <1>;
60+
};
61+
};
62+
63+
&soc {
64+
syscon: syscon@420 {
65+
compatible = "loongson,ls1b-syscon", "syscon";
66+
reg = <0x420 0x8>;
67+
};
68+
69+
dma: dma-controller@1160 {
70+
compatible = "loongson,ls1b-apbdma";
71+
reg = <0x1160 0x4>;
72+
interrupt-parent = <&intc0>;
73+
interrupts = <13 IRQ_TYPE_EDGE_RISING>,
74+
<14 IRQ_TYPE_EDGE_RISING>,
75+
<15 IRQ_TYPE_EDGE_RISING>;
76+
interrupt-names = "ch0", "ch1", "ch2";
77+
#dma-cells = <1>;
78+
};
79+
80+
ehci: usb@100000 {
81+
compatible = "generic-ehci";
82+
reg = <0x100000 0x100>;
83+
interrupt-parent = <&intc1>;
84+
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
85+
status = "disabled";
86+
};
87+
88+
ohci: usb@108000 {
89+
compatible = "generic-ohci";
90+
reg = <0x108000 0x100>;
91+
interrupt-parent = <&intc1>;
92+
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
93+
status = "disabled";
94+
};
95+
96+
gmac0: ethernet@110000 {
97+
compatible = "loongson,ls1b-gmac", "snps,dwmac-3.50a";
98+
reg = <0x110000 0x10000>;
99+
clocks = <&clkc LS1X_CLKID_AHB>;
100+
clock-names = "stmmaceth";
101+
interrupt-parent = <&intc1>;
102+
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
103+
interrupt-names = "macirq";
104+
loongson,ls1-syscon = <&syscon>;
105+
snps,pbl = <1>;
106+
status = "disabled";
107+
};
108+
109+
gmac1: ethernet@120000 {
110+
compatible = "loongson,ls1b-gmac", "snps,dwmac-3.50a";
111+
reg = <0x120000 0x10000>;
112+
clocks = <&clkc LS1X_CLKID_AHB>;
113+
clock-names = "stmmaceth";
114+
interrupt-parent = <&intc1>;
115+
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
116+
interrupt-names = "macirq";
117+
loongson,ls1-syscon = <&syscon>;
118+
snps,pbl = <1>;
119+
status = "disabled";
120+
};
121+
};
122+
123+
&apb {
124+
clocksource: timer@1c030 {
125+
compatible = "loongson,ls1b-pwmtimer";
126+
reg = <0x1c030 0x10>;
127+
clocks = <&clkc LS1X_CLKID_APB>;
128+
interrupt-parent = <&intc0>;
129+
interrupts = <20 IRQ_TYPE_LEVEL_HIGH>;
130+
};
131+
132+
watchdog: watchdog@1c060 {
133+
compatible = "loongson,ls1b-wdt";
134+
reg = <0x1c060 0xc>;
135+
clocks = <&clkc LS1X_CLKID_APB>;
136+
status = "disabled";
137+
};
138+
139+
rtc: rtc@24000 {
140+
compatible = "loongson,ls1b-rtc";
141+
reg = <0x24000 0x78>;
142+
interrupt-parent = <&intc0>;
143+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
144+
status = "disabled";
145+
};
146+
147+
ac97: audio-controller@34000 {
148+
compatible = "loongson,ls1b-ac97";
149+
reg = <0x34000 0x60>, <0x32420 0x4>, <0x34c4c 0x4>;
150+
reg-names = "ac97", "audio-tx", "audio-rx";
151+
dmas = <&dma 1>, <&dma 2>;
152+
dma-names = "tx", "rx";
153+
#sound-dai-cells = <0>;
154+
status = "disabled";
155+
};
156+
157+
nand: nand-controller@38000 {
158+
compatible = "loongson,ls1b-nand-controller";
159+
reg = <0x38000 0x24>, <0x38040 0x4>;
160+
reg-names = "nand", "nand-dma";
161+
dmas = <&dma 0>;
162+
dma-names = "rxtx";
163+
#address-cells = <1>;
164+
#size-cells = <0>;
165+
status = "disabled";
166+
167+
nand@0 {
168+
reg = <0>;
169+
label = "ls1x-nand";
170+
nand-use-soft-ecc-engine;
171+
nand-ecc-algo = "hamming";
172+
};
173+
};
174+
};
175+
176+
&cpu0 {
177+
operating-points-v2 = <&cpu_opp_table>;
178+
};
179+
180+
&gpio0 {
181+
ngpios = <31>;
182+
};
183+
184+
&gpio1 {
185+
ngpios = <30>;
186+
};
187+
188+
&uart1 {
189+
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
190+
};
191+
192+
&uart2 {
193+
interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
194+
};
195+
196+
&uart3 {
197+
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
198+
};

0 commit comments

Comments
 (0)