Skip to content

Commit cf4b382

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

3 files changed

Lines changed: 252 additions & 0 deletions

File tree

arch/mips/boot/dts/loongson/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ dtb-$(CONFIG_MACH_LOONGSON64) += loongson64v_4core_virtio.dtb
88

99
dtb-$(CONFIG_MACH_LOONGSON32) += ls1b-demo.dtb
1010
dtb-$(CONFIG_MACH_LOONGSON32) += lsgz_1b_dev.dtb
11+
dtb-$(CONFIG_MACH_LOONGSON32) += smartloong-1c.dtb
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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+
clkc: clock-controller@1fe78030 {
11+
compatible = "loongson,ls1c-clk";
12+
reg = <0x1fe78030 0x8>;
13+
clocks = <&xtal>;
14+
#clock-cells = <1>;
15+
};
16+
};
17+
18+
&soc {
19+
syscon: syscon@420 {
20+
compatible = "loongson,ls1c-syscon", "syscon";
21+
reg = <0x420 0x8>;
22+
};
23+
24+
intc4: interrupt-controller@10a0 {
25+
compatible = "loongson,ls1x-intc";
26+
reg = <0x10a0 0x18>;
27+
interrupt-controller;
28+
interrupt-parent = <&cpu_intc>;
29+
interrupts = <6>;
30+
#interrupt-cells = <2>;
31+
};
32+
33+
gpio2: gpio@10c8 {
34+
compatible = "loongson,ls1x-gpio";
35+
reg = <0x10c8 0x4>;
36+
gpio-controller;
37+
ngpios = <32>;
38+
#gpio-cells = <2>;
39+
};
40+
41+
gpio3: gpio@10cc {
42+
compatible = "loongson,ls1x-gpio";
43+
reg = <0x10cc 0x4>;
44+
gpio-controller;
45+
ngpios = <32>;
46+
#gpio-cells = <2>;
47+
};
48+
49+
dma: dma-controller@1160 {
50+
compatible = "loongson,ls1c-apbdma", "loongson,ls1b-apbdma";
51+
reg = <0x1160 0x4>;
52+
interrupt-parent = <&intc0>;
53+
interrupts = <13 IRQ_TYPE_EDGE_RISING>,
54+
<14 IRQ_TYPE_EDGE_RISING>,
55+
<15 IRQ_TYPE_EDGE_RISING>;
56+
interrupt-names = "ch0", "ch1", "ch2";
57+
#dma-cells = <1>;
58+
};
59+
60+
emac: ethernet@110000 {
61+
compatible = "loongson,ls1c-emac", "snps,dwmac-3.50a";
62+
reg = <0x110000 0x10000>;
63+
clocks = <&clkc LS1X_CLKID_AHB>;
64+
clock-names = "stmmaceth";
65+
interrupt-parent = <&intc1>;
66+
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
67+
interrupt-names = "macirq";
68+
loongson,ls1-syscon = <&syscon>;
69+
snps,pbl = <1>;
70+
status = "disabled";
71+
};
72+
73+
ehci: usb@120000 {
74+
compatible = "generic-ehci";
75+
reg = <0x120000 0x100>;
76+
interrupt-parent = <&intc1>;
77+
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
78+
status = "disabled";
79+
};
80+
81+
ohci: usb@128000 {
82+
compatible = "generic-ohci";
83+
reg = <0x128000 0x100>;
84+
interrupt-parent = <&intc1>;
85+
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
86+
status = "disabled";
87+
};
88+
};
89+
90+
&apb {
91+
watchdog: watchdog@1c060 {
92+
compatible = "loongson,ls1c-wdt";
93+
reg = <0x1c060 0xc>;
94+
clocks = <&clkc LS1X_CLKID_APB>;
95+
status = "disabled";
96+
};
97+
98+
rtc: rtc@24000 {
99+
compatible = "loongson,ls1c-rtc";
100+
reg = <0x24000 0x78>;
101+
status = "disabled";
102+
};
103+
104+
nand: nand-controller@38000 {
105+
compatible = "loongson,ls1c-nand-controller";
106+
reg = <0x38000 0x24>, <0x38040 0x4>;
107+
reg-names = "nand", "nand-dma";
108+
dmas = <&dma 0>;
109+
dma-names = "rxtx";
110+
#address-cells = <1>;
111+
#size-cells = <0>;
112+
status = "disabled";
113+
114+
nand@0 {
115+
reg = <0>;
116+
label = "ls1x-nand";
117+
nand-use-soft-ecc-engine;
118+
nand-ecc-algo = "hamming";
119+
};
120+
};
121+
};
122+
123+
&gpio0 {
124+
ngpios = <32>;
125+
};
126+
127+
&gpio1 {
128+
ngpios = <32>;
129+
};
130+
131+
&uart1 {
132+
interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
133+
};
134+
135+
&uart2 {
136+
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
137+
};
138+
139+
&uart3 {
140+
interrupts = <29 IRQ_TYPE_LEVEL_HIGH>;
141+
};
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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/gpio/gpio.h>
9+
10+
#include "loongson1c.dtsi"
11+
12+
/ {
13+
compatible = "loongmasses,smartloong-1c", "loongson,ls1c";
14+
model = "Smartloong-1C Board";
15+
16+
memory@0 {
17+
device_type = "memory";
18+
reg = <0x0 0x4000000>;
19+
};
20+
21+
aliases {
22+
gpio0 = &gpio0;
23+
gpio1 = &gpio1;
24+
gpio2 = &gpio2;
25+
gpio3 = &gpio3;
26+
serial0 = &uart2;
27+
};
28+
29+
chosen {
30+
stdout-path = "serial0:115200n8";
31+
};
32+
33+
leds {
34+
compatible = "gpio-leds";
35+
36+
led0 {
37+
label = "led0";
38+
gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
39+
linux,default-trigger = "heartbeat";
40+
};
41+
42+
led1 {
43+
label = "led1";
44+
gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
45+
linux,default-trigger = "nand-disk";
46+
};
47+
};
48+
};
49+
50+
&xtal {
51+
clock-frequency = <24000000>;
52+
};
53+
54+
&emac {
55+
phy-handle = <&phy0>;
56+
phy-mode = "rmii";
57+
status = "okay";
58+
59+
mdio {
60+
compatible = "snps,dwmac-mdio";
61+
#address-cells = <1>;
62+
#size-cells = <0>;
63+
64+
phy0: ethernet-phy@13 {
65+
reg = <0x13>;
66+
};
67+
};
68+
};
69+
70+
&nand {
71+
status = "okay";
72+
73+
nand@0 {
74+
partitions {
75+
compatible = "fixed-partitions";
76+
#address-cells = <1>;
77+
#size-cells = <1>;
78+
79+
partition@0 {
80+
label = "kernel";
81+
reg = <0x0 0x1000000>;
82+
};
83+
84+
partition@1000000 {
85+
label = "rootfs";
86+
reg = <0x1000000 0x7000000>;
87+
};
88+
};
89+
};
90+
};
91+
92+
&ehci {
93+
status = "okay";
94+
};
95+
96+
&ohci {
97+
status = "okay";
98+
};
99+
100+
&rtc {
101+
status = "okay";
102+
};
103+
104+
&uart2 {
105+
status = "okay";
106+
};
107+
108+
&watchdog {
109+
status = "okay";
110+
};

0 commit comments

Comments
 (0)