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

Yao Zi posted 4 patches 7 months ago
There is a newer version of this series
[PATCH v2 4/4] LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi
Posted by Yao Zi 7 months ago
Enable UART0 as it's the boot UART used by firmware.

Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 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

diff --git a/arch/loongarch/boot/dts/Makefile b/arch/loongarch/boot/dts/Makefile
index 15d5e14fe418..9fff9e8be3de 100644
--- a/arch/loongarch/boot/dts/Makefile
+++ b/arch/loongarch/boot/dts/Makefile
@@ -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
diff --git a/arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts b/arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
new file mode 100644
index 000000000000..a033c086461f
--- /dev/null
+++ b/arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Yao Zi <ziyao@disroot.org>
+ */
+
+/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
Re: [PATCH v2 4/4] LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi
Posted by Binbin Zhou 7 months ago
Hi Yao:

On Sun, May 18, 2025 at 4:05 PM Yao Zi <ziyao@disroot.org> wrote:
>
> Enable UART0 as it's the boot UART used by firmware.
>
> Signed-off-by: Yao Zi <ziyao@disroot.org>
> ---
>  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?

>  2 files changed, 46 insertions(+)
>  create mode 100644 arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
>
> diff --git a/arch/loongarch/boot/dts/Makefile b/arch/loongarch/boot/dts/Makefile
> index 15d5e14fe418..9fff9e8be3de 100644
> --- a/arch/loongarch/boot/dts/Makefile
> +++ b/arch/loongarch/boot/dts/Makefile
> @@ -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
> diff --git a/arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts b/arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
> new file mode 100644
> index 000000000000..a033c086461f
> --- /dev/null
> +++ b/arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
> @@ -0,0 +1,45 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2025 Yao Zi <ziyao@disroot.org>
> + */
> +
> +/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
>
>

-- 
Thanks.
Binbin
Re: [PATCH v2 4/4] LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi
Posted by Yao Zi 7 months ago
On Mon, May 19, 2025 at 03:58:29PM +0800, Binbin Zhou wrote:
> Hi Yao:
> 
> On Sun, May 18, 2025 at 4:05 PM Yao Zi <ziyao@disroot.org> wrote:
> >
> > Enable UART0 as it's the boot UART used by firmware.
> >
> > Signed-off-by: Yao Zi <ziyao@disroot.org>
> > ---
> >  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.

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

...

> -- 
> Thanks.
> Binbin

Best regards,
Yao Zi
Re: [PATCH v2 4/4] LoongArch: dts: Add initial devicetree for CTCISZ Forever Pi
Posted by Binbin Zhou 7 months ago
On Mon, May 19, 2025 at 5:43 PM Yao Zi <ziyao@disroot.org> wrote:
>
> On Mon, May 19, 2025 at 03:58:29PM +0800, Binbin Zhou wrote:
> > Hi Yao:
> >
> > On Sun, May 18, 2025 at 4:05 PM Yao Zi <ziyao@disroot.org> wrote:
> > >
> > > Enable UART0 as it's the boot UART used by firmware.
> > >
> > > Signed-off-by: Yao Zi <ziyao@disroot.org>
> > > ---
> > >  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.

Sorry, the length of the filename is not really a major concern for me.
>
> 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.
>
> > >  2 files changed, 46 insertions(+)
> > >  create mode 100644 arch/loongarch/boot/dts/ls2k0300-ctcisz-forever-pi.dts
>
> ...
>
> > --
> > Thanks.
> > Binbin
>
> Best regards,
> Yao Zi

-- 
Thanks.
Binbin