diff mbox series

[v5,2/2] riscv: dts: sophgo: add initial Milk-V Duo S board support

Message ID 20240417065311.3881023-3-michael.opdenacker@bootlin.com (mailing list archive)
State Superseded
Headers show
Series add initial Milk-V Duo S board support | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-2-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-2-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-2-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-2-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-2-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-2-test-6 warning .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-2-test-7 fail .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-2-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-2-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-2-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-2-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-2-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Michael Opdenacker April 17, 2024, 6:53 a.m. UTC
From: Michael Opdenacker <michael.opdenacker@bootlin.com>

This adds initial support for the Milk-V Duo S board
(https://milkv.io/duo-s), enabling the serial port,
making it possible to boot Linux to the command line.

Link: https://lore.kernel.org/linux-riscv/171266958507.1032617.9460749136730849811.robh@kernel.org/T/#t

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
---
 arch/riscv/boot/dts/sophgo/Makefile           |  1 +
 .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 34 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts

Comments

Inochi Amaoto April 17, 2024, 9:34 a.m. UTC | #1
On Wed, Apr 17, 2024 at 08:53:11AM GMT, michael.opdenacker@bootlin.com wrote:
> From: Michael Opdenacker <michael.opdenacker@bootlin.com>
> 
> This adds initial support for the Milk-V Duo S board
> (https://milkv.io/duo-s), enabling the serial port,
> making it possible to boot Linux to the command line.
> 
> Link: https://lore.kernel.org/linux-riscv/171266958507.1032617.9460749136730849811.robh@kernel.org/T/#t
> 
> Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
> ---
>  arch/riscv/boot/dts/sophgo/Makefile           |  1 +
>  .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 34 +++++++++++++++++++
>  2 files changed, 35 insertions(+)
>  create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> 
> diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> index 57ad82a61ea6..e008acb5240f 100644
> --- a/arch/riscv/boot/dts/sophgo/Makefile
> +++ b/arch/riscv/boot/dts/sophgo/Makefile
> @@ -1,4 +1,5 @@
>  # SPDX-License-Identifier: GPL-2.0
>  dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
>  dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
> +dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duos.dtb
>  dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
> diff --git a/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> new file mode 100644
> index 000000000000..c1ecf97d5e93
> --- /dev/null
> +++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> @@ -0,0 +1,34 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "cv1812h.dtsi"
> +
> +/ {
> +	model = "Milk-V Duo S";
> +	compatible = "milkv,duos", "sophgo,cv1812h";
> +
> +	aliases {
> +		serial0 = &uart0;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	memory@80000000 {
> +		device_type = "memory";
> +		reg = <0x80000000 0x20000000>;
> +	};

Add a cpu specific file, and move this to it.

> +};
> +
> +&osc {
> +	clock-frequency = <25000000>;
> +};
> +
> +&uart0 {
> +	status = "okay";
> +};
> -- 
> 2.34.1
> 

Add necessary DT node in the cpu specific file. (clint, 
plic and clk). You also need to rebase your patch based
on sophgo/for-next.
Conor Dooley April 17, 2024, 3:06 p.m. UTC | #2
On Wed, Apr 17, 2024 at 05:34:44PM +0800, Inochi Amaoto wrote:
> On Wed, Apr 17, 2024 at 08:53:11AM GMT, michael.opdenacker@bootlin.com wrote:
> > From: Michael Opdenacker <michael.opdenacker@bootlin.com>
> > 
> > This adds initial support for the Milk-V Duo S board
> > (https://milkv.io/duo-s), enabling the serial port,
> > making it possible to boot Linux to the command line.
> > 
> > Link: https://lore.kernel.org/linux-riscv/171266958507.1032617.9460749136730849811.robh@kernel.org/T/#t
> > 
> > Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
> > ---
> >  arch/riscv/boot/dts/sophgo/Makefile           |  1 +
> >  .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 34 +++++++++++++++++++
> >  2 files changed, 35 insertions(+)
> >  create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > 
> > diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> > index 57ad82a61ea6..e008acb5240f 100644
> > --- a/arch/riscv/boot/dts/sophgo/Makefile
> > +++ b/arch/riscv/boot/dts/sophgo/Makefile
> > @@ -1,4 +1,5 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >  dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
> >  dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
> > +dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duos.dtb
> >  dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
> > diff --git a/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > new file mode 100644
> > index 000000000000..c1ecf97d5e93
> > --- /dev/null
> > +++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > @@ -0,0 +1,34 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "cv1812h.dtsi"
> > +
> > +/ {
> > +	model = "Milk-V Duo S";
> > +	compatible = "milkv,duos", "sophgo,cv1812h";
> > +
> > +	aliases {
> > +		serial0 = &uart0;
> > +	};
> > +
> > +	chosen {
> > +		stdout-path = "serial0:115200n8";
> > +	};
> > +
> > +	memory@80000000 {
> > +		device_type = "memory";
> > +		reg = <0x80000000 0x20000000>;
> > +	};
> 
> Add a cpu specific file, and move this to it.

I take it that the memory is integrated into the package then?
Inochi Amaoto April 17, 2024, 10:29 p.m. UTC | #3
On Wed, Apr 17, 2024 at 04:06:29PM GMT, Conor Dooley wrote:
> On Wed, Apr 17, 2024 at 05:34:44PM +0800, Inochi Amaoto wrote:
> > On Wed, Apr 17, 2024 at 08:53:11AM GMT, michael.opdenacker@bootlin.com wrote:
> > > From: Michael Opdenacker <michael.opdenacker@bootlin.com>
> > > 
> > > This adds initial support for the Milk-V Duo S board
> > > (https://milkv.io/duo-s), enabling the serial port,
> > > making it possible to boot Linux to the command line.
> > > 
> > > Link: https://lore.kernel.org/linux-riscv/171266958507.1032617.9460749136730849811.robh@kernel.org/T/#t
> > > 
> > > Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
> > > ---
> > >  arch/riscv/boot/dts/sophgo/Makefile           |  1 +
> > >  .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 34 +++++++++++++++++++
> > >  2 files changed, 35 insertions(+)
> > >  create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > > 
> > > diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> > > index 57ad82a61ea6..e008acb5240f 100644
> > > --- a/arch/riscv/boot/dts/sophgo/Makefile
> > > +++ b/arch/riscv/boot/dts/sophgo/Makefile
> > > @@ -1,4 +1,5 @@
> > >  # SPDX-License-Identifier: GPL-2.0
> > >  dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
> > >  dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
> > > +dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duos.dtb
> > >  dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
> > > diff --git a/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > > new file mode 100644
> > > index 000000000000..c1ecf97d5e93
> > > --- /dev/null
> > > +++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > > @@ -0,0 +1,34 @@
> > > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > > +/*
> > > + * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
> > > + */
> > > +
> > > +/dts-v1/;
> > > +
> > > +#include "cv1812h.dtsi"
> > > +
> > > +/ {
> > > +	model = "Milk-V Duo S";
> > > +	compatible = "milkv,duos", "sophgo,cv1812h";
> > > +
> > > +	aliases {
> > > +		serial0 = &uart0;
> > > +	};
> > > +
> > > +	chosen {
> > > +		stdout-path = "serial0:115200n8";
> > > +	};
> > > +
> > > +	memory@80000000 {
> > > +		device_type = "memory";
> > > +		reg = <0x80000000 0x20000000>;
> > > +	};
> > 
> > Add a cpu specific file, and move this to it.
> 
> I take it that the memory is integrated into the package then?

Yes, of course.
Michael Opdenacker April 21, 2024, 5:57 a.m. UTC | #4
Hi Inochi

Thanks for your advice!

On 4/17/24 at 11:34, Inochi Amaoto wrote:
> On Wed, Apr 17, 2024 at 08:53:11AM GMT, michael.opdenacker@bootlin.com wrote:
>> From: Michael Opdenacker <michael.opdenacker@bootlin.com>
>>
>> This adds initial support for the Milk-V Duo S board
>> (https://milkv.io/duo-s), enabling the serial port,
>> making it possible to boot Linux to the command line.
>>
>> Link: https://lore.kernel.org/linux-riscv/171266958507.1032617.9460749136730849811.robh@kernel.org/T/#t
>>
>> Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
>> ---
>>   arch/riscv/boot/dts/sophgo/Makefile           |  1 +
>>   .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 34 +++++++++++++++++++
>>   2 files changed, 35 insertions(+)
>>   create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
>>
>> diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
>> index 57ad82a61ea6..e008acb5240f 100644
>> --- a/arch/riscv/boot/dts/sophgo/Makefile
>> +++ b/arch/riscv/boot/dts/sophgo/Makefile
>> @@ -1,4 +1,5 @@
>>   # SPDX-License-Identifier: GPL-2.0
>>   dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
>>   dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
>> +dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duos.dtb
>>   dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
>> diff --git a/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
>> new file mode 100644
>> index 000000000000..c1ecf97d5e93
>> --- /dev/null
>> +++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
>> @@ -0,0 +1,34 @@
>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
>> +/*
>> + * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include "cv1812h.dtsi"
>> +
>> +/ {
>> +	model = "Milk-V Duo S";
>> +	compatible = "milkv,duos", "sophgo,cv1812h";
>> +
>> +	aliases {
>> +		serial0 = &uart0;
>> +	};
>> +
>> +	chosen {
>> +		stdout-path = "serial0:115200n8";
>> +	};
>> +
>> +	memory@80000000 {
>> +		device_type = "memory";
>> +		reg = <0x80000000 0x20000000>;
>> +	};
> Add a cpu specific file, and move this to it.

Now that I'm including "cv1812h.dtsi", which has the same structure, all 
I need is to change the reg setting to have 512 MB of RAM instead of 
256MB, right? See the V6 I'm sending soon.

>
>> +};
>> +
>> +&osc {
>> +	clock-frequency = <25000000>;
>> +};
>> +
>> +&uart0 {
>> +	status = "okay";
>> +};
>> -- 
>> 2.34.1
>>
> Add necessary DT node in the cpu specific file. (clint,
> plic and clk). You also need to rebase your patch based
> on sophgo/for-next.

Same here, cv1812h.dtsi already configures &clint, &plic and &clk, so it 
seems to me I don't need to make changes again here. At least the board 
boots fine for me as it is.
Cheers
Michael.
Inochi Amaoto April 21, 2024, 6:30 a.m. UTC | #5
On Sun, Apr 21, 2024 at 07:57:01AM GMT, Michael Opdenacker wrote:
> Hi Inochi
> 
> Thanks for your advice!
> 
> On 4/17/24 at 11:34, Inochi Amaoto wrote:
> > On Wed, Apr 17, 2024 at 08:53:11AM GMT, michael.opdenacker@bootlin.com wrote:
> > > From: Michael Opdenacker <michael.opdenacker@bootlin.com>
> > > 
> > > This adds initial support for the Milk-V Duo S board
> > > (https://milkv.io/duo-s), enabling the serial port,
> > > making it possible to boot Linux to the command line.
> > > 
> > > Link: https://lore.kernel.org/linux-riscv/171266958507.1032617.9460749136730849811.robh@kernel.org/T/#t
> > > 
> > > Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
> > > ---
> > >   arch/riscv/boot/dts/sophgo/Makefile           |  1 +
> > >   .../boot/dts/sophgo/sg2000-milkv-duos.dts     | 34 +++++++++++++++++++
> > >   2 files changed, 35 insertions(+)
> > >   create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > > 
> > > diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
> > > index 57ad82a61ea6..e008acb5240f 100644
> > > --- a/arch/riscv/boot/dts/sophgo/Makefile
> > > +++ b/arch/riscv/boot/dts/sophgo/Makefile
> > > @@ -1,4 +1,5 @@
> > >   # SPDX-License-Identifier: GPL-2.0
> > >   dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
> > >   dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
> > > +dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duos.dtb
> > >   dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
> > > diff --git a/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > > new file mode 100644
> > > index 000000000000..c1ecf97d5e93
> > > --- /dev/null
> > > +++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > > @@ -0,0 +1,34 @@
> > > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > > +/*
> > > + * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
> > > + */
> > > +
> > > +/dts-v1/;
> > > +
> > > +#include "cv1812h.dtsi"
> > > +
> > > +/ {
> > > +	model = "Milk-V Duo S";
> > > +	compatible = "milkv,duos", "sophgo,cv1812h";
> > > +
> > > +	aliases {
> > > +		serial0 = &uart0;
> > > +	};
> > > +
> > > +	chosen {
> > > +		stdout-path = "serial0:115200n8";
> > > +	};
> > > +
> > > +	memory@80000000 {
> > > +		device_type = "memory";
> > > +		reg = <0x80000000 0x20000000>;
> > > +	};
> > Add a cpu specific file, and move this to it.
> 
> Now that I'm including "cv1812h.dtsi", which has the same structure, all I
> need is to change the reg setting to have 512 MB of RAM instead of 256MB,
> right? See the V6 I'm sending soon.
> 

No, Duo S does not use cv1812h, in any means. I just told you to use
cv1812h for local test. If you want to upstream Duo S, you must add 
the right cpu compatibles and necessary nodes. These two are different
things.

> > 
> > > +};
> > > +
> > > +&osc {
> > > +	clock-frequency = <25000000>;
> > > +};
> > > +
> > > +&uart0 {
> > > +	status = "okay";
> > > +};
> > > -- 
> > > 2.34.1
> > > 
> > Add necessary DT node in the cpu specific file. (clint,
> > plic and clk). You also need to rebase your patch based
> > on sophgo/for-next.
> 
> Same here, cv1812h.dtsi already configures &clint, &plic and &clk, so it
> seems to me I don't need to make changes again here. At least the board
> boots fine for me as it is.
> Cheers
> Michael.
> 
> 
> -- 
> 
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
Michael Opdenacker April 23, 2024, 6:11 a.m. UTC | #6
Hi Inochi,

Thanks for the advice.

On 4/21/24 at 08:30, Inochi Amaoto wrote:
> On Sun, Apr 21, 2024 at 07:57:01AM GMT, Michael Opdenacker wrote:
> +++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> @@ -0,0 +1,34 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "cv1812h.dtsi"
> +
> +/ {
> +	model = "Milk-V Duo S";
> +	compatible = "milkv,duos", "sophgo,cv1812h";
> +
> +	aliases {
> +		serial0 = &uart0;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	memory@80000000 {
> +		device_type = "memory";
> +		reg = <0x80000000 0x20000000>;
> +	};
>>> Add a cpu specific file, and move this to it.
>> Now that I'm including "cv1812h.dtsi", which has the same structure, all I
>> need is to change the reg setting to have 512 MB of RAM instead of 256MB,
>> right? See the V6 I'm sending soon.
>>
> No, Duo S does not use cv1812h, in any means. I just told you to use
> cv1812h for local test. If you want to upstream Duo S, you must add
> the right cpu compatibles and necessary nodes. These two are different
> things.

So, do you mean I should create a new "sophgo,sg2000" compatible, 
together with  a new "sg2000.dtsi" (or "sg200x.dtsi"?) file? Could this 
file include "cv18xx.dtsi"?

By the way, where's the best source of information about the Sophgo 
sg2000 and sg2002 processors? Even the Sophgo website doesn't seem to 
have them :-/ . It just mentions the CV18xx ones.

Thanks again
Cheers
Michael.
Thomas Bonnefille April 23, 2024, 7:57 a.m. UTC | #7
Hello Michael,

> By the way, where's the best source of information about the Sophgo 
> sg2000 and sg2002 processors? Even the Sophgo website doesn't seem to 
> have them :-/ . It just mentions the CV18xx ones.

The best source of information I found for the Sophgo SG2002 and SG200 
is this Github repository from Sophgo :
https://github.com/sophgo/sophgo-doc
It contains the Technical Reference Manual for the Sophgo SG2000, SG2002 
and SG2042.
Inochi Amaoto April 23, 2024, 8:24 a.m. UTC | #8
On Tue, Apr 23, 2024 at 08:11:29AM GMT, Michael Opdenacker wrote:
> Hi Inochi,
> 
> Thanks for the advice.
> 
> On 4/21/24 at 08:30, Inochi Amaoto wrote:
> > On Sun, Apr 21, 2024 at 07:57:01AM GMT, Michael Opdenacker wrote:
> > +++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
> > @@ -0,0 +1,34 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "cv1812h.dtsi"
> > +
> > +/ {
> > +	model = "Milk-V Duo S";
> > +	compatible = "milkv,duos", "sophgo,cv1812h";
> > +
> > +	aliases {
> > +		serial0 = &uart0;
> > +	};
> > +
> > +	chosen {
> > +		stdout-path = "serial0:115200n8";
> > +	};
> > +
> > +	memory@80000000 {
> > +		device_type = "memory";
> > +		reg = <0x80000000 0x20000000>;
> > +	};
> > > > Add a cpu specific file, and move this to it.
> > > Now that I'm including "cv1812h.dtsi", which has the same structure, all I
> > > need is to change the reg setting to have 512 MB of RAM instead of 256MB,
> > > right? See the V6 I'm sending soon.
> > > 
> > No, Duo S does not use cv1812h, in any means. I just told you to use
> > cv1812h for local test. If you want to upstream Duo S, you must add
> > the right cpu compatibles and necessary nodes. These two are different
> > things.
> 
> So, do you mean I should create a new "sophgo,sg2000" compatible, together
> with  a new "sg2000.dtsi" (or "sg200x.dtsi"?) file? Could this file include
> "cv18xx.dtsi"?
> 

Right. For the second question, it must. "cv18xx.dtsi" is the common file
for the whole series. You can check the existed cpu file in sophgo upstream 
repository: https://github.com/sophgo/linux/tree/for-next.

> By the way, where's the best source of information about the Sophgo sg2000
> and sg2002 processors? Even the Sophgo website doesn't seem to have them :-/
> . It just mentions the CV18xx ones.
> 

In additional to the doc mentioned by Thomas, I think you may need to
check Duo docs from milkv: https://github.com/milkv-duo/duo-files. It
contains all you need for Duo S.

> Thanks again
> Cheers
> Michael.
> 
> -- 
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
diff mbox series

Patch

diff --git a/arch/riscv/boot/dts/sophgo/Makefile b/arch/riscv/boot/dts/sophgo/Makefile
index 57ad82a61ea6..e008acb5240f 100644
--- a/arch/riscv/boot/dts/sophgo/Makefile
+++ b/arch/riscv/boot/dts/sophgo/Makefile
@@ -1,4 +1,5 @@ 
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
+dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duos.dtb
 dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
diff --git a/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
new file mode 100644
index 000000000000..c1ecf97d5e93
--- /dev/null
+++ b/arch/riscv/boot/dts/sophgo/sg2000-milkv-duos.dts
@@ -0,0 +1,34 @@ 
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Michael Opdenacker <michael.opdenacker@bootlin.com>
+ */
+
+/dts-v1/;
+
+#include "cv1812h.dtsi"
+
+/ {
+	model = "Milk-V Duo S";
+	compatible = "milkv,duos", "sophgo,cv1812h";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x20000000>;
+	};
+};
+
+&osc {
+	clock-frequency = <25000000>;
+};
+
+&uart0 {
+	status = "okay";
+};