Skip to content

riscv: dts: sophgo: Milk-V Duo 256M ethernet support

Chen-Yu Yeh linux-devicetree linux-riscv lkml sophgo 3 versions – Applied

Status from this message: Applied to for-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied 2/2
  2. v22 patches 3 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Rename the PHY node to ethernet-phy@1, as the commit message already said; v2 only changed the unit address (sashiko-bot). dtbs_check now validates the node against ethernet-phy.yaml, with no new warnings.
- Drop the blank line in the trailer block of 2/2 (Hiago)
- Collect Hiago's Reviewed-by
- Keep Inochi's Reviewed-by on 2/2, since the only change is the node name

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2riscv: dts: sophgo: add Milk-V Duo 256M ethernet support overlayarch/riscv/boot/dts/sophgo/Makefile arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m-eth.dtso+20 -00 repliesApplied
2/2riscv: dts: sophgo: cv180x: Fix internal ephy node namearch/riscv/boot/dts/sophgo/cv180x.dtsi+1 -10 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchHiago De FrancoInochi Amaoto
1/2R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] riscv: dts: sophgo: Milk-V Duo 256M ethernet support

The Milk-V Duo 256M has no Ethernet connector of its own; the SG2002's internal PHY is only usable through the optional USB & Ethernet IO board. This series adds an overlay for that board and fixes the name of the internal PHY node it exposes.

Changes in v3:
- Rename the PHY node to ethernet-phy@1, as the commit message already said; v2 only changed the unit address (sashiko-bot). dtbs_check now validates the node against ethernet-phy.yaml, with no new warnings.
- Drop the blank line in the trailer block of 2/2 (Hiago)
- Collect Hiago's Reviewed-by
- Keep Inochi's Reviewed-by on 2/2, since the only change is the node name

Changes in v2:
- Enable Ethernet through an overlay instead of in the board devicetree, since without the IO board the pins may be used as GPIO (Inochi)
- Send both patches in one thread (Inochi)
- Test link-up and traffic on the IO board, which v1 could not
- Collect Inochi's Reviewed-by on the PHY node name fix

The overlay has the same shape as Hiago's for the Milk-V Duo [1], so the two boards stay consistent. The PHY node name fix is in cv180x.dtsi and so covers that board as well.

Testing, with a kernel built from this branch:

- sg2002-milkv-duo256m-eth.dtb: eth0 comes up at 100Mbps/Full, gets an address via DHCP and passes traffic
- sg2002-milkv-duo256m.dtb: no eth0 is created, and the gmac node reads back as disabled

Kernel log with sg2002-milkv-duo256m-eth.dtb:

  [    1.426499] stmmaceth 4070000.ethernet: User ID: 0x10, Synopsys ID: 0x37
  [    1.426536] stmmaceth 4070000.ethernet: 	DWMAC1000
  [    6.052829] stmmaceth 4070000.ethernet eth0: PHY [mdio_mux-0.0:01] driver [Generic PHY] (irq=POLL)
  [    8.138131] stmmaceth 4070000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
  # ip addr show eth0
  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
      inet 192.168.0.47/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0

With the base sg2002-milkv-duo256m.dtb:

  # ip addr show eth0
  ip: can't find device 'eth0'
  # cat /proc/device-tree/soc/ethernet@4070000/status
  disabled

iperf3 against a desktop on the same switch gives 94 Mbit/s with the board sending and 70-74 Mbit/s with it receiving, with no retransmissions either way. The receive side being slower is not a CPU limit on the board; I have not looked into it further yet.

v1: https://lore.kernel.org/sophgo/[email protected]/

    https://lore.kernel.org/sophgo/[email protected]/

v2: https://lore.kernel.org/sophgo/[email protected]/

[1] https://lore.kernel.org/sophgo/[email protected]/

Chen-Yu Yeh (2):
riscv: dts: sophgo: add Milk-V Duo 256M ethernet support overlay
riscv: dts: sophgo: cv180x: Fix internal ephy node name

 arch/riscv/boot/dts/sophgo/Makefile             |  3 +++
 arch/riscv/boot/dts/sophgo/cv180x.dtsi          |  2 +-
 .../dts/sophgo/sg2002-milkv-duo256m-eth.dtso    | 17 +++++++++++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 arch/riscv/boot/dts/sophgo/sg2002-milkv-duo256m-eth.dtso
Signature · 1 line
2.43.0