Skip to contentSkip to conversation

Initial support for CTCISZ Forever Pi

PATCH Superseded Yao Zi 4 participants 12 messages May 18, 2025 – May 19, 2025

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yao Zi

author
#0 lore raw

v2 cover Initial support for CTCISZ Forever Pi

This series adds support for CTCISZ Forever Pi, which ships an Loongson 2K0300 SoC and various peripherals. The vendor prefix and the board are documented and basic SoC/board devicetrees are added.

I've successfully booted into console with vendor U-Boot, a bootlog could be obtained here[1]. DTB and initramfs must be built into the kernel as the vendor bootloader cannot pass them and upstream U-Boot support for LoongArch is still WIP.

Thanks for your time and review.

[1]: https://gist.github.com/ziyao233/54ef900406876b5554f627d1ba0e130e

Changed from v1 ("Initial support for CTCISZ Ninenine Pi")
- Board binding:
- Use "Forever Pi" instead of "Ninenine Pi" as translation of the board model
- SoC devicetree:
- Move UART aliases to the board dt
- Add the missing space in definition of liointc0
- Link to v1: https://lore.kernel.org/all/[email protected]/

Yao Zi (4):
dt-bindings: vendor-prefixes: Add CTCISZ Technology Co., LTD.
dt-bindings: LoongArch: Add CTCISZ Forever Pi
LoongArch: dts: Add initial SoC devicetree for Loongson 2K0300
LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi

 .../bindings/loongarch/loongson.yaml          |   5 +
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/loongarch/boot/dts/Makefile              |   1 +
 arch/loongarch/boot/dts/loongson-2k0300.dtsi  | 184 ++++++++++++++++++
 .../boot/dts/ls2k0300-ctcisz-forever-pi.dts   |  45 +++++
 5 files changed, 237 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/loongson-2k0300.dtsi
 create mode 100644 arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
Signature · 1 line
2.49.0
author
#1 lore raw

PATCH v2 1/4 dt-bindings: vendor-prefixes: Add CTCISZ Technology Co., LTD.

CTCISZ Technology Co., LTD. is a company specializing in designing of embedded systems. Document the vendor prefix.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 86f6a19b28ae..02f35e583948 100644
@@ -344,6 +344,8 @@ patternProperties:
     description: Guangzhou China Star Optoelectronics Technology Co., Ltd
   "^csq,.*":
     description: Shenzen Chuangsiqi Technology Co.,Ltd.
+  "^ctcisz,.*":
+    description: CTCISZ Technology Co.,Ltd.
   "^ctera,.*":
     description: CTERA Networks Intl.
   "^ctu,.*":
Signature · 1 line
2.49.0
author
#2 lore raw

PATCH v2 2/4 dt-bindings: LoongArch: Add CTCISZ Forever Pi

In reply to Yao Zi

Forever Pi is an Loongson 2K0300-based development board produced by CTCISZ. Features include,

- 512MiB DDR4 RAM
- On-board eMMC storage
- Optional SD Card support
- 2 USB 2.0 Ports (OTG and HOST)
- 1 GbE Ethernet port
- Optional WiFi/BT support
- Audio output through 3.5mm phone connector
- Optional display output through RAW RGB interface

Add compatible string for the board.

---
 Documentation/devicetree/bindings/loongarch/loongson.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/loongarch/loongson.yaml +5 -0
index e1a4a97b7576..2479174ed454 100644
@@ -14,6 +14,11 @@ properties:
     const: '/'
   compatible:
     oneOf:
+      - description: CTCISZ Forever Pi
+        items:
+          - const: ctcisz,forever-pi
+          - const: loongson,ls2k0300
+
       - description: Loongson-2K0500 processor based boards
         items:
           - const: loongson,ls2k0500-ref
Signature · 1 line
2.49.0
author
#4 lore raw

PATCH v2 3/4 LoongArch: dts: Add initial SoC devicetree for Loongson 2K0300

In reply to Yao Zi

Add SoC devicetree for 2K0300 SoC, which features one LA264 dual-issue core and targets embedded market. Only CPU core, legacy interrupt controllers and UARTs are defined for now.

---
 arch/loongarch/boot/dts/loongson-2k0300.dtsi | 184 +++++++++++++++++++
 1 file changed, 184 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/loongson-2k0300.dtsi
arch/loongarch/boot/dts/loongson-2k0300.dtsi new file +184 -0
new file mode 100644
index 000000000000..17974f793947
@@ -0,0 +1,184 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Loongson Technology Corporation Limited
+ * Copyright (C) 2025 Yao Zi <[email protected]>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+	compatible = "loongson,ls2k0300";
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			compatible = "loongson,la264";
+			reg = <0>;
+			device_type = "cpu";
+			clocks = <&cpu_clk>;
+		};
+
+	};
+
+	cpuintc: interrupt-controller {
+		compatible = "loongson,cpu-interrupt-controller";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
+
+	cpu_clk: clock-1000m {
+		compatible = "fixed-clock";
+		clock-frequency = <1000000000>;
+		#clock-cells = <0>;
+	};
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges = <0x00 0x10000000 0x00 0x10000000 0x0 0x10000000>,
+			 <0x00 0x02000000 0x00 0x02000000 0x0 0x04000000>,
+			 <0x00 0x40000000 0x00 0x40000000 0x0 0x40000000>;
+
+		liointc0: interrupt-controller@16001400 {
+			compatible = "loongson,liointc-2.0";
+			reg = <0x0 0x16001400 0x0 0x40>,
+			      <0x0 0x16001040 0x0 0x8>;
+			reg-names = "main", "isr0";
+
+			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@16001440 {
+			compatible = "loongson,liointc-2.0";
+			reg = <0x0 0x16001440 0x0 0x40>,
+			      <0x0 0x16001048 0x0 0x8>;
+			reg-names = "main", "isr0";
+
+			interrupt-controller;
+			#interrupt-cells = <2>;
+
+			interrupt-parent = <&cpuintc>;
+			interrupts = <4>;
+			interrupt-names = "int2";
+
+			loongson,parent_int_map = <0x00000000>, /* int0 */
+						  <0x00000000>, /* int1 */
+						  <0xffffffff>, /* int2 */
+						  <0x00000000>; /* int3 */
+		};
+
+		uart0: serial@16100000 {
+			compatible = "ns16550a";
+			reg = <0 0x16100000 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart1: serial@16100400 {
+			compatible = "ns16550a";
+			reg = <0 0x16100400 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart2: serial@16100800 {
+			compatible = "ns16550a";
+			reg = <0 0x16100800 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart3: serial@16100c00 {
+			compatible = "ns16550a";
+			reg = <0 0x16100c00 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart4: serial@16101000 {
+			compatible = "ns16550a";
+			reg = <0 0x16101000 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart5: serial@16101400 {
+			compatible = "ns16550a";
+			reg = <0 0x16101400 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart6: serial@16101800 {
+			compatible = "ns16550a";
+			reg = <0 0x16101800 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart7: serial@16101c00 {
+			compatible = "ns16550a";
+			reg = <0 0x16101c00 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart8: serial@16102000 {
+			compatible = "ns16550a";
+			reg = <0 0x16102000 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		uart9: serial@16102400 {
+			compatible = "ns16550a";
+			reg = <0 0x16102400 0 0x10>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+			no-loopback-test;
+			status = "disabled";
+		};
+
+		isa@16400000 {
+			compatible = "isa";
+			#address-cells = <2>;
+			#size-cells = <1>;
+			ranges = <1 0x0 0x0 0x16400000 0x4000>;
+		};
+	};
+};
Signature · 1 line
2.49.0
#5 lore raw

Re: [PATCH v2 3/4] LoongArch: dts: Add initial SoC devicetree for Loongson 2K0300

Hi Yao:

Thanks for your patch.

Quoted 48 lines · Yao Zi

Add SoC devicetree for 2K0300 SoC, which features one LA264 dual-issue core and targets embedded market. Only CPU core, legacy interrupt controllers and UARTs are defined for now.

---
 arch/loongarch/boot/dts/loongson-2k0300.dtsi | 184 +++++++++++++++++++
 1 file changed, 184 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/loongson-2k0300.dtsi
arch/loongarch/boot/dts/loongson-2k0300.dtsi new file +31 -0
new file mode 100644
index 000000000000..17974f793947
@@ -0,0 +1,184 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Loongson Technology Corporation Limited
+ * Copyright (C) 2025 Yao Zi <[email protected]>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "loongson,ls2k0300";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       compatible = "loongson,la264";
+                       reg = <0>;
+                       device_type = "cpu";
+                       clocks = <&cpu_clk>;
+               };
+
+       };
+
+       cpuintc: interrupt-controller {
+               compatible = "loongson,cpu-interrupt-controller";
+               interrupt-controller;

arch/loongarch/boot/dts/loongson-2k0300.dtsi line 41

Quoted 10 lines
arch/loongarch/boot/dts/loongson-2k0300.dtsi new file +10 -0
+               #interrupt-cells = <1>;
+       };
+
+       cpu_clk: clock-1000m {
+               compatible = "fixed-clock";
+               clock-frequency = <1000000000>;
+               #clock-cells = <0>;
+       };
+
+       soc {

I found the following warning while doing dtbs_check, please check again:

DTC [C] arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dtb
arch/loongarch/boot/dts/loongson-2k0300.dtsi:41.6-183.4: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name

Quoted 147 lines
arch/loongarch/boot/dts/loongson-2k0300.dtsi new file +143 -1
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges = <0x00 0x10000000 0x00 0x10000000 0x0 0x10000000>,
+                        <0x00 0x02000000 0x00 0x02000000 0x0 0x04000000>,
+                        <0x00 0x40000000 0x00 0x40000000 0x0 0x40000000>;
+
+               liointc0: interrupt-controller@16001400 {
+                       compatible = "loongson,liointc-2.0";
+                       reg = <0x0 0x16001400 0x0 0x40>,
+                             <0x0 0x16001040 0x0 0x8>;
+                       reg-names = "main", "isr0";
+
+                       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@16001440 {
+                       compatible = "loongson,liointc-2.0";
+                       reg = <0x0 0x16001440 0x0 0x40>,
+                             <0x0 0x16001048 0x0 0x8>;
+                       reg-names = "main", "isr0";
+
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+
+                       interrupt-parent = <&cpuintc>;
+                       interrupts = <4>;
+                       interrupt-names = "int2";
+
+                       loongson,parent_int_map = <0x00000000>, /* int0 */
+                                                 <0x00000000>, /* int1 */
+                                                 <0xffffffff>, /* int2 */
+                                                 <0x00000000>; /* int3 */
+               };
+
+               uart0: serial@16100000 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16100000 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart1: serial@16100400 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16100400 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart2: serial@16100800 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16100800 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart3: serial@16100c00 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16100c00 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart4: serial@16101000 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16101000 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart5: serial@16101400 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16101400 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart6: serial@16101800 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16101800 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart7: serial@16101c00 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16101c00 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart8: serial@16102000 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16102000 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               uart9: serial@16102400 {
+                       compatible = "ns16550a";
+                       reg = <0 0x16102400 0 0x10>;
+                       interrupt-parent = <&liointc0>;
+                       interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+                       no-loopback-test;
+                       status = "disabled";
+               };
+
+               isa@16400000 {
+                       compatible = "isa";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       ranges = <1 0x0 0x0 0x16400000 0x4000>;
+               };
+       };
+};
--

2.49.0

Signature · 2 lines
Thanks.
Binbin
author
#6 lore raw

Re: [PATCH v2 3/4] LoongArch: dts: Add initial SoC devicetree for Loongson 2K0300

Quoted 65 lines · Binbin Zhou

Hi Yao:

Thanks for your patch.

Quoted 48 lines · Yao Zi

Add SoC devicetree for 2K0300 SoC, which features one LA264 dual-issue core and targets embedded market. Only CPU core, legacy interrupt controllers and UARTs are defined for now.

---
 arch/loongarch/boot/dts/loongson-2k0300.dtsi | 184 +++++++++++++++++++
 1 file changed, 184 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/loongson-2k0300.dtsi
arch/loongarch/boot/dts/loongson-2k0300.dtsi new file +31 -0
new file mode 100644
index 000000000000..17974f793947
@@ -0,0 +1,184 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Loongson Technology Corporation Limited
+ * Copyright (C) 2025 Yao Zi <[email protected]>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "loongson,ls2k0300";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       compatible = "loongson,la264";
+                       reg = <0>;
+                       device_type = "cpu";
+                       clocks = <&cpu_clk>;
+               };
+
+       };
+
+       cpuintc: interrupt-controller {
+               compatible = "loongson,cpu-interrupt-controller";
+               interrupt-controller;

arch/loongarch/boot/dts/loongson-2k0300.dtsi line 41

Quoted 10 lines
arch/loongarch/boot/dts/loongson-2k0300.dtsi new file +10 -0
+               #interrupt-cells = <1>;
+       };
+
+       cpu_clk: clock-1000m {
+               compatible = "fixed-clock";
+               clock-frequency = <1000000000>;
+               #clock-cells = <0>;
+       };
+
+       soc {

I found the following warning while doing dtbs_check, please check again:

Quoted 4 lines

DTC [C] arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dtb
arch/loongarch/boot/dts/loongson-2k0300.dtsi:41.6-183.4: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name

Oops, seems -Wunit_address_vs_reg is silent without W=1 specified. Commit 8654cb8d0371 (dtc: update warning settings for new bus and node/property name checks, 2017-03-21) shows it's a temporary workaround ("Disable the new dtc warnings by default as there are 1000s").

I'll the node to soc@10000000 in v3. Thanks for catching something I've never noticed before. Yanteng, is it okay for you to keep your reviewed-by tag with the change?

Quoted 7 lines
Quoted 7 lines
arch/loongarch/boot/dts/loongson-2k0300.dtsi new file +7 -0
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges = <0x00 0x10000000 0x00 0x10000000 0x0 0x10000000>,
+                        <0x00 0x02000000 0x00 0x02000000 0x0 0x04000000>,
+                        <0x00 0x40000000 0x00 0x40000000 0x0 0x40000000>;
+

...

Quoted 8 lines
Quoted 3 lines

2.49.0

Signature · 2 lines
Thanks.
Binbin

Thanks,
Yao Zi

author
#7 lore raw

PATCH v2 4/4 LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi

In reply to Yao Zi

Enable UART0 as it's the boot UART used by firmware.

---
 arch/loongarch/boot/dts/Makefile              |  1 +
 .../boot/dts/ls2k0300-ctcisz-forever-pi.dts   | 45 +++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
arch/loongarch/boot/dts/Makefile +1 -0
index 15d5e14fe418..9fff9e8be3de 100644
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 dtb-y = loongson-2k0500-ref.dtb loongson-2k1000-ref.dtb loongson-2k2000-ref.dtb
+dtb-y += ls2k0300-ctcisz-forever-pi.dtb
arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.49.0
#8 lore raw

Re: [PATCH v2 4/4] LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi

Hi Yao:

Quoted 7 lines · Yao Zi

Enable UART0 as it's the boot UART used by firmware.

---
 arch/loongarch/boot/dts/Makefile              |  1 +
 .../boot/dts/ls2k0300-ctcisz-forever-pi.dts   | 45 +++++++++++++++++++

A minor suggestion:
As we can see, the existing dtsi/dts files are prefixed with “loongosn-2k”, would it be possible to keep the filenames consistent?

Quoted 67 lines
 2 files changed, 46 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
arch/loongarch/boot/dts/Makefile +1 -0
index 15d5e14fe418..9fff9e8be3de 100644
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 dtb-y = loongson-2k0500-ref.dtb loongson-2k1000-ref.dtb loongson-2k2000-ref.dtb
+dtb-y += ls2k0300-ctcisz-forever-pi.dtb
arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts new file +45 -1
new file mode 100644
index 000000000000..a033c086461f
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Yao Zi <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "loongson-2k0300.dtsi"
+
+/ {
+       compatible = "ctcisz,forever-pi", "loongson,ls2k0300";
+       model = "CTCISZ Forever Pi";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@200000 {
+               device_type = "memory";
+               reg = <0 0x00200000 0 0x0ee00000>,
+                     <0 0x90000000 0 0x10000000>;
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               linux,cma {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0 0x02000000>;
+                       linux,cma-default;
+               };
+       };
+};
+
+&uart0 {
+       clock-frequency = <100000000>;
+       status = "okay";
+};
--

2.49.0

Signature · 2 lines
Thanks.
Binbin
author
#9 lore raw

Re: [PATCH v2 4/4] LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi

Quoted 6 lines · Binbin Zhou

Hi Yao:

Quoted 3 lines · Yao Zi

Enable UART0 as it's the boot UART used by firmware.

Quoted 8 lines
Quoted 4 lines
---
 arch/loongarch/boot/dts/Makefile              |  1 +
 .../boot/dts/ls2k0300-ctcisz-forever-pi.dts   | 45 +++++++++++++++++++

A minor suggestion:
As we can see, the existing dtsi/dts files are prefixed with “loongosn-2k”, would it be possible to keep the filenames consistent?

It's abbreviated since loongson-2k0300-ctcisz-forever-pi.dts seems a little too long for me, and naming devicetree files in form of <abbreviated-SoC-name>-<vendor>-<model> is common on other architectures.

I won't insist and will change it if you consider consistency really matters.

Quoted 2 lines
Quoted 2 lines
 2 files changed, 46 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts

...

Quoted 3 lines
Signature · 2 lines
Thanks.
Binbin

Best regards,
Yao Zi

#10 lore raw

Re: [PATCH v2 4/4] LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi

Quoted 13 lines · Yao Zi
Quoted 11 lines · Binbin Zhou

Hi Yao:

Quoted 7 lines · Yao Zi

Enable UART0 as it's the boot UART used by firmware.

---
 arch/loongarch/boot/dts/Makefile              |  1 +
 .../boot/dts/ls2k0300-ctcisz-forever-pi.dts   | 45 +++++++++++++++++++
Quoted 8 lines
Quoted 3 lines

A minor suggestion:
As we can see, the existing dtsi/dts files are prefixed with “loongosn-2k”, would it be possible to keep the filenames consistent?

It's abbreviated since loongson-2k0300-ctcisz-forever-pi.dts seems a little too long for me, and naming devicetree files in form of <abbreviated-SoC-name>-<vendor>-<model> is common on other architectures.

Sorry, the length of the filename is not really a major concern for me.

Quoted 3 lines

I won't insist and will change it if you consider consistency really matters.

Yes, I actually do mind, let's keep the naming consistent.

Quoted 12 lines
Quoted 3 lines
Quoted 3 lines
 2 files changed, 46 insertions(+)
 create mode 100644 arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts

...

Quoted 3 lines

--
Thanks.
Binbin

Best regards,
Yao Zi

Signature · 2 lines
Thanks.
Binbin
Reviewed-by on the v2 series
#11 lore raw
In reply to Yao Zi
Quoted 29 lines · Yao Zi

This series adds support for CTCISZ Forever Pi, which ships an Loongson 2K0300 SoC and various peripherals. The vendor prefix and the board are documented and basic SoC/board devicetrees are added.

I've successfully booted into console with vendor U-Boot, a bootlog could be obtained here[1]. DTB and initramfs must be built into the kernel as the vendor bootloader cannot pass them and upstream U-Boot support for LoongArch is still WIP.

Thanks for your time and review.

[1]: https://gist.github.com/ziyao233/54ef900406876b5554f627d1ba0e130e

Changed from v1 ("Initial support for CTCISZ Ninenine Pi")
- Board binding:
- Use "Forever Pi" instead of "Ninenine Pi" as translation of the board model
- SoC devicetree:
- Move UART aliases to the board dt
- Add the missing space in definition of liointc0
- Link to v1: https://lore.kernel.org/all/[email protected]/

Yao Zi (4):
dt-bindings: vendor-prefixes: Add CTCISZ Technology Co., LTD.
dt-bindings: LoongArch: Add CTCISZ Forever Pi
LoongArch: dts: Add initial SoC devicetree for Loongson 2K0300
LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi

Quoted 6 lines
  .../bindings/loongarch/loongson.yaml          |   5 +
  .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
  arch/loongarch/boot/dts/Makefile              |   1 +
  arch/loongarch/boot/dts/loongson-2k0300.dtsi  | 184 ++++++++++++++++++
  .../boot/dts/ls2k0300-ctcisz-forever-pi.dts   |  45 +++++
  5 files changed, 237 insertions(+)

For the patch sets.

Thanks,
Yanteng