Add initial Milk-V Duo S board support
Subsystems (6)
v5 cover Add initial Milk-V Duo S board support
This adds an initial device tree for the Milk-V Duo S board with support for reading from the SD card and network over Ethernet. This is continued work from Michael Opdenacker's v6 series [1] on the ARM64 and RISCV side. It has been tested with ARM64 and RISCV64 to boot from an SD card, have networking, and read I2C slave devices over i2c4.
---
v5
- Fixes spaces at beginning of line in &usb node of DTS
v4: https://lore.kernel.org/sophgo/[email protected]/
- Rebased to latest sophogo/for-next
- Added usb node to arm64 and riscv DTS
- Removed sg200x link in commit messages
- Added missing change to v3 and removed link from v2
v3: https://lore.kernel.org/sophgo/[email protected]/
- Added sg2000 interrupt controller and timer to documentation
- Added sg2000.dtsi for RISCV and moved DTS over to use it
- remove devices from DTS's to match what is available in the default pinmux config. spi0-2, i2c0-3, uart1-4
- Added i2c4 and spi3 aliases
- Removed milkv,duo-s from sophgo,cv1812h in documentation
v2: https://lore.kernel.org/sophgo/[email protected]/
- Made new entry in docs to avoid DTC error
- "Milk-V DuoS" -> "Milk-V Duo S"
- Sorting of aliases
- Added uart*, emmc, mdio, gmac0, i2c*, spi*, dmac, saradc
to device tree matching what is available on the pinout
- Removal of 'no-mmc' and 'no-sdio' for sdhci0 as it works without
- Added riscv device tree
v1: https://lore.kernel.org/sophgo/[email protected]/
Joshua Milas (5):
dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
arm64: dts: sophgo: add initial Milk-V Duo S board support
dt-bindings: soc: sophgo: add sg2000 plic and clint documentation
riscv64: dts: sophgo: add SG2000 dtsi
riscv64: dts: sophgo: add initial Milk-V Duo S board support
.../sifive,plic-1.0.0.yaml | 1 + .../bindings/soc/sophgo/sophgo.yaml | 4 + .../bindings/timer/sifive,clint.yaml | 1 + arch/arm64/boot/dts/sophgo/Makefile | 1 + .../boot/dts/sophgo/sg2000-milkv-duo-s.dts | 85 +++++++++++++++++++ arch/riscv/boot/dts/sophgo/Makefile | 1 + .../boot/dts/sophgo/sg2000-milkv-duo-s.dts | 85 +++++++++++++++++++ arch/riscv/boot/dts/sophgo/sg2000.dtsi | 53 ++++++++++++ 8 files changed, 231 insertions(+) create mode 100644 arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duo-s.dts create mode 100644 arch/riscv/boot/dts/sophgo/sg2000.dtsi
base-commit: 9aa6068586a9b4cd34cf04f8dee72a7283ab4ae4
Signature · 1 line
2.53.0
PATCH v5 1/5 dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
Document the compatible strings for the Milk-V Duo S board [1] which uses the SOPHGO SG2000 SoC.
--- Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/soc/sophgo/sophgo.yaml +4 -0
@@ -31,6 +31,10 @@ properties: - milkv,duo-module-01-evb - const: milkv,duo-module-01 - const: sophgo,sg2000 + - items: + - enum: + - milkv,duo-s + - const: sophgo,sg2000 - items: - enum: - sipeed,licheerv-nano-b
Signature · 1 line
2.53.0
Re: [PATCH v5 1/5] dt-bindings: soc: sophgo: add Milk-V Duo S board compatibles
Quoted 6 lines · Joshua Milas
Document the compatible strings for the Milk-V Duo S board [1] which uses the SOPHGO SG2000 SoC.
Link https://milkv.io/duo-s [1]Signed-off-by Joshua Milas <[email protected]>
Best regards,
Krzysztof
PATCH v5 2/5 arm64: dts: sophgo: add initial Milk-V Duo S board support
In reply to Joshua MilasAdds initial arm64 support for the Milk-V Duo S board
[1] making it possible to boot Linux to the command line.
--- arch/arm64/boot/dts/sophgo/Makefile | 1 + .../boot/dts/sophgo/sg2000-milkv-duo-s.dts | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts
arch/arm64/boot/dts/sophgo/Makefile +1 -0
@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-module-01-evb.dtb +dtb-$(CONFIG_ARCH_SOPHGO) += sg2000-milkv-duo-s.dtb
arch/arm64/boot/dts/sophgo/sg2000-milkv-duo-s.dts new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
2.53.0
PATCH v5 3/5 dt-bindings: soc: sophgo: add sg2000 plic and clint documentation
In reply to Joshua MilasDocument the compatible strings for the sg2000 interrupt controller and timer.
--- .../bindings/interrupt-controller/sifive,plic-1.0.0.yaml | 1 + Documentation/devicetree/bindings/timer/sifive,clint.yaml | 1 + 2 files changed, 2 insertions(+)
Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml +1 -0
@@ -73,6 +73,7 @@ properties: - allwinner,sun20i-d1-plic - sophgo,cv1800b-plic - sophgo,cv1812h-plic + - sophgo,sg2000-plic - sophgo,sg2002-plic - sophgo,sg2042-plic - sophgo,sg2044-plic
Documentation/devicetree/bindings/timer/sifive,clint.yaml +1 -0
@@ -50,6 +50,7 @@ properties: - allwinner,sun20i-d1-clint - sophgo,cv1800b-clint - sophgo,cv1812h-clint + - sophgo,sg2000-clint - sophgo,sg2002-clint - thead,th1520-clint - const: thead,c900-clint
Signature · 1 line
2.53.0
Re: [PATCH v5 3/5] dt-bindings: soc: sophgo: add sg2000 plic and clint documentation
Quoted 8 lines · Joshua Milas
Document the compatible strings for the sg2000 interrupt controller and timer.
Signed-off-by Joshua Milas <[email protected]>--- .../bindings/interrupt-controller/sifive,plic-1.0.0.yaml | 1 + Documentation/devicetree/bindings/timer/sifive,clint.yaml | 1 + 2 files changed, 2 insertions(+)
Best regards,
Krzysztof
PATCH v5 4/5 riscv64: dts: sophgo: add SG2000 dtsi
In reply to Joshua MilasAdds sg2000.dtsi on the RISCV side.
--- arch/riscv/boot/dts/sophgo/sg2000.dtsi | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 arch/riscv/boot/dts/sophgo/sg2000.dtsi
arch/riscv/boot/dts/sophgo/sg2000.dtsi new file +53 -0
@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +#define SOC_PERIPHERAL_IRQ(nr) ((nr) + 16) + +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pinctrl/pinctrl-sg2000.h> +#include "cv180x-cpus.dtsi" +#include "cv180x.dtsi" +#include "cv181x.dtsi" + +/ { + compatible = "sophgo,sg2000"; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + soc { + interrupt-parent = <&plic>; + dma-noncoherent; + + pinctrl: pinctrl@3001000 { + compatible = "sophgo,sg2000-pinctrl"; + reg = <0x03001000 0x1000>, + <0x05027000 0x1000>; + reg-names = "sys", "rtc"; + }; + + clk: clock-controller@3002000 { + compatible = "sophgo,sg2000-clk"; + reg = <0x03002000 0x1000>; + clocks = <&osc>; + #clock-cells = <1>; + }; + + plic: interrupt-controller@70000000 { + compatible = "sophgo,sg2000-plic", "thead,c900-plic"; + reg = <0x70000000 0x4000000>; + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + riscv,ndev = <101>; + }; + + clint: timer@74000000 { + compatible = "sophgo,sg2000-clint", "thead,c900-clint"; + reg = <0x74000000 0x10000>; + interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; + }; + }; +};
Signature · 1 line
2.53.0
Re: [PATCH v5 4/5] riscv64: dts: sophgo: add SG2000 dtsi
Quoted 4 lines · Joshua Milas
Adds
sg2000.dtsion the RISCV side.Signed-off-by Joshua Milas <[email protected]>
Quoted 67 lines
--- arch/riscv/boot/dts/sophgo/sg2000.dtsi | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 arch/riscv/boot/dts/sophgo/sg2000.dtsiarch/riscv/boot/dts/sophgo/sg2000.dtsi new file +53
-1@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +#define SOC_PERIPHERAL_IRQ(nr) ((nr) + 16) + +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pinctrl/pinctrl-sg2000.h> +#include "cv180x-cpus.dtsi" +#include "cv180x.dtsi" +#include "cv181x.dtsi" + +/ { + compatible = "sophgo,sg2000"; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + soc { + interrupt-parent = <&plic>; + dma-noncoherent; + + pinctrl: pinctrl@3001000 { + compatible = "sophgo,sg2000-pinctrl"; + reg = <0x03001000 0x1000>, + <0x05027000 0x1000>; + reg-names = "sys", "rtc"; + }; + + clk: clock-controller@3002000 { + compatible = "sophgo,sg2000-clk"; + reg = <0x03002000 0x1000>; + clocks = <&osc>; + #clock-cells = <1>; + }; + + plic: interrupt-controller@70000000 { + compatible = "sophgo,sg2000-plic", "thead,c900-plic"; + reg = <0x70000000 0x4000000>; + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + riscv,ndev = <101>; + }; + + clint: timer@74000000 { + compatible = "sophgo,sg2000-clint", "thead,c900-clint"; + reg = <0x74000000 0x10000>; + interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; + }; + }; +}; --2.53.0
PATCH v5 5/5 riscv64: dts: sophgo: add initial Milk-V Duo S board support
In reply to Joshua MilasThis adds initial riscv support for the Milk-V Duo S board
[1] making it possible to boot Linux to the command line.
--- arch/riscv/boot/dts/sophgo/Makefile | 1 + .../boot/dts/sophgo/sg2000-milkv-duo-s.dts | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duo-s.dts
arch/riscv/boot/dts/sophgo/Makefile +1 -0
@@ -1,6 +1,7 @@ # 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-duo-s.dtb dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtb
arch/riscv/boot/dts/sophgo/sg2000-milkv-duo-s.dts new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
2.53.0
Re: [PATCH v5 5/5] riscv64: dts: sophgo: add initial Milk-V Duo S board support
Quoted 7 lines · Joshua Milas
This adds initial riscv support for the Milk-V Duo S board
[1] making it possible to boot Linux to the command line.Link https://milkv.io/duo-s [1]Signed-off-by Joshua Milas <[email protected]>
Great work, thanks Joshua! I really like this board.
I encountered the same issue Michael Opdenacker saw in v4, but enabling the MDIO-related configs resolved it.
I'll keep using and testing this series and provide further feedback if anything comes up. Next, I plan to test the arm64 side and will also try developing an efuse driver.
Quoted 112 lines
--- arch/riscv/boot/dts/sophgo/Makefile | 1 + .../boot/dts/sophgo/sg2000-milkv-duo-s.dts | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 arch/riscv/boot/dts/sophgo/sg2000-milkv-duo-s.dtsarch/riscv/boot/dts/sophgo/Makefile +1
-0@@ -1,6 +1,7 @@ # 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-duo-s.dtb dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtbarch/riscv/boot/dts/sophgo/sg2000-milkv-duo-s.dts new file +85
-1@@ -0,0 +1,85 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "sg2000.dtsi" + +/ { + model = "Milk-V Duo S"; + compatible = "milkv,duo-s", "sophgo,sg2000"; + + aliases { + i2c4 = &i2c4; + mmc0 = &sdhci0; + serial0 = &uart0; + spi3 = &spi3; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&osc { + clock-frequency = <25000000>; +}; + +&dmac { + status = "okay"; +}; + +&emmc { + bus-width = <4>; + no-1-8-v; + cap-mmc-hw-reset; + no-sd; + no-sdio; + non-removable; + status = "okay"; +}; + +&gmac0 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +&saradc { + status = "okay"; +}; + +&sdhci0 { + bus-width = <4>; + no-1-8-v; + disable-wp; + status = "okay"; +}; + +&sdhci1 { + bus-width = <4>; + cap-sdio-irq; + no-mmc; + no-sd; + non-removable; + status = "okay"; +}; + +&spi3 { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&usb { + dr_mode = "host"; + status = "okay"; +}; + --2.53.0
Re: [PATCH v5 5/5] riscv64: dts: sophgo: add initial Milk-V Duo S board support
Joshua, Gui-Dong
(my apologies for my previous-email with HTML content... bad default Thunderbird settings!
Quoted 12 lines · Gui-Dong Han
Quoted 6 lines · Joshua Milas
This adds initial riscv support for the Milk-V Duo S board
[1] making it possible to boot Linux to the command line.Link https://milkv.io/duo-s [1]Signed-off-by Joshua Milas <[email protected]>Great work, thanks Joshua! I really like this board.
I encountered the same issue Michael Opdenacker saw in v4, but enabling the MDIO-related configs resolved it.
Quoted 6 lines
I'll keep using and testing this series and provide further feedback if anything comes up. Next, I plan to test the arm64 side and will also try developing an efuse driver.
Tested-by Gui-Dong Han <[email protected]>Reviewed-by Gui-Dong Han <[email protected]>
What about submitting a new iteration of your patchset? I guess the last one was too close to the merge window to make it, but if you submit a new version not too late and review it quickly enough, we could make it this time.
Don't hesitate to let us know if you need help (happy to post the new iteration if you don't have time).
Thanks in advance
Cheers
Michael.
Signature · 3 lines
Root Commit Embedded Linux Training and Consulting https://rootcommit.com