[PATCH v2 2/2] loongarch: boot: dts: Add Loongson-2K0300 support

From: wjjsn

Date: Sun Mar 22 2026 - 01:51:13 EST


Signed-off-by: wjjsn <wjjsn@xxxxxx>
---
arch/loongarch/boot/dts/Makefile | 2 +-
.../boot/dts/loongson-2k0300-ref.dts | 34 +++++++
arch/loongarch/boot/dts/loongson-2k0300.dtsi | 95 +++++++++++++++++++
3 files changed, 130 insertions(+), 1 deletion(-)
create mode 100644 arch/loongarch/boot/dts/loongson-2k0300-ref.dts
create mode 100644 arch/loongarch/boot/dts/loongson-2k0300.dtsi

diff --git a/arch/loongarch/boot/dts/Makefile b/arch/loongarch/boot/dts/Makefile
index 15d5e14fe418..4a096608cfad 100644
--- a/arch/loongarch/boot/dts/Makefile
+++ b/arch/loongarch/boot/dts/Makefile
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only

-dtb-y = loongson-2k0500-ref.dtb loongson-2k1000-ref.dtb loongson-2k2000-ref.dtb
+dtb-y = loongson-2k0300-ref.dtb loongson-2k0500-ref.dtb loongson-2k1000-ref.dtb loongson-2k2000-ref.dtb
diff --git a/arch/loongarch/boot/dts/loongson-2k0300-ref.dts b/arch/loongarch/boot/dts/loongson-2k0300-ref.dts
new file mode 100644
index 000000000000..f85d2caa94b0
--- /dev/null
+++ b/arch/loongarch/boot/dts/loongson-2k0300-ref.dts
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2023 Loongson Technology Corporation Limited
+ */
+
+/dts-v1/;
+
+#include "loongson-2k0300.dtsi"
+
+/ {
+ compatible = "loongson,ls2k0300-ref", "loongson,ls2k0300";
+ model = "Loongson-2K0300 Reference Board";
+
+ aliases {
+ serial0 = &uart0;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ memory@200000 {
+ device_type = "memory";
+ reg = <0x0 0x00200000 0x0 0x0ee00000>,
+ <0x0 0x90000000 0x0 0x10000000>;
+ };
+
+};
+
+
+&uart0 {
+ status = "okay";
+};
+
diff --git a/arch/loongarch/boot/dts/loongson-2k0300.dtsi b/arch/loongarch/boot/dts/loongson-2k0300.dtsi
new file mode 100644
index 000000000000..91062b388e77
--- /dev/null
+++ b/arch/loongarch/boot/dts/loongson-2k0300.dtsi
@@ -0,0 +1,95 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2023 Loongson Technology Corporation Limited
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/clock/loongson,ls2k-clk.h>
+
+/ {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ interrupt-parent = <&cpuintc>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu0: cpu@0 {
+ compatible = "loongson,la264";
+ device_type = "cpu";
+ reg = <0x0>;
+ clocks = <&clk LS2K0300_CLK_NODE_DIV>;
+ };
+ };
+
+ ref_120m: clock-ref-120m {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <120000000>;
+ clock-output-names = "ref_120m";
+ };
+
+ cpuintc: interrupt-controller {
+ compatible = "loongson,cpu-interrupt-controller";
+ #interrupt-cells = <1>;
+ interrupt-controller;
+ };
+
+ liointc0: interrupt-controller@16001400 {
+ compatible = "loongson,liointc-2.0";
+ reg = <0x0 0x16001400 0x0 0x40>,
+ <0x0 0x16001040 0x0 0x8>;
+ reg-names = "main", "isr0";
+
+ interrupt-controller;
+ #address-cells = <0>;
+ #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@16001440 {
+ compatible = "loongson,liointc-2.0";
+ reg = <0x0 0x16001440 0x0 0x40>,
+ <0x0 0x16001048 0x0 0x8>;
+ reg-names = "main", "isr0";
+
+ interrupt-controller;
+ #address-cells = <0>;
+ #interrupt-cells = <2>;
+ interrupt-parent = <&cpuintc>;
+ interrupts = <4>;
+ interrupt-names = "int2";
+
+ loongson,parent_int_map = <0x00000000>, /* int0 */
+ <0x00000000>, /* int1 */
+ <0xffffffff>, /* int2 */
+ <0x00000000>; /* int3 */
+ };
+ clk: clock-controller@16000400 {
+ compatible = "loongson,ls2k0300-clk";
+ reg = <0x0 0x16000400 0x0 0x2c>;
+ #clock-cells = <1>;
+ clocks = <&ref_120m>;
+ clock-names = "ref_120m";
+ };
+
+ uart0: serial@16100000 {
+ compatible = "ns16550a";
+ reg = <0x0 0x16100000 0x0 0x10>;
+ clocks = <&clk LS2K0300_CLK_APB_GATE>;
+ interrupt-parent = <&liointc0>;
+ interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+ no-loopback-test;
+ status = "disabled";
+ };
+};
--
2.43.0