From: wjjsn <wjjsn@qq.com>
To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
chenhuacai@kernel.org
Cc: kernel@xen0n.name, devicetree@vger.kernel.org,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
wjjsn <2858482031@qq.com>
Subject: [PATCH v4 2/2] loongarch: boot: dts: Add Loongson-2K0300 support
Date: Sun, 22 Mar 2026 14:28:23 +0800 [thread overview]
Message-ID: <tencent_0C4E5C48A63E4C03BDE6A455032AA9B2CC0A@qq.com> (raw)
In-Reply-To: <20260322062823.1413724-1-wjjsn@qq.com>
From: wjjsn <2858482031@qq.com>
Signed-off-by: wjjsn <2858482031@qq.com>
---
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
prev parent reply other threads:[~2026-03-22 6:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260322062823.1413724-1-wjjsn@qq.com>
2026-03-22 6:28 ` [PATCH v4 1/2] dt-bindings: loongarch: Add Loongson-2K0300 wjjsn
2026-03-22 6:28 ` wjjsn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_0C4E5C48A63E4C03BDE6A455032AA9B2CC0A@qq.com \
--to=wjjsn@qq.com \
--cc=2858482031@qq.com \
--cc=chenhuacai@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@xen0n.name \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).