Re: [PATCH net v2] dt-bindings: net: ethernet-controller: Add informative text about RGMII delays
From: Andrew Lunn
Date: Wed Jun 11 2025 - 11:29:08 EST
> Well in fact I have an additional question: when the MAC has any extra
> [tr]x-internal-delay-ps property, what's the threshold of MAC
> triggering patching phy mode? (The property might be only used for a
> slight a few hundred ps delay for tweak instead of the full 2ns one)
Maybe you should read the text.
The text says:
In the MAC node, the Device Tree properties 'rx-internal-delay-ps'
and 'tx-internal-delay-ps' should be used to indicate fine tuning
performed by the MAC. The values expected here are small. A value of
2000ps, i.e 2ns, and a phy-mode of 'rgmii' will not be accepted by
Reviewers.
So a few hundred ps delay is fine. The MAC is not providing the 2ns
delay, the PHY needs to do that, so you don't mask the value.
> > > Well I can't find the reason of phy-mode being so designed except
> > > for
> > > leaky abstraction from phylib.
> >
> > I have no idea what that sentence means, sorry.
>
> Well, I mean the existence of rgmii-* modes is coupled with the
> internal of phylib, did I get it right?
This is the external API of phylib, it has nothing to do with the
internals of phylib.
/**
* phy_attach - attach a network device to a particular PHY device
* @dev: network device to attach
* @bus_id: Bus ID of PHY device to attach
* @interface: PHY device's interface
*
* Description: Same as phy_attach_direct() except that a PHY bus_id
* string is passed instead of a pointer to a struct phy_device.
*/
struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
phy_interface_t interface)
interface tells the PHY how it should configure its interface.
If you follow the guidelines, the PHY adds the delay if needed, you
get interface == phy-mode. However, interface and phy-mode are
different things. phy-mode describes the hardware, the PCB. interface
tells the PHY what to do. There are legitimate cases where
interface != phy-mode.
Andrew