devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] Add Ethernet MAC support for SpacemiT K1
@ 2025-06-13  2:15 Vivian Wang
  2025-06-13  2:15 ` [PATCH net-next 1/4] dt-bindings: net: Add " Vivian Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Vivian Wang @ 2025-06-13  2:15 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Yixun Lan, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Richard Cochran, Philipp Zabel, Russell King,
	Vivian Wang
  Cc: Vivian Wang, netdev, devicetree, linux-riscv, spacemit,
	linux-kernel

SpacemiT K1 has two gigabit Ethernet MACs with RGMII and RMII support.
Add a driver for them, as well as the supporting devicetree and bindings
updates.

Tested on BananaPi BPI-F3 (but see "Known issues").

I would like to note that even though some bit field names superficially
resemble that of DesignWare MAC, but all other differences point to it
in fact being a custom design.

Based on SpacemiT drivers [1]. This series depends on reset controller
support for K1 [2]. These patches can also be pulled from:

https://github.com/dramforever/linux/tree/k1/ethernet/v1

Known issues:

- RX fails to achieve close-enough-to gigabit performance for unknown
  reasons. The 6.6-based Linux in the vendor distribution "Bianbu" can
  do over 900 Mbps, so this should be a software problem, but I haven't
  figured out why yet. A cursory look at "top" tells me that ksoftirqd
  takes up almost one entire core, which suggests that RX could be
  compute-bound.

  Tested with Banana Pi BPI-F3:

    # On the BPI-F3
    taskset -c 2 iperf3 -s

    # On the other side
    iperf3 --bitrate 0 --time 10 {--reverse,} {--udp,} -c [ip]

  Results (TX/RX from BPI-F3 perspective):

    TCP TX: 941 Mbits/sec
    UDP TX: 948 Mbits/sec
    TCP RX: 617 Mbits/sec
    UDP RX: 647 Mbits/sec

- No DT for Milk-V Jupiter. I do not have this hardware to test yet.
  If I get access to it later I will add its DT changes.

[1]: https://github.com/spacemit-com/linux-k1x
[2]: https://lore.kernel.org/all/20250613011139.1201702-1-elder@riscstar.com

---
Vivian Wang (4):
      dt-bindings: net: Add support for SpacemiT K1
      net: spacemit: Add K1 Ethernet MAC
      riscv: dts: spacemit: Add Ethernet support for K1
      riscv: dts: spacemit: Add Ethernet support for BPI-F3

 .../devicetree/bindings/net/spacemit,k1-emac.yaml  |   81 +
 arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts    |   46 +
 arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi       |   48 +
 arch/riscv/boot/dts/spacemit/k1.dtsi               |   22 +
 drivers/net/ethernet/Kconfig                       |    1 +
 drivers/net/ethernet/Makefile                      |    1 +
 drivers/net/ethernet/spacemit/Kconfig              |   29 +
 drivers/net/ethernet/spacemit/Makefile             |    6 +
 drivers/net/ethernet/spacemit/k1_emac.c            | 2059 ++++++++++++++++++++
 drivers/net/ethernet/spacemit/k1_emac.h            |  416 ++++
 10 files changed, 2709 insertions(+)
---
base-commit: d9946fe286439c2aeaa7953b8c316efe5b83d515
change-id: 20250606-net-k1-emac-3e181508ea64
prerequisite-message-id: <20250613011139.1201702-1-elder@riscstar.com>
prerequisite-patch-id: 2c73c63bef3640e63243ddcf3c07b108d45f6816
prerequisite-patch-id: 0faba75db33c96a588e722c4f2b3862c4cbdaeae
prerequisite-patch-id: 5db8688ef86188ec091145fae9e14b2211cd2b8c
prerequisite-patch-id: e0fe84381637dc888d996a79ea717ff0e3441bd1
prerequisite-patch-id: 2fc0ef1c2fcda92ad83400da5aadaf194fe78627
prerequisite-patch-id: bfa54447803e5642059c386e2bd96297e691d0bf

Best regards,
-- 
Vivian "dramforever" Wang


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-06-16  6:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13  2:15 [PATCH net-next 0/4] Add Ethernet MAC support for SpacemiT K1 Vivian Wang
2025-06-13  2:15 ` [PATCH net-next 1/4] dt-bindings: net: Add " Vivian Wang
2025-06-13 14:43   ` Conor Dooley
2025-06-13  2:15 ` [PATCH net-next 2/4] net: spacemit: Add K1 Ethernet MAC Vivian Wang
2025-06-13 13:31   ` Jakub Kicinski
2025-06-16  3:02     ` Vivian Wang
2025-06-13 14:32   ` Andrew Lunn
2025-06-16  3:04     ` Vivian Wang
2025-06-13 15:04   ` Vadim Fedorenko
2025-06-16  3:04     ` Vivian Wang
2025-06-16  6:33   ` Russell King (Oracle)
2025-06-16  6:41     ` Vivian Wang
2025-06-13  2:15 ` [PATCH net-next 3/4] riscv: dts: spacemit: Add Ethernet support for K1 Vivian Wang
2025-06-13  2:15 ` [PATCH net-next 4/4] riscv: dts: spacemit: Add Ethernet support for BPI-F3 Vivian Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).