From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Icenowy Zheng <uwu@icenowy.me>
Cc: Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Chaoyi Chen <chaoyi.chen@rock-chips.com>,
Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] dt-bindings: net: ethernet-controller: Add informative text about RGMII delays
Date: Fri, 13 Jun 2025 09:35:48 +0100 [thread overview]
Message-ID: <aEvi5DTBj-cltE5w@shell.armlinux.org.uk> (raw)
In-Reply-To: <40fc8f3fec4da0ed2b59e8d2612345fb42b1fdd3.camel@icenowy.me>
On Fri, Jun 13, 2025 at 04:01:37PM +0800, Icenowy Zheng wrote:
> 在 2025-06-11星期三的 17:28 +0200,Andrew Lunn写道:
> > > 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.
>
> Thus if the MAC delay is set to 1xxx ps (e.g. 1800ps), should the MAC
> do the masking?
>
> What should be the threshold? 1ns?
Why should there be a "threshold" ? It's really a case by case issue
where the capabilities of the hardware need to be provided and
considered before a decision can be made.
In order to first understand this, one needs to understand the
requirements of RGMII. RGMII v1.3 states:
Symbol Parameter Min Typ Max Units
TskewT Data to Clock output -500 0 500 ps
skew at clock tx
TskewR Data to Clock input 1 2.6 ns
skew at clock rx
The RGMII specification is written based upon the clock transmitter
and receiver having no built-in delays, and the delay is achieved
purely by trace routing. So, where delays are provided by the
transmitter or receiver (whether that's the MAC or the PHY depends
on whether TXC or RXC is being examined) these figures need to be
thought about.
However, the range for the delay at the receiver is -1ns to +0.6ns.
In your example, you're talking about needing a 1800ps delay. I
would suggest that, *assuming the PCB tracks introduce a 200ps skew
between the data and clock*, then using the PHY's built-in 2ns delay
is perfectly within the requirements of the RGMII specification.
That bit "assuming" is where the discussion needs to happen, and why
it would be case by case. If the skew due to trace routing were
800ps, then enabling the PHY's built-in 2ns delay would take the
delay out of spec.
Thrown into this would also be temperature effects, so trying to get
to as near as the 2ns delay as possible is probably a good idea.
Lastly, there's the question whether the software engineer even
knows what the skew provided by the hardware actually is.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2025-06-13 8:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 16:21 [PATCH net v2] dt-bindings: net: ethernet-controller: Add informative text about RGMII delays Andrew Lunn
2025-05-01 14:28 ` Conor Dooley
2025-05-06 0:00 ` patchwork-bot+netdevbpf
2025-05-07 7:17 ` Matthias Schiffer
2025-06-04 10:52 ` Icenowy Zheng
2025-06-04 12:23 ` Andrew Lunn
2025-06-05 9:06 ` Icenowy Zheng
2025-06-05 9:41 ` Russell King (Oracle)
2025-06-05 10:51 ` Icenowy Zheng
2025-06-05 12:44 ` Russell King (Oracle)
2025-06-05 13:48 ` Andrew Lunn
2025-06-11 8:03 ` Icenowy Zheng
2025-06-11 8:39 ` Russell King (Oracle)
2025-06-11 12:11 ` Icenowy Zheng
2025-06-11 15:28 ` Andrew Lunn
2025-06-13 8:01 ` Icenowy Zheng
2025-06-13 8:35 ` Russell King (Oracle) [this message]
2025-06-13 8:43 ` Icenowy Zheng
2025-06-13 9:05 ` Russell King (Oracle)
2025-06-11 15:05 ` Andrew Lunn
2025-06-05 13:20 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aEvi5DTBj-cltE5w@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=chaoyi.chen@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=uwu@icenowy.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).