[PATCH net-next v3 0/5] net: stmmac: Add support for Allwinner A733 GMAC210
flat view
COLD16d
From: Jerome Brunet <jbrunet@baylibre.com>
Date: 2026-09-23 20:47:57
Also in:
linux-devicetree, linux-sunxi, lkml, netdev
Revision v3 of 3 in this series.
Revisions (3)
- rfc [diff vs current]
- v2 [diff vs current]
- v3 current
The A733 GMAC210 is a DesignWare MAC 5.20 with an Allwinner glue close to the A523 GMAC200 already supported by dwmac-sun55i, but with a few significant differences: * The glue configuration registers are a dedicated MMIO region of the controller instead of a syscon register. * That region is in the AHB reset domain, so the AHB reset must be released before the configuration is written. The configuration is sampled by the dwmac when the other reset is deasserted. * The DMA channels have their own interrupt lines. * A PTP reference clock and an AHB reset are needed. * The controllers do not require a power domain (AFAIK). * The TX clock delay value is 5 bits wide instead of 3, split over 2 register fields, and both TX and RX delays use a 180ps step. The DT changes for the A733 and the Cubie A7A board are not part of this series and will be sent separately through the sunxi tree. Tested on a Cubie A7A, RGMII with a MAXIO external PHY on GMAC0. Problems found while testing (none impacting this driver directly): * Unstable EEE/LPI: If the device stays in LPI mode long enough, the link sometimes (but not always) goes down, coming back up when the device exits LPI mode. This is apparently due to the PHY; the vendor driver disables this feature. The solution is to use genphy with the eee-broken-* DT properties or wait for the upcoming mainline driver: https://lore.kernel.org/all/MN0PR19MB609154F210DF84DCB29D3696ACC62@MN0PR19MB6091.namprd19.prod.outlook.com (local) * Tx-delay: The vendor kernel ships with a Tx delay of 2.16ns. It may seem to work at first but breaks under heavy load. The vendor kernel is configured for an external RGMII clock, which cannot work on the A7A: the 125MHz input and 25MHz reference output are not wired to the PHY. It was most likely not tested on this board. A 1.62ns Tx delay works well. DT example is available here (gated on CCU and pinctrl mainline support currently): https://github.com/jbrun3t/linux/commit/aa6f3a5ce4cd6e09ff9be1828915bfe8e87c57df Maxime, I've tried adding a new init callback as you suggested but it did not work out. The config needs to be written before the 'stmmaceth' reset is deasserted to be properly sampled, but it can only be written once the 'ahb' reset is deasserted. A new callback would not help. However, tweaking the stmmac platform data as I did in v2 is not necessary since the reset is shared. I've corrected that. Changes in v3: - Split the driver changes into preparatory patches and the A733 addition - Use a 180ps TX and RX delay step on the A733, allowing up to 5580ps - Release the shared AHB reset before writing the glue registers instead of taking over the stmmaceth reset from the stmmac core - Link to v2: https://patch.msgid.link/20260910-allwinner-a733-gmac-support-v2-0-4f4a1e520c23@baylibre.com (local) Changes in v2: - No driver change since RFC, just more tests. - Rebase on net-next/main - proper prefix added - Link to v1: https://patch.msgid.link/20260731-allwinner-a733-gmac-support-v1-0-d0a8732bfa82@baylibre.com (local) Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> --- Jerome Brunet (5): dt-bindings: net: sun8i-emac: Add A733 GMAC210 compatible net: stmmac: sun55i: Add per-compatible match data net: stmmac: sun55i: Make the delay step configurable net: stmmac: sun55i: Support TX delay extension bits net: stmmac: sun55i: Add support for Allwinner A733 GMAC210 .../bindings/net/allwinner,sun8i-a83t-emac.yaml | 142 ++++++++++++++-- drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c | 184 +++++++++++++++++---- 2 files changed, 276 insertions(+), 50 deletions(-) --- base-commit: 944ae66642b726bd6b25ae71b1e9ff88a0e0bdb0 change-id: 20260731-allwinner-a733-gmac-support-163bde10c152 Best regards, -- Jerome