* Re: [PATCH net-next v2 1/3] dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell
[not found] <sashiko-outbox-245013@kernel.org>
@ 2026-12-02 8:12 ` Joseph Telaak
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Telaak @ 2026-12-02 8:12 UTC (permalink / raw)
To: sashiko-reviews
Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
netdev, devicetree
> For a fixed two-entry nvmem-cells property corresponding to the
> nvmem-cell-names items list below, DT binding conventions prefer an items
> list carrying a per-entry description rather than maxItems with a free-form
> description that enumerates the entries and restates their optionality.
v3 will list the two cells under items, each with its description.
> Does defining nvmem-cell-names as a positional items tuple require index 0
> to always be mac-address while leaving index 1 unconstrained across every
> binding that inherits ethernet-controller.yaml?
Yes to both. A fixed order of names is how bindings usually list them,
and on the SF19A2890 the MAC address and the delay calibration are in
the same factory partition, so a board with only the calibration cell
is not expected. A binding that needs that can allow it.
ethernet-controller.yaml cannot name the second cell, since the cell
belongs to the device, so a binding that does not narrow
nvmem-cell-names accepts any name there. The SF19A2890 binding narrows
it to rgmii-delay. I don't see a way for a device binding to add a cell
without loosening the common schema, but I'm happy to follow another
approach if the DT maintainers prefer one.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH net-next v2 0/3] net: stmmac: Add the Siflower SF19A2890 glue
@ 2026-12-01 7:00 Joseph Telaak via B4 Relay
2026-12-01 7:00 ` [PATCH net-next v2 1/3] dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell Joseph Telaak via B4 Relay
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-12-01 7:00 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Alexandre Torgue, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: Chuanhong Guo, Russell King, linux-mips, netdev, devicetree,
linux-kernel, linux-arm-kernel, Joseph Telaak
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>
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH net-next v2 1/3] dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell
2026-12-01 7:00 [PATCH net-next v2 0/3] net: stmmac: Add the Siflower SF19A2890 glue Joseph Telaak via B4 Relay
@ 2026-12-01 7:00 ` Joseph Telaak via B4 Relay
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-12-01 7:00 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Alexandre Torgue, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: Chuanhong Guo, Russell King, linux-mips, netdev, devicetree,
linux-kernel, linux-arm-kernel, Joseph Telaak
From: Joseph Telaak <joseph@telaak.dev>
An Ethernet controller may take more from nvmem than its MAC address,
such as a factory calibration. Every MAC binding includes
ethernet-controller.yaml, which allows only the mac-address cell, so no
binding can add a cell of its own.
Allow a second cell after mac-address, which the device's binding names
and describes. The first user is the Siflower SF19A2890 GMAC, whose
RGMII delay lines are calibrated per unit at the factory.
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
.../devicetree/bindings/net/ethernet-controller.yaml | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
index 30b2a335116e..da27ff8012eb 100644
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
@@ -22,12 +22,17 @@ properties:
Specifies maximum speed in Mbit/s supported by the device.
nvmem-cells:
- maxItems: 1
+ minItems: 1
+ maxItems: 2
description:
- Reference to an nvmem node for the MAC address
+ Reference to an nvmem node for the MAC address, then optionally to a
+ cell that the device's own binding describes
nvmem-cell-names:
- const: mac-address
+ minItems: 1
+ items:
+ - const: mac-address
+ - description: Named by the device's own binding
phy-connection-type:
description:
--
Git-155)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-02 8:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <sashiko-outbox-245013@kernel.org>
2026-12-02 8:12 ` [PATCH net-next v2 1/3] dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell Joseph Telaak
2026-12-01 7:00 [PATCH net-next v2 0/3] net: stmmac: Add the Siflower SF19A2890 glue Joseph Telaak via B4 Relay
2026-12-01 7:00 ` [PATCH net-next v2 1/3] dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell Joseph Telaak via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox