Message ID | 20250209220646.1090868-1-alexander.sverdlin@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | arm64 support for Milk-V Duo Module 01 EVB | expand |
On 2025/2/10 6:06, Alexander Sverdlin wrote: > This series adds very basic support for Milk-V Duo Module 01 EVB [1] in > arm64 mode. The SoC (SG2000) is dual-arch, RiscV and ARM64, the latter has > been chosen because the upstream toolchain can be utilized. > > Sophgo SG2000 seems to be a continuation of the Cvitek CV18xx series, same > peripherals with an addition of ARM64 core. Therefore it would be > beneficial not to copy-paste the peripherals' device-tree, but rather split > the most suitable riscv DT into ARCH-specific and peripherals parts and > just include the latter on the arm64 side. > > This series adds the device-tree for Milk-V Duo Module 01 EVB, which > in turn contains Milk-V Duo Module 01 (separate .dtsi) on it, which has > SG2000 SoC inside (separate .dtsi). > > This series has been tested with Sophgo-provided U-Boot binary [2]: it > boots from SD card, pinctrl, serial, GPIO drivers are functional (same > as for RiscV-based CV18xx SoCs). > New reset driver is provided as an alternative to the ATF PSCI handler, > which Sophgo only provides in binary form. I just see Inochi posted a patchset about cv18xx reset driver [1]. FYI. Maybe you and Inochi need to communicate with each other and synchronize the related work in this regard. Link: https://lore.kernel.org/linux-riscv/20250209122936.2338821-1-inochiama@gmail.com/ [1] > > Partial SoC documentation is available [3]. > > This series lacks the support of: > - USB > - Audio > - Ethernet > - WiFi > - Bluetooth > - eMMC > - Video > > It would probably make sense that the whole series would go into SOC tree, > even though technically nothing prevents the reboot/reset driver to come > in PM/reset tree. If everything would come together, `reboot` command would > work out of the box. > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > > Alexander Sverdlin (10): > arm64: Add SOPHGO SOC family Kconfig support > riscv: dts: sophgo: cv18xx: Split into CPU core and peripheral parts > arm64: dts: sophgo: Add initial SG2000 SoC device tree > arm64: dts: sophgo: Add Duo Module 01 > arm64: dts: sophgo: Add Duo Module 01 Evaluation Board > dt-bindings: mfd: syscon: Add Cvitek CV18xx rtcsys core and ctrl > compatible > dt-bindings: reset: sophgo: Add CV18xx reset controller > riscv/arm64: dts: cv18xx: Add sysctl and reset nodes > power: reset: cv18xx: New driver > arm64: defconfig: Enable rudimentary Sophgo SG2000 support > > .../devicetree/bindings/mfd/syscon.yaml | 4 + > .../bindings/reset/sophgo,cv1800-reset.yaml | 38 ++ > MAINTAINERS | 1 + > arch/arm64/Kconfig.platforms | 12 + > arch/arm64/boot/dts/Makefile | 1 + > arch/arm64/boot/dts/sophgo/Makefile | 2 + > arch/arm64/boot/dts/sophgo/sg2000.dtsi | 79 +++++ > .../sophgo/sg2000_milkv_duo_module_01.dtsi | 84 +++++ > .../sophgo/sg2000_milkv_duo_module_01_evb.dts | 30 ++ > arch/arm64/configs/defconfig | 3 + > arch/riscv/boot/dts/sophgo/cv181x.dtsi | 2 +- > arch/riscv/boot/dts/sophgo/cv18xx-periph.dtsi | 329 ++++++++++++++++++ > arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 305 +--------------- > drivers/power/reset/Kconfig | 12 + > drivers/power/reset/Makefile | 1 + > drivers/power/reset/cv18xx-reset.c | 89 +++++ > 16 files changed, 689 insertions(+), 303 deletions(-) > create mode 100644 Documentation/devicetree/bindings/reset/sophgo,cv1800-reset.yaml > create mode 100644 arch/arm64/boot/dts/sophgo/Makefile > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000.dtsi > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01.dtsi > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dts > create mode 100644 arch/riscv/boot/dts/sophgo/cv18xx-periph.dtsi > create mode 100644 drivers/power/reset/cv18xx-reset.c >
On Mon, Feb 10, 2025 at 08:02:12AM +0800, Chen Wang wrote: > > On 2025/2/10 6:06, Alexander Sverdlin wrote: > > This series adds very basic support for Milk-V Duo Module 01 EVB [1] in > > arm64 mode. The SoC (SG2000) is dual-arch, RiscV and ARM64, the latter has > > been chosen because the upstream toolchain can be utilized. > > > > Sophgo SG2000 seems to be a continuation of the Cvitek CV18xx series, same > > peripherals with an addition of ARM64 core. Therefore it would be > > beneficial not to copy-paste the peripherals' device-tree, but rather split > > the most suitable riscv DT into ARCH-specific and peripherals parts and > > just include the latter on the arm64 side. > > > > This series adds the device-tree for Milk-V Duo Module 01 EVB, which > > in turn contains Milk-V Duo Module 01 (separate .dtsi) on it, which has > > SG2000 SoC inside (separate .dtsi). > > > > This series has been tested with Sophgo-provided U-Boot binary [2]: it > > boots from SD card, pinctrl, serial, GPIO drivers are functional (same > > as for RiscV-based CV18xx SoCs). > > New reset driver is provided as an alternative to the ATF PSCI handler, > > which Sophgo only provides in binary form. > > I just see Inochi posted a patchset about cv18xx reset driver [1]. FYI. > > Maybe you and Inochi need to communicate with each other and synchronize the > related work in this regard. > > Link: https://lore.kernel.org/linux-riscv/20250209122936.2338821-1-inochiama@gmail.com/ > [1] > It is a power restart device, not the reset controller, I suggests you change the device name. > > > > Partial SoC documentation is available [3]. > > > > This series lacks the support of: > > - USB > > - Audio > > - Ethernet > > - WiFi > > - Bluetooth > > - eMMC > > - Video > > > > It would probably make sense that the whole series would go into SOC tree, > > even though technically nothing prevents the reboot/reset driver to come > > in PM/reset tree. If everything would come together, `reboot` command would > > work out of the box. > > > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > > > > Alexander Sverdlin (10): > > arm64: Add SOPHGO SOC family Kconfig support > > riscv: dts: sophgo: cv18xx: Split into CPU core and peripheral parts > > arm64: dts: sophgo: Add initial SG2000 SoC device tree > > arm64: dts: sophgo: Add Duo Module 01 > > arm64: dts: sophgo: Add Duo Module 01 Evaluation Board > > dt-bindings: mfd: syscon: Add Cvitek CV18xx rtcsys core and ctrl > > compatible > > dt-bindings: reset: sophgo: Add CV18xx reset controller > > riscv/arm64: dts: cv18xx: Add sysctl and reset nodes > > power: reset: cv18xx: New driver > > arm64: defconfig: Enable rudimentary Sophgo SG2000 support > > > > .../devicetree/bindings/mfd/syscon.yaml | 4 + > > .../bindings/reset/sophgo,cv1800-reset.yaml | 38 ++ > > MAINTAINERS | 1 + > > arch/arm64/Kconfig.platforms | 12 + > > arch/arm64/boot/dts/Makefile | 1 + > > arch/arm64/boot/dts/sophgo/Makefile | 2 + > > arch/arm64/boot/dts/sophgo/sg2000.dtsi | 79 +++++ > > .../sophgo/sg2000_milkv_duo_module_01.dtsi | 84 +++++ > > .../sophgo/sg2000_milkv_duo_module_01_evb.dts | 30 ++ > > arch/arm64/configs/defconfig | 3 + > > arch/riscv/boot/dts/sophgo/cv181x.dtsi | 2 +- > > arch/riscv/boot/dts/sophgo/cv18xx-periph.dtsi | 329 ++++++++++++++++++ > > arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 305 +--------------- > > drivers/power/reset/Kconfig | 12 + > > drivers/power/reset/Makefile | 1 + > > drivers/power/reset/cv18xx-reset.c | 89 +++++ > > 16 files changed, 689 insertions(+), 303 deletions(-) > > create mode 100644 Documentation/devicetree/bindings/reset/sophgo,cv1800-reset.yaml > > create mode 100644 arch/arm64/boot/dts/sophgo/Makefile > > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000.dtsi > > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01.dtsi > > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dts > > create mode 100644 arch/riscv/boot/dts/sophgo/cv18xx-periph.dtsi > > create mode 100644 drivers/power/reset/cv18xx-reset.c > >
> It would probably make sense that the whole series would go into SOC tree, > even though technically nothing prevents the reboot/reset driver to come > in PM/reset tree. If everything would come together, `reboot` command would > work out of the box. > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > This reboot implentment across the RTC and 8051 domain, which is still a big problem to be upstreamed. This should be designed carefully and needs further discussion. Adding these two syscon compatiable may be not a good idea and cause some problem. I invite Yixun to this talk and he may give some useful suggestions. At last, I prefer this goes to an separate patch series, and implement with rtc device. Regards, Inochi
Thanks for quick feedback Inochi! On Mon, 2025-02-10 at 13:33 +0800, Inochi Amaoto wrote: > > It would probably make sense that the whole series would go into SOC tree, > > even though technically nothing prevents the reboot/reset driver to come > > in PM/reset tree. If everything would come together, `reboot` command would > > work out of the box. > > > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > > > > This reboot implentment across the RTC and 8051 domain, which is > still a big problem to be upstreamed. This should be designed Could you please elaborate on the "big problem"? Does the binary-distributed ATF perform some other type of reset in WARM case? (COLD is just mirorred based on TRM). > carefully and needs further discussion. Adding these two syscon > compatiable may be not a good idea and cause some problem. I invite > Yixun to this talk and he may give some useful suggestions. > > At last, I prefer this goes to an separate patch series, and > implement with rtc device. Sure, I can split the reboot story from the series...
On Sun, 09 Feb 2025 23:06:25 +0100, Alexander Sverdlin wrote: > This series adds very basic support for Milk-V Duo Module 01 EVB [1] in > arm64 mode. The SoC (SG2000) is dual-arch, RiscV and ARM64, the latter has > been chosen because the upstream toolchain can be utilized. > > Sophgo SG2000 seems to be a continuation of the Cvitek CV18xx series, same > peripherals with an addition of ARM64 core. Therefore it would be > beneficial not to copy-paste the peripherals' device-tree, but rather split > the most suitable riscv DT into ARCH-specific and peripherals parts and > just include the latter on the arm64 side. > > This series adds the device-tree for Milk-V Duo Module 01 EVB, which > in turn contains Milk-V Duo Module 01 (separate .dtsi) on it, which has > SG2000 SoC inside (separate .dtsi). > > This series has been tested with Sophgo-provided U-Boot binary [2]: it > boots from SD card, pinctrl, serial, GPIO drivers are functional (same > as for RiscV-based CV18xx SoCs). > New reset driver is provided as an alternative to the ATF PSCI handler, > which Sophgo only provides in binary form. > > Partial SoC documentation is available [3]. > > This series lacks the support of: > - USB > - Audio > - Ethernet > - WiFi > - Bluetooth > - eMMC > - Video > > It would probably make sense that the whole series would go into SOC tree, > even though technically nothing prevents the reboot/reset driver to come > in PM/reset tree. If everything would come together, `reboot` command would > work out of the box. > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > > Alexander Sverdlin (10): > arm64: Add SOPHGO SOC family Kconfig support > riscv: dts: sophgo: cv18xx: Split into CPU core and peripheral parts > arm64: dts: sophgo: Add initial SG2000 SoC device tree > arm64: dts: sophgo: Add Duo Module 01 > arm64: dts: sophgo: Add Duo Module 01 Evaluation Board > dt-bindings: mfd: syscon: Add Cvitek CV18xx rtcsys core and ctrl > compatible > dt-bindings: reset: sophgo: Add CV18xx reset controller > riscv/arm64: dts: cv18xx: Add sysctl and reset nodes > power: reset: cv18xx: New driver > arm64: defconfig: Enable rudimentary Sophgo SG2000 support > > .../devicetree/bindings/mfd/syscon.yaml | 4 + > .../bindings/reset/sophgo,cv1800-reset.yaml | 38 ++ > MAINTAINERS | 1 + > arch/arm64/Kconfig.platforms | 12 + > arch/arm64/boot/dts/Makefile | 1 + > arch/arm64/boot/dts/sophgo/Makefile | 2 + > arch/arm64/boot/dts/sophgo/sg2000.dtsi | 79 +++++ > .../sophgo/sg2000_milkv_duo_module_01.dtsi | 84 +++++ > .../sophgo/sg2000_milkv_duo_module_01_evb.dts | 30 ++ > arch/arm64/configs/defconfig | 3 + > arch/riscv/boot/dts/sophgo/cv181x.dtsi | 2 +- > arch/riscv/boot/dts/sophgo/cv18xx-periph.dtsi | 329 ++++++++++++++++++ > arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 305 +--------------- > drivers/power/reset/Kconfig | 12 + > drivers/power/reset/Makefile | 1 + > drivers/power/reset/cv18xx-reset.c | 89 +++++ > 16 files changed, 689 insertions(+), 303 deletions(-) > create mode 100644 Documentation/devicetree/bindings/reset/sophgo,cv1800-reset.yaml > create mode 100644 arch/arm64/boot/dts/sophgo/Makefile > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000.dtsi > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01.dtsi > create mode 100644 arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dts > create mode 100644 arch/riscv/boot/dts/sophgo/cv18xx-periph.dtsi > create mode 100644 drivers/power/reset/cv18xx-reset.c > > -- > 2.48.1 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/sophgo/' for 20250209220646.1090868-1-alexander.sverdlin@gmail.com: arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dtb: /: failed to match any schema with compatible: ['sophgo,sg2000'] arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dtb: soc: soc-reset: 'ranges' is a required property from schema $id: http://devicetree.org/schemas/simple-bus.yaml# arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dtb: l2-cache: 'cache-unified' is a dependency of 'cache-size' from schema $id: http://devicetree.org/schemas/cache.yaml# arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dtb: l2-cache: 'cache-unified' is a required property from schema $id: http://devicetree.org/schemas/cache.yaml# arch/arm64/boot/dts/sophgo/sg2000_milkv_duo_module_01_evb.dtb: l2-cache: Unevaluated properties are not allowed ('cache-level', 'cache-size' were unexpected) from schema $id: http://devicetree.org/schemas/cache.yaml#
Hi Inochi! On Mon, 2025-02-10 at 13:33 +0800, Inochi Amaoto wrote: > > It would probably make sense that the whole series would go into SOC tree, > > even though technically nothing prevents the reboot/reset driver to come > > in PM/reset tree. If everything would come together, `reboot` command would > > work out of the box. > > > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > > > > This reboot implentment across the RTC and 8051 domain, which is > still a big problem to be upstreamed. This should be designed Now I've got it. The problem is not in the reboot procedure, but rather how to model this thing in the DT, because of all these unrelated functions brought into two HW address spaces... > carefully and needs further discussion. Adding these two syscon > compatiable may be not a good idea and cause some problem. I invite > Yixun to this talk and he may give some useful suggestions. > > At last, I prefer this goes to an separate patch series, and > implement with rtc device.
Hi Inochi! On Mon, 2025-02-10 at 21:55 +0100, Alexander Sverdlin wrote: > > > It would probably make sense that the whole series would go into SOC tree, > > > even though technically nothing prevents the reboot/reset driver to come > > > in PM/reset tree. If everything would come together, `reboot` command would > > > work out of the box. > > > > > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > > > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > > > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > > > > > > > This reboot implentment across the RTC and 8051 domain, which is > > still a big problem to be upstreamed. This should be designed > > Now I've got it. The problem is not in the reboot procedure, but > rather how to model this thing in the DT, because of all these > unrelated functions brought into two HW address spaces... > > > carefully and needs further discussion. Adding these two syscon > > compatiable may be not a good idea and cause some problem. I invite > > Yixun to this talk and he may give some useful suggestions. > > > > At last, I prefer this goes to an separate patch series, and > > implement with rtc device. Thanks for your hints! I've completely missed the RTC driver in progress [1]. I will provide a patch registering the reboot handler on top of the driver as soon as it's accepted. [1] https://patchwork.ozlabs.org/project/rtc-linux/patch/20240428060848.706573-3-qiujingbao.dlmu@gmail.com/
On Tue, Feb 11, 2025 at 08:37:01PM +0100, Alexander Sverdlin wrote: > Hi Inochi! > > On Mon, 2025-02-10 at 21:55 +0100, Alexander Sverdlin wrote: > > > > It would probably make sense that the whole series would go into SOC tree, > > > > even though technically nothing prevents the reboot/reset driver to come > > > > in PM/reset tree. If everything would come together, `reboot` command would > > > > work out of the box. > > > > > > > > [1] https://milkv.io/docs/duo/getting-started/duo-module-01 > > > > [2] https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/ > > > > [3] https://github.com/sophgo/sophgo-doc/releases/download/sg2000-trm-v1.01/sg2000_trm_en.pdf > > > > > > > > > > This reboot implentment across the RTC and 8051 domain, which is > > > still a big problem to be upstreamed. This should be designed > > > > Now I've got it. The problem is not in the reboot procedure, but > > rather how to model this thing in the DT, because of all these > > unrelated functions brought into two HW address spaces... > > > > > carefully and needs further discussion. Adding these two syscon > > > compatiable may be not a good idea and cause some problem. I invite > > > Yixun to this talk and he may give some useful suggestions. > > > > > > At last, I prefer this goes to an separate patch series, and > > > implement with rtc device. > > Thanks for your hints! > I've completely missed the RTC driver in progress [1]. > I will provide a patch registering the reboot handler on top of the driver > as soon as it's accepted. > > [1] https://patchwork.ozlabs.org/project/rtc-linux/patch/20240428060848.706573-3-qiujingbao.dlmu@gmail.com/ > As far as I know the RTC patch is no longer maintained. Maybe you can pick it up? The patch states can be found on: https://github.com/sophgo/linux/wiki Regards, Inochi
Hi Inochi! On Wed, 2025-02-12 at 08:29 +0800, Inochi Amaoto wrote: > > Thanks for your hints! > > I've completely missed the RTC driver in progress [1]. > > I will provide a patch registering the reboot handler on top of the driver > > as soon as it's accepted. > > > > [1] https://patchwork.ozlabs.org/project/rtc-linux/patch/20240428060848.706573-3-qiujingbao.dlmu@gmail.com/ > > > > As far as I know the RTC patch is no longer maintained. Maybe you can > pick it up? I can try... If only I can make it work... > The patch states can be found on: > https://github.com/sophgo/linux/wiki Thanks for the link!