Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Joseph Telaak via B4 Relay
Tue, 01 Dec 2026 07:00
[PATCH net-next v2 0/3] net: stmmac: Add the Siflower SF19A2890 glue
Author: Joseph Telaak via B4 Relay
Date: Tue, 01 Dec 2026 07:00
Date: Tue, 01 Dec 2026 07:00
117 lines
15057 bytes
15057 bytes
The Siflower SF19A2890, a MIPS SoC for home routers, has a DesignWare
GMAC 3.73a. Its interface type and RGMII clock delays are set in a small
configuration block next to its clock and reset manager. This series
adds a binding and the glue.
The SoC support itself (MACH_SIFLOWER_MIPS) comes through the MIPS or
the clk tree, both of which carry its patch; until then the glue builds
with COMPILE_TEST.
v1 took the delays in picoseconds from rx-internal-delay-ps and
tx-internal-delay-ps. Andrew asked whether a TX delay of 0 really adds
nothing, and that cannot be established: the TX delay line has no
bypass, Siflower publishes no timing for the SoC, and its own material
gives 40 ps per step where a sweep measures 55 ps. So v2 does what
Siflower's and GL.iNet's firmware and Chuanhong Guo's driver, which this
glue is based on, do. Siflower calibrates both delay lines of each unit
at the factory and stores the settings, in the lines' own steps, in the
factory partition; the glue programs them from that nvmem cell, and
without one it leaves the lines as the bootloader set them. Nothing in
picoseconds enters the binding, which rejects rx-internal-delay-ps and
tx-internal-delay-ps.
Andrew also suggested making the glue depend on BROKEN, so that device
trees could be broken once the delays are understood. v2 does not,
because the device tree no longer holds a delay value: the board's tree
says only where the unit's calibration is stored. If the delays later
need handling differently, only the glue changes, and existing device
trees keep working.
Patch 1 lets ethernet-controller.yaml take a second nvmem cell after
mac-address, named by the device's own binding. Today it allows only
mac-address, and every MAC binding includes it, so no binding can add a
calibration cell.
The measurements behind this, on the GL.iNet GL-SFT1200, where the GMAC
is the CPU port of a MaxLinear GSW150 switch over RGMII:
- Sweeping each delay register over 0-255 at 1000 Mb/s, the working
windows repeat every 145 steps (TX) and 144.5 steps (RX), one 8 ns
period of the RGMII clock, so a step is about 55 ps. The TX eye is
about 3.1 ns wide and the RX eye about 1.75 ns.
- With every programmed delay at 0 the link passes traffic, at the early
edge of both eyes. Sweeping the switch's own delays with the MAC's at
0, switch to MAC works with 0 to 1.5 ns added and fails from 2 ns, and
MAC to switch works with 0 to 2 ns and fails from 2.5 ns. The RX delay
line at step 0 adds at most about 0.25 ns over its bypass.
- The GSW150 datasheet, which is public, says that with its delay
register at 0 the switch transmits with clock and data aligned to
within 0.5 ns and needs the clock 1.0 to 2.6 ns after the data. So the
MAC's input samples about 1.1 to 1.3 ns earlier than an RGMII v1.3
receiver, and the RX delay it needs, about 0.7 ns, is its own. For TX
the datasheet only bounds the MAC's step-0 delay, its output skew and
the board together to -0.24 to +1.23 ns.
- The two units I have read 0x11/0x0a and 0x10/0x09 from their
calibration cells. GL.iNet's bootloader programs 0x17 for both lines
on every boot, which leaves RX about 0.25 ns inside the edge of the
measured window, so the calibration is worth taking.
Tested on a GL-SFT1200 with the GSW150 driver:
- each of WAN, LAN 1 and LAN 2 links at 1000 Mb/s full duplex and
passes iperf3 both ways (160-205 Mb/s out, 262-273 Mb/s in, well
under line rate; I have not looked into where the limit is);
- 10 GB each way through LAN 1, after which every CRC, alignment,
error, drop, overflow and underflow counter on eth0 and lan1 is 0;
- 50 link down/up cycles, after which the link and traffic recover;
- the MAC address from the factory partition, and ethtool reporting the
link without the STMMAC_FLAG_HAS_INTEGRATED_PCS that the OpenWrt
driver needed;
- v2 on a second GL-SFT1200, whose bootloader leaves both delay
registers at 0x17: the glue programs the unit's calibration, 0x10 and
0x09; 50 of 50 pings of 1400 bytes; iperf3 201 Mb/s out and 288 Mb/s
in with no retransmits; and every CRC, error and drop counter at 0.
---
Changes in v2:
- Patch 1 (new): let ethernet-controller.yaml take a device-specific
nvmem cell after mac-address.
- Patches 2 and 3 were patches 1 and 2 in v1.
- Take the RGMII delays from the unit's factory calibration, the
rgmii-delay nvmem cell, in the delay lines' own steps, instead of
rx-internal-delay-ps and tx-internal-delay-ps, which the binding now
rejects (Andrew).
- Do not depend on BROKEN: the device tree holds no delay value, so
later changes stay in the glue (Andrew).
- Pass the device to the delay helper instead of storing it (Maxime).
- Add a MAINTAINERS entry for the glue and its binding (Maxime).
- Set has_internal_tx_delay and has_internal_rx_delay where the MAC adds
the delays, so the same delays are not asked of the PHY.
- Probe with devm_stmmac_pltfr_probe() and drop .remove.
- Say in a comment that the RX delay line is bypassed while RX_DELAY_EN
is clear (Andrew).
- Describe the measured delays and what the GSW150 datasheet and
Siflower's firmware say about them.
- Link to v1: https://patch.msgid.link/20261104-sf19a2890-gmac-v1-0-a15965a49574@telaak.dev
---
Joseph Telaak (3):
dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell
dt-bindings: net: Add Siflower SF19A2890 GMAC
net: stmmac: Add Siflower SF19A2890 glue
.../bindings/net/ethernet-controller.yaml | 11 +-
.../bindings/net/siflower,sf19a2890-gmac.yaml | 119 +++++++++++++++
.../devicetree/bindings/net/snps,dwmac.yaml | 1 +
MAINTAINERS | 7 +
drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 ++
drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
.../net/ethernet/stmicro/stmmac/dwmac-sf19a2890.c | 167 +++++++++++++++++++++
7 files changed, 315 insertions(+), 3 deletions(-)
---
base-commit: d35a725a7c96504f7deece4dfaa83bee6a98fe0e
change-id: 20261102-sf19a2890-gmac-4fb4808f869c
Best regards,
--
Joseph Telaak <joseph@telaak.dev>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads