Re: [PATCH] riscv: dts: spacemit: k3-pico-itx: Fix non-functional ethernet TX timing
Inochi Amaoto <[email protected]>
| Newsgroups | dev.linux.lists.spacemit,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jun 09, 2026 at 08:24:46PM +0200, Andrew Rembrandt wrote: > On Tue, Jun 09, 2026 at 01:37:56 pm Inochi Amaoto wrote: > > You should set tx-internal-delay-ps of the phy instead of > > the controller. This is a phy in "rgmii-id" mode. > Thanks for the review. I don't think that works on this board, but > please let me know if I'm missing something. > > The PHY is a Realtek RTL8211F. Its driver only toggles the chip's fixed > ~2ns delay on/off from phy-mode, and per the datasheet that's a hardware > limit, not a driver one -- the RTL8211F has no tunable delay, so a ps > value on the PHY node has nothing to act on. > > The only configurable delay element on K3 is the SoC RGMII delay line, > and dwmac-spacemit programs it from tx-/rx-internal-delay-ps read off > the controller node (spacemit_dwmac_probe()), so that is where the > property has to live to take effect. This is the MAC "fine tuning ... > values expected here are small" case described in > Documentation/devicetree/bindings/net/ethernet-controller.yaml: the > RTL8211F supplies the fixed ~2ns via rgmii-id and the MAC adds a 400ps > trim on top. Ideally the PHY would own the delay, but as Andrew Lunn > noted reviewing dwmac-meson8b, that requires the PHY to implement a > configurable delay, which not all do. > > The already-merged k1-bananapi-f3 does the same thing: eth1 combines > phy-mode = "rgmii-id" with tx-internal-delay-ps = <250> on the > controller node (via the K1 EMAC rather than dwmac, but the same DT > pattern). > > Would you be OK keeping it on the controller given the above? Yes, it is good for me. > For v2 I can add an explicit rx-internal-delay-ps = <0> to match > the other SpacemiT boards (k1-bananapi-f3 included) and spell this > reasoning out in the commit message. > Do not do this, just leave the rx-internal-delay-ps untouched. For this patch Reviewed-by: Inochi Amaoto <[email protected]> Regards, Inochi.