From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796108429; b=OgCdHt6N45KvJWahfadG3/ec85AM96irQtHg0yIDikJP9TFhGPS9YYS5PDp8lyO0zN9J eBaN9mgwC8AUjYXKJCngEPtJOVwb0jS6jcY4psNtMMIbvX9jW/TYYNEBUPe/k0O3dGapY hP2kjd1JA8/x7iiSB7FoeQ2sXxteCmLQ0m7TxkLWc5AkhxnedW41yTc7Y+QxuSDzpxEVf yt+pM+mXtFlXz1rn67oMJSFfFxoEK7sB5gDeTG7yyCYJ7Dn7FaSyZle/j+aN027MeuyiC v3KpZpOz0Lh5VwFLrZQpU1ZMzslwA47oc0RTnVyao1lVKFxafR3XK2tjw7OWDUurNIg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796108429; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=MSPr7y2+vb74gXoqOe0TlQTo9HJ/G3A02K+drsXrD5Q=; b=np+vWTSUWfJ92PKhBqE622VMHYw3VeJXCsFA5GRmxroak64jIKxV3TjqIg/4/pVJOATL p6mVEWKvRt165ZPXNqgycZMnp27otsgsceV4OOMJzWMqP66hVFzhVF1VJyrc1HbKobIip uSPnnNiPcY7e7hhw7LG8wLhwmx7U8x7ud6a3Rlg/K6+otBQS+uJ7wY9dOcwH8IFOEWnHv 79YkOJPnrIkopEHAZ5MBCI2gfFvA2fPzCUYefdUOrPFfJezo25xdZUSaCS5/R21Fh17Hi Kj29XnB/rwjybZLMCjC8nA36InoJ3IUxO5aHKfC/n3us/ZpcdPmB8onsB10dctYybJw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eAmbLU0W; arc=fail smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 330C1606A689; Tue, 1 Dec 2026 07:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eAmbLU0W Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796108429; b=LhjMK6i6PWPiIpB2/wDffeoYbnuphQP0tsHGJhf5+0SMy6OJOTawxQR/8TXZrkJPj617 6Za2qG0mhfFiycful8bABrYhkZrQVTIVumbJlcqOX1FwnGt64LMLe5lblJJCt5FqLkRXz nkHGs3lAwMVuXMZFVa3QiDNUNLEctd9Cy4myvj5U2hp70Qizgil7mw1wusCxGlxvDLlEB d8JYJs/B/lyy48ADwejDzO/60tSGjxHYGx5FhM2zy3NlwNorlV5QXti46ropxzkOJasHQ mD92falqOaalRbHaRv98e/uz0v+AO8lAWy37a7kGIF8tVAzpgmZQLNPMcPkk9/chhJA== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796108429; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=MSPr7y2+vb74gXoqOe0TlQTo9HJ/G3A02K+drsXrD5Q=; b=Mos2dhrX5ltjPvs7YttwP0Rrd+Km1F9Ax+W4Wv4/G4S+2YxoBgUJY1sIliNdmH1hNPkf ppZb74CplC2SvFrbsa98qJV+6EZJX8wBu1AoU/TvSCixfp7Ok8TECpEuvegO/COVG2J2p rRWNvLSiuCpnsrf5kZ27GZvEjJ25z+dY/GNmZOdJFYwppiamxLA3WnTuZouurOw8x72OI pCWv3Fms/pTnSTKIWTcLAMoZNMqq4w+M8IrLvFKOqXxHDCuZBzRN2I0Nc/dCdzT+64Qoq cDFsnGIYTcYfQjLmjvPKijeQWGbNhfPDbhL0yv3rtSNcHr0F8bOnM6+bo1nObC36low== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 2D75C1F000C1; Tue, 1 Dec 2026 07:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796108428; bh=MSPr7y2+vb74gXoqOe0TlQTo9HJ/G3A02K+drsXrD5Q=; h=From:Subject:Date:To:Cc:Reply-To; b=eAmbLU0W/oe7P0zsqiCP5YpfetqKfRdkUJzsoRTQ6frqaT1VPDh4FVCjhoVo9S8Uh TUsoVlNTuLTfrJMOBI8hTWtfT2mtNVa3JuMB1CI3S6ccKjoc65P/ga6OpPD601jzOJ aHvRL8OJ0Jm1bPnjzkRQxBrFZdWX2DTLyQgUxUVbaIPr8bF+qnvesIKFdmFYeMCDMG EdsVXeYjWIHCdXeZh/ymiQc7hv8A+ldxtzElh7Bc88pyV+l21PFfqpHxAIkr0auqbH GnV8Ghq/nuJHLkveXQU8P53uhgIeevg19Z+rtQH9XMkmNHDCaZv5EPNxHH9iLd2LmU mIvYX5rOuYeZA== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 847764EC1D; Tue, 1 Dec 2026 07:00:27 +0000 (UTC) From: Joseph Telaak via B4 Relay Subject: [PATCH net-next v2 0/3] net: stmmac: Add the Siflower SF19A2890 glue Date: Tue, 01 Dec 2026 02:00:24 -0500 Message-Id: <20261201-sf19a2890-gmac-v2-0-8d2c513db496@telaak.dev> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAIhwDmsC/12Oyw6DIBBFf6WZdWmAoIWu+h+NC8RB6UNbQGNj/ PfiY9Xlzdx7zkwQ0DsMcDlM4HFwwXVtCvx4ANPotkbiqpSBU54zRjkJlinNpaKkfmlDhC2FpNL KXBlIo7dH68YVeIMWI2lxjFBsl9CXdzRx4e1dj58+OeM2WGqNC7Hz3/Whga2Y3S3+3QMjlGiWq TzTQmVncY341PpxqnCAYp7nH1xPi+XeAAAA X-Change-ID: 20261102-sf19a2890-gmac-4fb4808f869c 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@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Joseph Telaak X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796108426; l=6235; i=joseph@telaak.dev; s=20261104; h=from:subject:message-id; bh=t6t1ru5VaVb5Q5TCh0IcBf3h4I1iawP4xAYxXAeXo0M=; b=CBPmD+OxM7zcdsiNc76ByDZw6wTcY0MNMKQ1TelyThUOqZqoUZ1eatshIFA/XD7PeMowBkpfQ TZ4q8EjGNctBs2QegS21Ajcs7cm9CgEfjh0mbUlJFarVmDyQSzQb6ov X-Developer-Key: i=joseph@telaak.dev; a=ed25519; pk=oQI+UfddlZ0wK2ac4WKOGNjUl1ZEN8j9ZVFSqEDoNP0= X-Endpoint-Received: by B4 Relay for joseph@telaak.dev/20261104 with auth_id=1404 X-Original-From: Joseph Telaak Reply-To: joseph@telaak.dev 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