Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
@@ -0,0 +1,17 @@
# SPDX-License-Identifier: GPL-2.0
ifneq ($(CONFIG_BUILTIN_DTB_NAME),)
dtb-y := $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME))
else
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64_2core_2k1000.dtb
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_4core_ls7a.dtb
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_4core_rs780e.dtb
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_8core_rs780e.dtb
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64g_4core_ls7a.dtb
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64v_4core_virtio.dtb
dtb-$(CONFIG_MACH_LOONGSON32) += cq-t300b.dtb
dtb-$(CONFIG_MACH_LOONGSON32) += ls1b-demo.dtb
dtb-$(CONFIG_MACH_LOONGSON32) += lsgz_1b_dev.dtb
dtb-$(CONFIG_MACH_LOONGSON32) += smartloong-1c.dtb
endif
@@ -0,0 +1,110 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
*/
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "loongson1c.dtsi"
/ {
compatible = "loongson,cq-t300b", "loongson,ls1c";
model = "CQ-T300B Board";
memory@0 {
device_type = "memory";
reg = <0x0 0x8000000>;
};
aliases {
gpio0 = &gpio0;
gpio1 = &gpio1;
gpio2 = &gpio2;
gpio3 = &gpio3;
serial0 = &uart2;
};
chosen {
stdout-path = "serial0:115200n8";
};
leds {
compatible = "gpio-leds";
led0 {
label = "led0";
gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
};
led1 {
label = "led1";
gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
linux,default-trigger = "nand-disk";
};
};
};
&xtal {
clock-frequency = <24000000>;
};
&emac {
phy-handle = <&phy0>;
phy-mode = "rmii";
status = "okay";
mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
phy0: ethernet-phy@13 {
reg = <0x13>;
};
};
};
&nand {
status = "okay";
nand@0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x1000000>;
};
partition@1000000 {
label = "rootfs";
reg = <0x1000000 0x3f000000>;
};
};
};
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&rtc {
status = "okay";
};
&uart2 {
status = "okay";
};
&watchdog {
status = "okay";
};
@@ -0,0 +1,136 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
*/
/dts-v1/;
#include <dt-bindings/clock/loongson,ls1x-clk.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
#address-cells = <1>;
#size-cells = <1>;
xtal: clock {
compatible = "fixed-clock";
clock-output-names = "xtal";
#clock-cells = <0>;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu0: cpu@0 {
reg = <0>;
device_type = "cpu";
clocks = <&clkc LS1X_CLKID_CPU>;
#clock-cells = <1>;
};
};
cpu_intc: interrupt-controller {
compatible = "mti,cpu-interrupt-controller";
interrupt-controller;
#interrupt-cells = <1>;
#address-cells = <0>;
};
soc: bus@1fd00000 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x1fd00000 0x130000>;
intc0: interrupt-controller@1040 {
compatible = "loongson,ls1x-intc";
reg = <0x1040 0x18>;
interrupt-controller;
interrupt-parent = <&cpu_intc>;
interrupts = <2>;
#interrupt-cells = <2>;
};
intc1: interrupt-controller@1058 {
compatible = "loongson,ls1x-intc";
reg = <0x1058 0x18>;
interrupt-controller;
interrupt-parent = <&cpu_intc>;
interrupts = <3>;
#interrupt-cells = <2>;
};
intc2: interrupt-controller@1070 {
compatible = "loongson,ls1x-intc";
reg = <0x1070 0x18>;
interrupt-controller;
interrupt-parent = <&cpu_intc>;
interrupts = <4>;
#interrupt-cells = <2>;
};
intc3: interrupt-controller@1088 {
compatible = "loongson,ls1x-intc";
reg = <0x1088 0x18>;
interrupt-controller;
interrupt-parent = <&cpu_intc>;
interrupts = <5>;
#interrupt-cells = <2>;
};
gpio0: gpio@10c0 {
compatible = "loongson,ls1x-gpio";
reg = <0x10c0 0x4>;
gpio-controller;
#gpio-cells = <2>;
};
gpio1: gpio@10c4 {
compatible = "loongson,ls1x-gpio";
reg = <0x10c4 0x4>;
gpio-controller;
#gpio-cells = <2>;
};
};
apb: bus@1fe40000 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x1fe40000 0xc0000>;
uart0: serial@0 {
compatible = "ns16550a";
reg = <0x0 0x8>;
clocks = <&clkc LS1X_CLKID_APB>;
interrupt-parent = <&intc0>;
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
uart1: serial@4000 {
compatible = "ns16550a";
reg = <0x4000 0x8>;
clocks = <&clkc LS1X_CLKID_APB>;
interrupt-parent = <&intc0>;
status = "disabled";
};
uart2: serial@8000 {
compatible = "ns16550a";
reg = <0x8000 0x8>;
clocks = <&clkc LS1X_CLKID_APB>;
interrupt-parent = <&intc0>;
status = "disabled";
};
uart3: serial@c000 {
compatible = "ns16550a";
reg = <0xc000 0x8>;
clocks = <&clkc LS1X_CLKID_APB>;
interrupt-parent = <&intc0>;
status = "disabled";
};
};
};
@@ -0,0 +1,198 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
*/
/dts-v1/;
#include "loongson1.dtsi"
/ {
cpu_opp_table: opp-table {
compatible = "operating-points-v2";
opp-shared;
opp-44000000 {
opp-hz = /bits/ 64 <44000000>;
};
opp-47142000 {
opp-hz = /bits/ 64 <47142000>;
};
opp-50769000 {
opp-hz = /bits/ 64 <50769000>;
};
opp-55000000 {
opp-hz = /bits/ 64 <55000000>;
};
opp-60000000 {
opp-hz = /bits/ 64 <60000000>;
};
opp-66000000 {
opp-hz = /bits/ 64 <66000000>;
};
opp-73333000 {
opp-hz = /bits/ 64 <73333000>;
};
opp-82500000 {
opp-hz = /bits/ 64 <82500000>;
};
opp-94285000 {
opp-hz = /bits/ 64 <94285000>;
};
opp-110000000 {
opp-hz = /bits/ 64 <110000000>;
};
opp-132000000 {
opp-hz = /bits/ 64 <132000000>;
};
opp-165000000 {
opp-hz = /bits/ 64 <165000000>;
};
opp-220000000 {
opp-hz = /bits/ 64 <220000000>;
};
};
clkc: clock-controller@1fe78030 {
compatible = "loongson,ls1b-clk";
reg = <0x1fe78030 0x8>;
clocks = <&xtal>;
#clock-cells = <1>;
};
};
&soc {
syscon: syscon@420 {
compatible = "loongson,ls1b-syscon", "syscon";
reg = <0x420 0x8>;
};
dma: dma-controller@1160 {
compatible = "loongson,ls1b-apbdma";
reg = <0x1160 0x4>;
interrupt-parent = <&intc0>;
interrupts = <13 IRQ_TYPE_EDGE_RISING>,
<14 IRQ_TYPE_EDGE_RISING>,
<15 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "ch0", "ch1", "ch2";
#dma-cells = <1>;
};
ehci: usb@100000 {
compatible = "generic-ehci";
reg = <0x100000 0x100>;
interrupt-parent = <&intc1>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
ohci: usb@108000 {
compatible = "generic-ohci";
reg = <0x108000 0x100>;
interrupt-parent = <&intc1>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
gmac0: ethernet@110000 {
compatible = "loongson,ls1b-gmac", "snps,dwmac-3.50a";
reg = <0x110000 0x10000>;
clocks = <&clkc LS1X_CLKID_AHB>;
clock-names = "stmmaceth";
interrupt-parent = <&intc1>;
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
loongson,ls1-syscon = <&syscon>;
snps,pbl = <1>;
status = "disabled";
};
gmac1: ethernet@120000 {
compatible = "loongson,ls1b-gmac", "snps,dwmac-3.50a";
reg = <0x120000 0x10000>;
clocks = <&clkc LS1X_CLKID_AHB>;
clock-names = "stmmaceth";
interrupt-parent = <&intc1>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
loongson,ls1-syscon = <&syscon>;
snps,pbl = <1>;
status = "disabled";
};
};
&apb {
clocksource: timer@1c030 {
compatible = "loongson,ls1b-pwmtimer";
reg = <0x1c030 0x10>;
clocks = <&clkc LS1X_CLKID_APB>;
interrupt-parent = <&intc0>;
interrupts = <20 IRQ_TYPE_LEVEL_HIGH>;
};
watchdog: watchdog@1c060 {
compatible = "loongson,ls1b-wdt";
reg = <0x1c060 0xc>;
clocks = <&clkc LS1X_CLKID_APB>;
status = "disabled";
};
rtc: rtc@24000 {
compatible = "loongson,ls1b-rtc";
reg = <0x24000 0x78>;
interrupt-parent = <&intc0>;
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
ac97: audio-controller@34000 {
compatible = "loongson,ls1b-ac97";
reg = <0x34000 0x60>, <0x32420 0x4>, <0x34c4c 0x4>;
reg-names = "ac97", "audio-tx", "audio-rx";
dmas = <&dma 1>, <&dma 2>;
dma-names = "tx", "rx";
#sound-dai-cells = <0>;
status = "disabled";
};
nand: nand-controller@38000 {
compatible = "loongson,ls1b-nand-controller";
reg = <0x38000 0x24>, <0x38040 0x4>;
reg-names = "nand", "nand-dma";
dmas = <&dma 0>;
dma-names = "rxtx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
nand@0 {
reg = <0>;
label = "ls1x-nand";
nand-use-soft-ecc-engine;
nand-ecc-algo = "hamming";
};
};
};
&cpu0 {
operating-points-v2 = <&cpu_opp_table>;
};
&gpio0 {
ngpios = <31>;
};
&gpio1 {
ngpios = <30>;
};
&uart1 {
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
};
&uart2 {
interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
};
&uart3 {
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
};
@@ -0,0 +1,141 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
*/
/dts-v1/;
#include "loongson1.dtsi"
/ {
clkc: clock-controller@1fe78030 {
compatible = "loongson,ls1c-clk";
reg = <0x1fe78030 0x8>;
clocks = <&xtal>;
#clock-cells = <1>;
};
};
&soc {
syscon: syscon@420 {
compatible = "loongson,ls1c-syscon", "syscon";
reg = <0x420 0x8>;
};
intc4: interrupt-controller@10a0 {
compatible = "loongson,ls1x-intc";
reg = <0x10a0 0x18>;
interrupt-controller;
interrupt-parent = <&cpu_intc>;
interrupts = <6>;
#interrupt-cells = <2>;
};
gpio2: gpio@10c8 {
compatible = "loongson,ls1x-gpio";
reg = <0x10c8 0x4>;
gpio-controller;
ngpios = <32>;
#gpio-cells = <2>;
};
gpio3: gpio@10cc {
compatible = "loongson,ls1x-gpio";
reg = <0x10cc 0x4>;
gpio-controller;
ngpios = <32>;
#gpio-cells = <2>;
};
dma: dma-controller@1160 {
compatible = "loongson,ls1c-apbdma", "loongson,ls1b-apbdma";
reg = <0x1160 0x4>;
interrupt-parent = <&intc0>;
interrupts = <13 IRQ_TYPE_EDGE_RISING>,
<14 IRQ_TYPE_EDGE_RISING>,
<15 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "ch0", "ch1", "ch2";
#dma-cells = <1>;
};
emac: ethernet@110000 {
compatible = "loongson,ls1c-emac", "snps,dwmac-3.50a";
reg = <0x110000 0x10000>;
clocks = <&clkc LS1X_CLKID_AHB>;
clock-names = "stmmaceth";
interrupt-parent = <&intc1>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
loongson,ls1-syscon = <&syscon>;
snps,pbl = <1>;
status = "disabled";
};
ehci: usb@120000 {
compatible = "generic-ehci";
reg = <0x120000 0x100>;
interrupt-parent = <&intc1>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
ohci: usb@128000 {
compatible = "generic-ohci";
reg = <0x128000 0x100>;
interrupt-parent = <&intc1>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
};
&apb {
watchdog: watchdog@1c060 {
compatible = "loongson,ls1c-wdt";
reg = <0x1c060 0xc>;
clocks = <&clkc LS1X_CLKID_APB>;
status = "disabled";
};
rtc: rtc@24000 {
compatible = "loongson,ls1c-rtc";
reg = <0x24000 0x78>;
status = "disabled";
};
nand: nand-controller@38000 {
compatible = "loongson,ls1c-nand-controller";
reg = <0x38000 0x24>, <0x38040 0x4>;
reg-names = "nand", "nand-dma";
dmas = <&dma 0>;
dma-names = "rxtx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
nand@0 {
reg = <0>;
label = "ls1x-nand";
nand-use-soft-ecc-engine;
nand-ecc-algo = "hamming";
};
};
};
&gpio0 {
ngpios = <32>;
};
&gpio1 {
ngpios = <32>;
};
&uart1 {
interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
};
&uart2 {
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
};
&uart3 {
interrupts = <29 IRQ_TYPE_LEVEL_HIGH>;
};
@@ -0,0 +1,324 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include <dt-bindings/interrupt-controller/irq.h>
/ {
compatible = "loongson,loongson2k1000";
#address-cells = <2>;
#size-cells = <2>;
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu0: cpu@0 {
device_type = "cpu";
compatible = "loongson,gs264";
reg = <0x0>;
#clock-cells = <1>;
clocks = <&cpu_clk>;
};
};
cpu_clk: cpu_clk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <800000000>;
};
cpuintc: interrupt-controller {
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
compatible = "mti,cpu-interrupt-controller";
};
package0: bus@10000000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <2>;
ranges = <0 0x10000000 0 0x10000000 0 0x10000000 /* ioports */
0 0x40000000 0 0x40000000 0 0x40000000
0xfe 0x00000000 0xfe 0x00000000 0 0x40000000>;
isa@18000000 {
compatible = "isa";
#size-cells = <1>;
#address-cells = <2>;
ranges = <1 0x0 0x0 0x18000000 0x4000>;
};
pm: reset-controller@1fe07000 {
compatible = "loongson,ls2k-pm";
reg = <0 0x1fe07000 0 0x422>;
};
liointc0: interrupt-controller@1fe11400 {
compatible = "loongson,liointc-2.0";
reg = <0 0x1fe11400 0 0x40>,
<0 0x1fe11040 0 0x8>,
<0 0x1fe11140 0 0x8>;
reg-names = "main", "isr0", "isr1";
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&cpuintc>;
interrupts = <2>;
interrupt-names = "int0";
loongson,parent_int_map = <0xffffffff>, /* int0 */
<0x00000000>, /* int1 */
<0x00000000>, /* int2 */
<0x00000000>; /* int3 */
};
liointc1: interrupt-controller@1fe11440 {
compatible = "loongson,liointc-2.0";
reg = <0 0x1fe11440 0 0x40>,
<0 0x1fe11048 0 0x8>,
<0 0x1fe11148 0 0x8>;
reg-names = "main", "isr0", "isr1";
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&cpuintc>;
interrupts = <3>;
interrupt-names = "int1";
loongson,parent_int_map = <0x00000000>, /* int0 */
<0xffffffff>, /* int1 */
<0x00000000>, /* int2 */
<0x00000000>; /* int3 */
};
rtc0: rtc@1fe07800 {
compatible = "loongson,ls2k1000-rtc";
reg = <0 0x1fe07800 0 0x78>;
interrupt-parent = <&liointc1>;
interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
};
uart0: serial@1fe00000 {
compatible = "ns16550a";
reg = <0 0x1fe00000 0 0x8>;
clock-frequency = <125000000>;
interrupt-parent = <&liointc0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
pci@1a000000 {
compatible = "loongson,ls2k-pci";
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
reg = <0 0x1a000000 0 0x02000000>,
<0xfe 0x00000000 0 0x20000000>;
ranges = <0x01000000 0x0 0x00000000 0x0 0x18000000 0x0 0x00010000>,
<0x02000000 0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>;
gmac@3,0 {
compatible = "pci0014,7a03.0",
"pci0014,7a03",
"pciclass0c0320",
"pciclass0c03";
reg = <0x1800 0x0 0x0 0x0 0x0>;
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
<13 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_lpi";
interrupt-parent = <&liointc0>;
phy-mode = "rgmii-id";
phy-handle = <&phy1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
phy0: ethernet-phy@0 {
reg = <0>;
};
};
};
gmac@3,1 {
compatible = "pci0014,7a03.0",
"pci0014,7a03",
"pciclass0c0320",
"pciclass0c03",
"loongson, pci-gmac";
reg = <0x1900 0x0 0x0 0x0 0x0>;
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
<15 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_lpi";
interrupt-parent = <&liointc0>;
phy-mode = "rgmii-id";
phy-handle = <&phy1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
phy1: ethernet-phy@1 {
reg = <0>;
};
};
};
ehci@4,1 {
compatible = "pci0014,7a14.0",
"pci0014,7a14",
"pciclass0c0320",
"pciclass0c03";
reg = <0x2100 0x0 0x0 0x0 0x0>;
interrupts = <18 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
};
ohci@4,2 {
compatible = "pci0014,7a24.0",
"pci0014,7a24",
"pciclass0c0310",
"pciclass0c03";
reg = <0x2200 0x0 0x0 0x0 0x0>;
interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
};
sata@8,0 {
compatible = "pci0014,7a08.0",
"pci0014,7a08",
"pciclass010601",
"pciclass0106";
reg = <0x4000 0x0 0x0 0x0 0x0>;
interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc0>;
};
pcie@9,0 {
compatible = "pci0014,7a19.0",
"pci0014,7a19",
"pciclass060400",
"pciclass0604";
reg = <0x4800 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &liointc1 0 IRQ_TYPE_LEVEL_HIGH>;
ranges;
external-facing;
};
pcie@a,0 {
compatible = "pci0014,7a09.0",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x5000 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &liointc1 1 IRQ_TYPE_LEVEL_HIGH>;
ranges;
external-facing;
};
pcie@b,0 {
compatible = "pci0014,7a09.0",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x5800 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &liointc1 2 IRQ_TYPE_LEVEL_HIGH>;
ranges;
external-facing;
};
pcie@c,0 {
compatible = "pci0014,7a09.0",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x6000 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &liointc1 3 IRQ_TYPE_LEVEL_HIGH>;
ranges;
external-facing;
};
pcie@d,0 {
compatible = "pci0014,7a19.0",
"pci0014,7a19",
"pciclass060400",
"pciclass0604";
reg = <0x6800 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &liointc1 4 IRQ_TYPE_LEVEL_HIGH>;
ranges;
external-facing;
};
pcie@e,0 {
compatible = "pci0014,7a09.0",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x7000 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &liointc1 5 IRQ_TYPE_LEVEL_HIGH>;
ranges;
external-facing;
};
};
};
};
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "loongson64-2k1000.dtsi"
/ {
compatible = "loongson,loongson64-2core-2k1000";
};
@@ -0,0 +1,64 @@
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/interrupt-controller/irq.h>
/ {
#address-cells = <2>;
#size-cells = <2>;
cpuintc: interrupt-controller {
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
compatible = "mti,cpu-interrupt-controller";
};
package0: bus@1fe00000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0x1fe00000 0 0x1fe00000 0x100000
0 0x3ff00000 0 0x3ff00000 0x100000
/* 3A HT Config Space */
0xefd 0xfb000000 0xefd 0xfb000000 0x10000000
/* 3B HT Config Space */
0x1efd 0xfb000000 0x1efd 0xfb000000 0x10000000>;
liointc: interrupt-controller@3ff01400 {
compatible = "loongson,liointc-1.0";
reg = <0 0x3ff01400 0x64>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&cpuintc>;
interrupts = <2>, <3>;
interrupt-names = "int0", "int1";
loongson,parent_int_map = <0xf0ffffff>, /* int0 */
<0x0f000000>, /* int1 */
<0x00000000>, /* int2 */
<0x00000000>; /* int3 */
};
cpu_uart0: serial@1fe001e0 {
compatible = "ns16550a";
reg = <0 0x1fe001e0 0x8>;
clock-frequency = <33000000>;
interrupt-parent = <&liointc>;
interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
cpu_uart1: serial@1fe001e8 {
status = "disabled";
compatible = "ns16550a";
reg = <0 0x1fe001e8 0x8>;
clock-frequency = <33000000>;
interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc>;
no-loopback-test;
};
};
};
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "loongson64c-package.dtsi"
#include "ls7a-pch.dtsi"
/ {
compatible = "loongson,loongson64c-4core-ls7a";
};
&package0 {
htvec: interrupt-controller@efdfb000080 {
compatible = "loongson,htvec-1.0";
reg = <0xefd 0xfb000080 0x40>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&liointc>;
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
<25 IRQ_TYPE_LEVEL_HIGH>,
<26 IRQ_TYPE_LEVEL_HIGH>,
<27 IRQ_TYPE_LEVEL_HIGH>;
};
};
&pch {
msi: msi-controller@2ff00000 {
compatible = "loongson,pch-msi-1.0";
reg = <0 0x2ff00000 0 0x8>;
interrupt-controller;
#interrupt-cells = <1>;
msi-controller;
loongson,msi-base-vec = <64>;
loongson,msi-num-vecs = <64>;
interrupt-parent = <&htvec>;
};
};
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "loongson64c-package.dtsi"
#include "rs780e-pch.dtsi"
/ {
compatible = "loongson,loongson64c-4core-rs780e";
};
&package0 {
htpic: interrupt-controller@efdfb000080 {
compatible = "loongson,htpic-1.0";
reg = <0xefd 0xfb000080 0x40>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&liointc>;
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
<25 IRQ_TYPE_LEVEL_HIGH>,
<26 IRQ_TYPE_LEVEL_HIGH>,
<27 IRQ_TYPE_LEVEL_HIGH>;
};
};
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "loongson64c-package.dtsi"
#include "rs780e-pch.dtsi"
/ {
compatible = "loongson,loongson64c-8core-rs780e";
};
&package0 {
htpic: interrupt-controller@1efdfb000080 {
compatible = "loongson,htpic-1.0";
reg = <0x1efd 0xfb000080 0x40>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&liointc>;
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
<25 IRQ_TYPE_LEVEL_HIGH>,
<26 IRQ_TYPE_LEVEL_HIGH>,
<27 IRQ_TYPE_LEVEL_HIGH>;
};
};
@@ -0,0 +1,61 @@
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/interrupt-controller/irq.h>
/ {
#address-cells = <2>;
#size-cells = <2>;
cpuintc: interrupt-controller {
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
compatible = "mti,cpu-interrupt-controller";
};
package0: bus@1fe00000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0x1fe00000 0 0x1fe00000 0x100000
0 0x3ff00000 0 0x3ff00000 0x100000
0xefd 0xfb000000 0xefd 0xfb000000 0x10000000>;
liointc: interrupt-controller@3ff01400 {
compatible = "loongson,liointc-1.0";
reg = <0 0x3ff01400 0x64>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&cpuintc>;
interrupts = <2>, <3>;
interrupt-names = "int0", "int1";
loongson,parent_int_map = <0x00ffffff>, /* int0 */
<0xff000000>, /* int1 */
<0x00000000>, /* int2 */
<0x00000000>; /* int3 */
};
cpu_uart0: serial@1fe00100 {
compatible = "loongson,ls3a4000-uart", "loongson,ls2k1500-uart", "ns16550a";
reg = <0 0x1fe00100 0x10>;
clock-frequency = <100000000>;
interrupt-parent = <&liointc>;
interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
cpu_uart1: serial@1fe00110 {
status = "disabled";
compatible = "loongson,ls3a4000-uart", "loongson,ls2k1500-uart", "ns16550a";
reg = <0 0x1fe00110 0x10>;
clock-frequency = <100000000>;
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc>;
no-loopback-test;
};
};
};
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "loongson64g-package.dtsi"
#include "ls7a-pch.dtsi"
/ {
compatible = "loongson,loongson64g-4core-ls7a";
};
&package0 {
htvec: interrupt-controller@efdfb000080 {
compatible = "loongson,htvec-1.0";
reg = <0xefd 0xfb000080 0x40>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&liointc>;
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
<25 IRQ_TYPE_LEVEL_HIGH>,
<26 IRQ_TYPE_LEVEL_HIGH>,
<27 IRQ_TYPE_LEVEL_HIGH>,
<28 IRQ_TYPE_LEVEL_HIGH>,
<29 IRQ_TYPE_LEVEL_HIGH>,
<30 IRQ_TYPE_LEVEL_HIGH>,
<31 IRQ_TYPE_LEVEL_HIGH>;
};
};
&pch {
msi: msi-controller@2ff00000 {
compatible = "loongson,pch-msi-1.0";
reg = <0 0x2ff00000 0 0x8>;
interrupt-controller;
#interrupt-cells = <1>;
msi-controller;
loongson,msi-base-vec = <64>;
loongson,msi-num-vecs = <192>;
interrupt-parent = <&htvec>;
};
};
@@ -0,0 +1,102 @@
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/interrupt-controller/irq.h>
/dts-v1/;
/ {
compatible = "loongson,loongson64v-4core-virtio";
#address-cells = <2>;
#size-cells = <2>;
cpuintc: interrupt-controller {
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
compatible = "mti,cpu-interrupt-controller";
};
package0: bus@1fe00000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0x1fe00000 0 0x1fe00000 0x100000
0 0x3ff00000 0 0x3ff00000 0x100000
0xefd 0xfb000000 0xefd 0xfb000000 0x10000000>;
liointc: interrupt-controller@3ff01400 {
compatible = "loongson,liointc-1.0";
reg = <0 0x3ff01400 0x64>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&cpuintc>;
interrupts = <2>, <3>;
interrupt-names = "int0", "int1";
loongson,parent_int_map = <0x00000001>, /* int0 */
<0xfffffffe>, /* int1 */
<0x00000000>, /* int2 */
<0x00000000>; /* int3 */
};
cpu_uart0: serial@1fe001e0 {
compatible = "ns16550a";
reg = <0 0x1fe001e0 0x8>;
clock-frequency = <33000000>;
interrupt-parent = <&liointc>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
};
bus@10000000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <2>;
ranges = <0 0x10000000 0 0x10000000 0 0x10000000 /* PIO & CONF & APB */
0 0x40000000 0 0x40000000 0 0x40000000>; /* PCI MEM */
rtc0: rtc@10081000 {
compatible = "google,goldfish-rtc";
reg = <0 0x10081000 0 0x1000>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&liointc>;
};
pci@1a000000 {
compatible = "pci-host-ecam-generic";
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
#interrupt-cells = <1>;
bus-range = <0x0 0x1f>;
reg = <0 0x1a000000 0 0x02000000>;
ranges = <0x01000000 0x0 0x00004000 0x0 0x18004000 0x0 0x0000c000>,
<0x02000000 0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>;
interrupt-map = <
0x0000 0x0 0x0 0x1 &liointc 0x2 IRQ_TYPE_LEVEL_HIGH
0x0800 0x0 0x0 0x1 &liointc 0x3 IRQ_TYPE_LEVEL_HIGH
0x1000 0x0 0x0 0x1 &liointc 0x4 IRQ_TYPE_LEVEL_HIGH
0x1800 0x0 0x0 0x1 &liointc 0x5 IRQ_TYPE_LEVEL_HIGH
>;
interrupt-map-mask = <0x1800 0x0 0x0 0x7>;
};
isa@18000000 {
compatible = "isa";
#address-cells = <2>;
#size-cells = <1>;
ranges = <1 0 0 0x18000000 0x4000>;
};
};
hypervisor {
compatible = "linux,kvm";
};
};
@@ -0,0 +1,125 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
*/
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "loongson1b.dtsi"
/ {
compatible = "loongson,ls1b-demo", "loongson,ls1b";
model = "LS1B-DEMO Board";
memory@0 {
device_type = "memory";
reg = <0x0 0x10000000>;
};
aliases {
ethernet0 = &gmac0;
ethernet1 = &gmac1;
gpio0 = &gpio0;
gpio1 = &gpio1;
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:38400n8";
};
codec: audio-codec {
compatible = "realtek,alc203";
#sound-dai-cells = <0>;
};
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "ls1b-alc203";
simple-audio-card,format = "ac97";
simple-audio-card,widgets =
"Speaker", "Line Out Jack",
"Headphone", "Headphone Jack",
"Microphone", "Microphone Jack";
simple-audio-card,routing =
"Line Out Jack", "TX",
"Headphone Jack", "TX",
"RX", "Microphone Jack";
simple-audio-card,cpu {
sound-dai = <&ac97>;
};
simple-audio-card,codec {
sound-dai = <&codec>;
};
};
};
&xtal {
clock-frequency = <33000000>;
};
&gmac0 {
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
status = "okay";
mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
phy0: ethernet-phy@0 {
reg = <0x0>;
};
};
};
&nand {
status = "okay";
nand@0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x1000000>;
};
partition@1000000 {
label = "rootfs";
reg = <0x1000000 0x7000000>;
};
};
};
};
&ac97 {
status = "okay";
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&rtc {
status = "okay";
};
&uart0 {
status = "okay";
};
&watchdog {
status = "okay";
};
@@ -0,0 +1,483 @@
// SPDX-License-Identifier: GPL-2.0
/ {
pch: bus@10000000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <2>;
ranges = <0 0x10000000 0 0x10000000 0 0x10000000 /* PIO & CONF & APB */
0 0x20000000 0 0x20000000 0 0x10000000
0 0x40000000 0 0x40000000 0 0x40000000 /* PCI MEM */
0xe00 0x00000000 0xe00 0x00000000 0x100 0x0000000>;
pic: interrupt-controller@10000000 {
compatible = "loongson,pch-pic-1.0";
reg = <0 0x10000000 0 0x400>;
interrupt-controller;
interrupt-parent = <&htvec>;
loongson,pic-base-vec = <0>;
#interrupt-cells = <2>;
};
lpc: interrupt-controller@10002000 {
compatible = "loongson,ls7a-lpc";
reg = <0 0x10002000 0 0x1000>;
interrupt-controller;
interrupt-parent = <&pic>;
interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
#interrupt-cells = <2>;
};
ls7a_uart0: serial@10080000 {
compatible = "ns16550a";
reg = <0 0x10080000 0 0x100>;
clock-frequency = <50000000>;
interrupt-parent = <&pic>;
interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
ls7a_uart1: serial@10080100 {
status = "disabled";
compatible = "ns16550a";
reg = <0 0x10080100 0 0x100>;
clock-frequency = <50000000>;
interrupt-parent = <&pic>;
interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
ls7a_uart2: serial@10080200 {
status = "disabled";
compatible = "ns16550a";
reg = <0 0x10080200 0 0x100>;
clock-frequency = <50000000>;
interrupt-parent = <&pic>;
interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
ls7a_uart3: serial@10080300 {
status = "disabled";
compatible = "ns16550a";
reg = <0 0x10080300 0 0x100>;
clock-frequency = <50000000>;
interrupt-parent = <&pic>;
interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
};
rtc0: rtc@100d0100 {
compatible = "loongson,ls7a-rtc";
reg = <0 0x100d0100 0 0x78>;
interrupt-parent = <&pic>;
interrupts = <52 IRQ_TYPE_LEVEL_HIGH>;
};
pci@1a000000 {
compatible = "loongson,ls7a-pci";
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
msi-parent = <&msi>;
reg = <0 0x1a000000 0 0x02000000>,
<0xefe 0x00000000 0 0x20000000>;
ranges = <0x01000000 0x0 0x00020000 0x0 0x18020000 0x0 0x00020000>,
<0x02000000 0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>;
ohci@4,0 {
compatible = "pci0014,7a24.0",
"pci0014,7a24",
"pciclass0c0310",
"pciclass0c03";
reg = <0x2000 0x0 0x0 0x0 0x0>;
interrupts = <49 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
ehci@4,1 {
compatible = "pci0014,7a14.0",
"pci0014,7a14",
"pciclass0c0320",
"pciclass0c03";
reg = <0x2100 0x0 0x0 0x0 0x0>;
interrupts = <48 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
ohci@5,0 {
compatible = "pci0014,7a24.0",
"pci0014,7a24",
"pciclass0c0310",
"pciclass0c03";
reg = <0x2800 0x0 0x0 0x0 0x0>;
interrupts = <51 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
ehci@5,1 {
compatible = "pci0014,7a14.0",
"pci0014,7a14",
"pciclass0c0320",
"pciclass0c03";
reg = <0x2900 0x0 0x0 0x0 0x0>;
interrupts = <50 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
sata@8,0 {
compatible = "pci0014,7a08.0",
"pci0014,7a08",
"pciclass010601",
"pciclass0106";
reg = <0x4000 0x0 0x0 0x0 0x0>;
interrupts = <16 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
sata@8,1 {
compatible = "pci0014,7a08.0",
"pci0014,7a08",
"pciclass010601",
"pciclass0106";
reg = <0x4100 0x0 0x0 0x0 0x0>;
interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
sata@8,2 {
compatible = "pci0014,7a08.0",
"pci0014,7a08",
"pciclass010601",
"pciclass0106";
reg = <0x4200 0x0 0x0 0x0 0x0>;
interrupts = <18 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
gpu@6,0 {
compatible = "pci0014,7a15.0",
"pci0014,7a15",
"pciclass030200",
"pciclass0302";
reg = <0x3000 0x0 0x0 0x0 0x0>;
interrupts = <29 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
dc@6,1 {
compatible = "pci0014,7a06.0",
"pci0014,7a06",
"pciclass030000",
"pciclass0300";
reg = <0x3100 0x0 0x0 0x0 0x0>;
interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
hda@7,0 {
compatible = "pci0014,7a07.0",
"pci0014,7a07",
"pciclass040300",
"pciclass0403";
reg = <0x3800 0x0 0x0 0x0 0x0>;
interrupts = <58 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
};
gmac@3,0 {
compatible = "pci0014,7a03.0",
"pci0014,7a03",
"pciclass020000",
"pciclass0200";
reg = <0x1800 0x0 0x0 0x0 0x0>;
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
<13 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_lpi";
interrupt-parent = <&pic>;
phy-mode = "rgmii-id";
phy-handle = <&phy0>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
phy0: ethernet-phy@0 {
reg = <0>;
};
};
};
gmac@3,1 {
compatible = "pci0014,7a03.0",
"pci0014,7a03",
"pciclass020000",
"pciclass0200",
"loongson, pci-gmac";
reg = <0x1900 0x0 0x0 0x0 0x0>;
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
<15 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_lpi";
interrupt-parent = <&pic>;
phy-mode = "rgmii-id";
phy-handle = <&phy1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
phy1: ethernet-phy@1 {
reg = <0>;
};
};
};
pcie@9,0 {
compatible = "pci0014,7a19.1",
"pci0014,7a19",
"pciclass060400",
"pciclass0604";
reg = <0x4800 0x0 0x0 0x0 0x0>;
interrupts = <32 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 32 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@a,0 {
compatible = "pci0014,7a09.1",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x5000 0x0 0x0 0x0 0x0>;
interrupts = <33 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 33 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@b,0 {
compatible = "pci0014,7a09.1",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x5800 0x0 0x0 0x0 0x0>;
interrupts = <34 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 34 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@c,0 {
compatible = "pci0014,7a09.1",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x6000 0x0 0x0 0x0 0x0>;
interrupts = <35 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 35 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@d,0 {
compatible = "pci0014,7a19.1",
"pci0014,7a19",
"pciclass060400",
"pciclass0604";
reg = <0x6800 0x0 0x0 0x0 0x0>;
interrupts = <36 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 36 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@e,0 {
compatible = "pci0014,7a09.1",
"pci0014,7a09",
"pciclass060400",
"pciclass0604";
reg = <0x7000 0x0 0x0 0x0 0x0>;
interrupts = <37 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 37 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@f,0 {
compatible = "pci0014,7a29.1",
"pci0014,7a29",
"pciclass060400",
"pciclass0604";
reg = <0x7800 0x0 0x0 0x0 0x0>;
interrupts = <40 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 40 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@10,0 {
compatible = "pci0014,7a19.1",
"pci0014,7a19",
"pciclass060400",
"pciclass0604";
reg = <0x8000 0x0 0x0 0x0 0x0>;
interrupts = <41 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 41 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@11,0 {
compatible = "pci0014,7a29.1",
"pci0014,7a29",
"pciclass060400",
"pciclass0604";
reg = <0x8800 0x0 0x0 0x0 0x0>;
interrupts = <42 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 42 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@12,0 {
compatible = "pci0014,7a19.1",
"pci0014,7a19",
"pciclass060400",
"pciclass0604";
reg = <0x9000 0x0 0x0 0x0 0x0>;
interrupts = <43 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 43 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@13,0 {
compatible = "pci0014,7a29.1",
"pci0014,7a29",
"pciclass060400",
"pciclass0604";
reg = <0x9800 0x0 0x0 0x0 0x0>;
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 38 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
pcie@14,0 {
compatible = "pci0014,7a19.1",
"pci0014,7a19",
"pciclass060400",
"pciclass0604";
reg = <0xa000 0x0 0x0 0x0 0x0>;
interrupts = <39 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &pic 39 IRQ_TYPE_LEVEL_HIGH>;
ranges;
};
};
isa@18000000 {
compatible = "isa";
#address-cells = <2>;
#size-cells = <1>;
ranges = <1 0 0 0x18000000 0x20000>;
};
};
};
@@ -0,0 +1,162 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
*/
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "loongson1b.dtsi"
/ {
compatible = "loongson,lsgz-1b-dev", "loongson,ls1b";
model = "LSGZ_1B_DEV Board";
memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};
aliases {
ethernet0 = &gmac0;
ethernet1 = &gmac1;
gpio0 = &gpio0;
gpio1 = &gpio1;
serial0 = &uart2;
serial1 = &uart3;
};
chosen {
stdout-path = "serial0:115200n8";
};
leds {
compatible = "gpio-leds";
led9 {
label = "led9";
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
};
led6 {
label = "led6";
gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
linux,default-trigger = "nand-disk";
};
};
codec: audio-codec {
compatible = "realtek,alc203";
#sound-dai-cells = <0>;
};
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "ls1b-alc655";
simple-audio-card,format = "ac97";
simple-audio-card,widgets =
"Speaker", "Line Out Jack",
"Line", "Line In Jack",
"Microphone", "Microphone Jack";
simple-audio-card,routing =
"Line Out Jack", "TX",
"RX", "Line In Jack",
"RX", "Microphone Jack";
simple-audio-card,cpu {
sound-dai = <&ac97>;
};
simple-audio-card,codec {
sound-dai = <&codec>;
};
};
};
&xtal {
clock-frequency = <33000000>;
};
&gmac0 {
phy-handle = <&phy0>;
phy-mode = "mii";
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
phy0: ethernet-phy@0 {
reg = <0x0>;
};
};
};
&gmac1 {
phy-handle = <&phy1>;
phy-mode = "mii";
status = "okay";
mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
phy1: ethernet-phy@0 {
reg = <0x0>;
};
};
};
&nand {
status = "okay";
nand@0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x1000000>;
};
partition@1000000 {
label = "rootfs";
reg = <0x1000000 0x7000000>;
};
};
};
};
&ac97 {
status = "okay";
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&rtc {
status = "okay";
};
&uart2 {
status = "okay";
};
&uart3 {
status = "okay";
};
&watchdog {
status = "okay";
};
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: GPL-2.0
/ {
bus@10000000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <2>;
ranges = <0 0x10000000 0 0x10000000 0 0x10000000
0 0x40000000 0 0x40000000 0 0x40000000
0xfd 0xfe000000 0xfd 0xfe000000 0 0x2000000 /* PCI Config Space */>;
pci@1a000000 {
compatible = "loongson,rs780e-pci";
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
reg = <0 0x1a000000 0 0x02000000>;
ranges = <0x01000000 0 0x00004000 0 0x18004000 0 0x0000c000>,
<0x02000000 0 0x40000000 0 0x40000000 0 0x40000000>;
};
isa@18000000 {
compatible = "isa";
#address-cells = <2>;
#size-cells = <1>;
ranges = <1 0 0 0x18000000 0x4000>;
rtc0: rtc@70 {
compatible = "motorola,mc146818";
reg = <1 0x70 0x8>;
interrupts = <8>;
interrupt-parent = <&htpic>;
};
acpi@800 {
compatible = "loongson,rs780e-acpi";
reg = <1 0x800 0x100>;
};
};
};
};
@@ -0,0 +1,110 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2023-2025 Keguang Zhang <keguang.zhang@gmail.com>
*/
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "loongson1c.dtsi"
/ {
compatible = "loongmasses,smartloong-1c", "loongson,ls1c";
model = "Smartloong-1C Board";
memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};
aliases {
gpio0 = &gpio0;
gpio1 = &gpio1;
gpio2 = &gpio2;
gpio3 = &gpio3;
serial0 = &uart2;
};
chosen {
stdout-path = "serial0:115200n8";
};
leds {
compatible = "gpio-leds";
led0 {
label = "led0";
gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
};
led1 {
label = "led1";
gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
linux,default-trigger = "nand-disk";
};
};
};
&xtal {
clock-frequency = <24000000>;
};
&emac {
phy-handle = <&phy0>;
phy-mode = "rmii";
status = "okay";
mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
phy0: ethernet-phy@13 {
reg = <0x13>;
};
};
};
&nand {
status = "okay";
nand@0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x1000000>;
};
partition@1000000 {
label = "rootfs";
reg = <0x1000000 0x7000000>;
};
};
};
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&rtc {
status = "okay";
};
&uart2 {
status = "okay";
};
&watchdog {
status = "okay";
};