Re: [PATCH 2/3] riscv: dts: sophgo: add device tree for LicheeRV Nano

2024-11-27 Thread Thomas Bonnefille
On Mon Nov 25, 2024 at 10:59 AM CET, Leo Liang wrote:
> On Tue, Nov 19, 2024 at 09:35:32PM +0100, Thomas Bonnefille wrote:
> > [EXTERNAL MAIL]
> > 
> > On Mon Nov 18, 2024 at 11:01 AM CET, Leo Liang wrote:
> > > On Tue, Nov 12, 2024 at 03:57:37PM +0100, Thomas Bonnefille wrote:
> > > > [EXTERNAL MAIL]
> > > >
> > > > Import a slightly modified version of the LicheeRV Nano and SG2002
> > > > device trees from the Linux Kernel. The current supported IPs are UART,
> > > > MMC, Timer, PLIC and CLINT.
> > > >
> > > > Signed-off-by: Thomas Bonnefille 
> > > > ---
> > > >  arch/riscv/dts/Makefile   |  1 +
> > > >  arch/riscv/dts/sg2002-licheerv-nano-b.dts | 45 
> > > > +++
> > > >  arch/riscv/dts/sg2002.dtsi| 34 +++
> > > >  3 files changed, 80 insertions(+)
> > >
> > > Hi Thomas,
> > >
> > > Could we switch to use OF_UPSTREAM ?
> > >
> > 
> > Hello Leo,
> > 
> > Thank you for your review, I have a question though.
> > 
> > The LicheeRV Nano device tree isn't upstreamed yet. It's just in the
> > Sophgo SoC maintainer tree and should be merged in v6.13 so in ~10 weeks.
> > Can I keep it out of dts/upstream for the moment or should I merge it by
> > hand before ?
>
> Hi Thomas,
>
> Got it! So there should be a follow-up patch that 
> switch to OF_UPSTREAM once the upstream LicheeRV Nano DTS is settled, right?

Yes, of course, I'll do that when Linux 6.13 comes out.

>
> I can take this patch as is for now. Thanks!
>
> Best regards,
> Leo
Thank you very much !

Best regards, Thomas


Re: [PATCH 2/3] riscv: dts: sophgo: add device tree for LicheeRV Nano

2024-11-25 Thread Leo Liang
On Tue, Nov 19, 2024 at 09:35:32PM +0100, Thomas Bonnefille wrote:
> [EXTERNAL MAIL]
> 
> On Mon Nov 18, 2024 at 11:01 AM CET, Leo Liang wrote:
> > On Tue, Nov 12, 2024 at 03:57:37PM +0100, Thomas Bonnefille wrote:
> > > [EXTERNAL MAIL]
> > >
> > > Import a slightly modified version of the LicheeRV Nano and SG2002
> > > device trees from the Linux Kernel. The current supported IPs are UART,
> > > MMC, Timer, PLIC and CLINT.
> > >
> > > Signed-off-by: Thomas Bonnefille 
> > > ---
> > >  arch/riscv/dts/Makefile   |  1 +
> > >  arch/riscv/dts/sg2002-licheerv-nano-b.dts | 45 
> > > +++
> > >  arch/riscv/dts/sg2002.dtsi| 34 +++
> > >  3 files changed, 80 insertions(+)
> >
> > Hi Thomas,
> >
> > Could we switch to use OF_UPSTREAM ?
> >
> 
> Hello Leo,
> 
> Thank you for your review, I have a question though.
> 
> The LicheeRV Nano device tree isn't upstreamed yet. It's just in the
> Sophgo SoC maintainer tree and should be merged in v6.13 so in ~10 weeks.
> Can I keep it out of dts/upstream for the moment or should I merge it by
> hand before ?

Hi Thomas,

Got it! So there should be a follow-up patch that 
switch to OF_UPSTREAM once the upstream LicheeRV Nano DTS is settled, right?

I can take this patch as is for now. Thanks!

Best regards,
Leo


Re: [PATCH 2/3] riscv: dts: sophgo: add device tree for LicheeRV Nano

2024-11-19 Thread Thomas Bonnefille
On Mon Nov 18, 2024 at 11:01 AM CET, Leo Liang wrote:
> On Tue, Nov 12, 2024 at 03:57:37PM +0100, Thomas Bonnefille wrote:
> > [EXTERNAL MAIL]
> > 
> > Import a slightly modified version of the LicheeRV Nano and SG2002
> > device trees from the Linux Kernel. The current supported IPs are UART,
> > MMC, Timer, PLIC and CLINT.
> > 
> > Signed-off-by: Thomas Bonnefille 
> > ---
> >  arch/riscv/dts/Makefile   |  1 +
> >  arch/riscv/dts/sg2002-licheerv-nano-b.dts | 45 
> > +++
> >  arch/riscv/dts/sg2002.dtsi| 34 +++
> >  3 files changed, 80 insertions(+)
>
> Hi Thomas,
>
> Could we switch to use OF_UPSTREAM ?
>

Hello Leo,

Thank you for your review, I have a question though.

The LicheeRV Nano device tree isn't upstreamed yet. It's just in the
Sophgo SoC maintainer tree and should be merged in v6.13 so in ~10 weeks.
Can I keep it out of dts/upstream for the moment or should I merge it by
hand before ?


Re: [PATCH 2/3] riscv: dts: sophgo: add device tree for LicheeRV Nano

2024-11-18 Thread Leo Liang
On Tue, Nov 12, 2024 at 03:57:37PM +0100, Thomas Bonnefille wrote:
> [EXTERNAL MAIL]
> 
> Import a slightly modified version of the LicheeRV Nano and SG2002
> device trees from the Linux Kernel. The current supported IPs are UART,
> MMC, Timer, PLIC and CLINT.
> 
> Signed-off-by: Thomas Bonnefille 
> ---
>  arch/riscv/dts/Makefile   |  1 +
>  arch/riscv/dts/sg2002-licheerv-nano-b.dts | 45 
> +++
>  arch/riscv/dts/sg2002.dtsi| 34 +++
>  3 files changed, 80 insertions(+)

Hi Thomas,

Could we switch to use OF_UPSTREAM ?

Best regards,
Leo


[PATCH 2/3] riscv: dts: sophgo: add device tree for LicheeRV Nano

2024-11-12 Thread Thomas Bonnefille
Import a slightly modified version of the LicheeRV Nano and SG2002
device trees from the Linux Kernel. The current supported IPs are UART,
MMC, Timer, PLIC and CLINT.

Signed-off-by: Thomas Bonnefille 
---
 arch/riscv/dts/Makefile   |  1 +
 arch/riscv/dts/sg2002-licheerv-nano-b.dts | 45 +++
 arch/riscv/dts/sg2002.dtsi| 34 +++
 3 files changed, 80 insertions(+)

diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile
index 
17cda483e128996bb944f5a2b9b7676d32e45ae5..0848cded398d45955dcc17b339dc1869829c6467
 100644
--- a/arch/riscv/dts/Makefile
+++ b/arch/riscv/dts/Makefile
@@ -3,6 +3,7 @@
 dtb-$(CONFIG_TARGET_ANDES_AE350) += ae350_32.dtb ae350_64.dtb
 dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += mpfs-icicle-kit.dtb
 dtb-$(CONFIG_TARGET_MILKV_DUO) += cv1800b-milkv-duo.dtb
+dtb-$(CONFIG_TARGET_LICHEERV_NANO) += sg2002-licheerv-nano-b.dtb
 dtb-$(CONFIG_TARGET_QEMU_VIRT) += qemu-virt32.dtb qemu-virt64.dtb
 dtb-$(CONFIG_TARGET_OPENPITON_RISCV64) += openpiton-riscv64.dtb
 dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED) += hifive-unleashed-a00.dtb
diff --git a/arch/riscv/dts/sg2002-licheerv-nano-b.dts 
b/arch/riscv/dts/sg2002-licheerv-nano-b.dts
new file mode 100644
index 
..9871a75836c04a0b0943dc44c6a1090c90752dbd
--- /dev/null
+++ b/arch/riscv/dts/sg2002-licheerv-nano-b.dts
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Thomas Bonnefille 
+ */
+
+/dts-v1/;
+
+#include "sg2002.dtsi"
+
+/ {
+   model = "LicheeRV Nano B";
+   compatible = "sipeed,licheerv-nano-b", "sipeed,licheerv-nano", 
"sophgo,sg2002";
+
+   aliases {
+   gpio0 = &gpio0;
+   gpio1 = &gpio1;
+   gpio2 = &gpio2;
+   gpio3 = &gpio3;
+   serial0 = &uart0;
+   serial1 = &uart1;
+   serial2 = &uart2;
+   serial3 = &uart3;
+   serial4 = &uart4;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+};
+
+&osc {
+   clock-frequency = <2500>;
+};
+
+&sdhci0 {
+   status = "okay";
+   bus-width = <4>;
+   no-1-8-v;
+   no-mmc;
+   no-sdio;
+};
+
+&uart0 {
+   status = "okay";
+};
diff --git a/arch/riscv/dts/sg2002.dtsi b/arch/riscv/dts/sg2002.dtsi
new file mode 100644
index 
..0f97000fa8beaaa10a08d03211f7c4a0c2f6e001
--- /dev/null
+++ b/arch/riscv/dts/sg2002.dtsi
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Thomas Bonnefille 
+ */
+
+/dts-v1/;
+
+#include 
+#include "cv18xx.dtsi"
+
+/ {
+   compatible = "sophgo,sg2002";
+
+   memory@8000 {
+   device_type = "memory";
+   reg = <0x8000 0x1000>;
+   };
+};
+
+&plic {
+   compatible = "sophgo,sg2002-plic", "sophgo,cv1800b-plic", 
"thead,c900-plic";
+};
+
+&clint {
+   compatible = "sophgo,sg2002-plic", "sophgo,cv1800b-clint", 
"thead,c900-clint";
+};
+
+&clk {
+   compatible = "sophgo,sg2002-clk", "sophgo,cv1800-clk";
+};
+
+&sdhci0 {
+   compatible = "sophgo,sg2002-dwcmshc", "sophgo,cv1800b-dwcmshc";
+};

-- 
2.47.0