mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/5] net: stmmac: Add support for Allwinner A733 GMAC210
@ 2026-09-23 20:47 Jerome Brunet
  2026-09-23 20:47 ` [PATCH net-next v3 1/5] dt-bindings: net: sun8i-emac: Add A733 GMAC210 compatible Jerome Brunet
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Jerome Brunet @ 2026-09-23 20:47 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Richard Cochran,
	Maxime Ripard, Maxime Coquelin, Alexandre Torgue, Philipp Zabel,
	Maxime Chevallier
  Cc: netdev, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
	linux-stm32, Andre Przywara, Jerome Brunet

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
 * 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

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

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


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

end of thread, other threads:[~2026-09-24 16:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 20:47 [PATCH net-next v3 0/5] net: stmmac: Add support for Allwinner A733 GMAC210 Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 1/5] dt-bindings: net: sun8i-emac: Add A733 GMAC210 compatible Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 2/5] net: stmmac: sun55i: Add per-compatible match data Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 3/5] net: stmmac: sun55i: Make the delay step configurable Jerome Brunet
2026-09-24  2:30   ` Andrew Lunn
2026-09-24  8:53     ` Jerome Brunet
2026-09-24 12:55       ` Andrew Lunn
2026-09-23 20:47 ` [PATCH net-next v3 4/5] net: stmmac: sun55i: Support TX delay extension bits Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 5/5] net: stmmac: sun55i: Add support for Allwinner A733 GMAC210 Jerome Brunet
2026-09-23 22:15 ` [PATCH net-next v3 0/5] net: stmmac: " Andrew Lunn
2026-09-23 22:19 ` Andrew Lunn
2026-09-24  8:40   ` Jerome Brunet
2026-09-24 12:54     ` Andrew Lunn
2026-09-24 15:27       ` Jerome Brunet
2026-09-24 16:02         ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®