This series adds glue driver for Motorcomm YT6801 PCIe ethernet
controller, which is considered mostly compatible with DWMAC-4 IP by
inspecting the register layout[1]. It integrates a Motorcomm YT8531S PHY
(confirmed by reading PHY ID) and GMII is used to connect the PHY to
MAC[2].
The initialization logic of the MAC is mostly based on previous upstream
effort for the controller[3] and the Deepin-maintained downstream Linux
driver[4] licensed under GPL-2.0 according to its SPDX headers. However,
this series is a completely re-write of the previous patch series,
utilizing the existing DWMAC4 driver and introducing a glue driver only.
This series only aims to add basic networking functions for the
controller, features like WoL, RSS and LED control are omitted for now.
Testing is done on Loongson 3A5000 machine. Through a local GbE switch,
it reaches 868Mbps (TX)/942Mbps (RX) on average,
## YT6801 TX
Connecting to host 172.16.70.12, port 5201
[ 5] local 172.16.70.230 port 54806 connected to 172.16.70.12 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 102 MBytes 855 Mbits/sec 0 342 KBytes
[ 5] 1.00-2.00 sec 104 MBytes 869 Mbits/sec 0 424 KBytes
[ 5] 2.00-3.00 sec 104 MBytes 868 Mbits/sec 0 474 KBytes
[ 5] 3.00-4.00 sec 103 MBytes 865 Mbits/sec 0 474 KBytes
[ 5] 4.00-5.00 sec 104 MBytes 869 Mbits/sec 0 474 KBytes
[ 5] 5.00-6.00 sec 104 MBytes 873 Mbits/sec 0 474 KBytes
[ 5] 6.00-7.00 sec 103 MBytes 863 Mbits/sec 0 474 KBytes
[ 5] 7.00-8.00 sec 104 MBytes 870 Mbits/sec 0 474 KBytes
[ 5] 8.00-9.00 sec 103 MBytes 863 Mbits/sec 0 474 KBytes
[ 5] 9.00-10.00 sec 105 MBytes 876 Mbits/sec 0 474 KBytes
## YT6801 RX
Connecting to host 172.16.70.230, port 5201
[ 5] local 172.16.70.12 port 59346 connected to 172.16.70.230 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 113 MBytes 950 Mbits/sec 0 383 KBytes
[ 5] 1.00-2.00 sec 112 MBytes 941 Mbits/sec 0 406 KBytes
[ 5] 2.00-3.00 sec 113 MBytes 946 Mbits/sec 0 406 KBytes
[ 5] 3.00-4.00 sec 111 MBytes 933 Mbits/sec 0 406 KBytes
[ 5] 4.00-5.00 sec 112 MBytes 938 Mbits/sec 0 406 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 943 Mbits/sec 0 426 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 941 Mbits/sec 0 426 KBytes
[ 5] 7.00-8.00 sec 111 MBytes 932 Mbits/sec 0 426 KBytes
[ 5] 8.00-9.00 sec 113 MBytes 950 Mbits/sec 0 566 KBytes
[ 5] 9.00-10.00 sec 112 MBytes 938 Mbits/sec 0 566 KBytes
This series depends on v4 of series "Unify platform suspend/resume
routines for PCI DWMAC glue"[5] for a clean apply. It has been some time
since I sent v1 of the series, I'm sorry for the delay. Many thanks for
your time and review.
[1]: https://lore.kernel.org/all/Z_T6vv013jraCzSD@shell.armlinux.org.uk/
[2]: https://lore.kernel.org/all/a48d76ac-db08-46d5-9528-f046a7b541dc@motor-comm.com/
[3]: https://lore.kernel.org/all/a48d76ac-db08-46d5-9528-f046a7b541dc@motor-comm.com/
[4]: https://github.com/deepin-community/kernel/tree/dc61248a0e21/drivers/net/ethernet/motorcomm/yt6801
[5]: https://lore.kernel.org/netdev/20251111100727.15560-2-ziyao@disroot.org/
Changed from v1
- Drop (original) PATCH 1, add no vendor ID entry to linux/pci_ids.h
- Use PHY_INTERFACE_MODE_GMII instead of PHY_INTERFACE_MODE_INTERNAL
- Drop extra register read in motorcomm_efuse_read_byte()
- Rename EPHY_RESET to EPHY_MDIO_PHY_RESET, add a comment to reflect its
function better
- Use the newly-introduced generic PCI suspend/resume routines
- Generate a random MAC address instead of failing to probe when no MAC
address is programmed in eFuse (seen on some OEM EVBs).
- Collect Tested-by tags
- Link to v1: https://lore.kernel.org/netdev/20251014164746.50696-2-ziyao@disroot.org/
Yao Zi (3):
net: phy: motorcomm: Support YT8531S PHY in YT6801 Ethernet controller
net: stmmac: Add glue driver for Motorcomm YT6801 ethernet controller
MAINTAINERS: Assign myself as maintainer of Motorcomm DWMAC glue
driver
MAINTAINERS | 6 +
drivers/net/ethernet/stmicro/stmmac/Kconfig | 7 +
drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
.../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 379 ++++++++++++++++++
drivers/net/phy/motorcomm.c | 4 +
5 files changed, 397 insertions(+)
create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
--
2.51.2