Re: [PATCH net-next v6 3/5] net: ftgmac100: Add RGMII delay support for AST2600

From
Andrew Lunn <andrew@lunn.ch>
Date
2026-03-02 17:48:04
Also in
linux-arm-kernel, linux-aspeed, lkml, netdev
Reply to
Jacky Chou, 2026-03-02
On Mon, Mar 02, 2026 at 06:24:30PM +0800, Jacky Chou wrote:
On the AST2600 platform, the RGMII delay is controlled via the
SCU registers. The delay chain configuration differs between MAC0/1
and MAC2/3, even though all four MACs use a 32-stage delay chain.
+------+----------+-----------+-------------+-------------+
|      |Delay Unit|Delay Stage|TX Edge Stage|RX Edge Stage|
+------+----------+-----------+-------------+-------------+
|MAC0/1|     45 ps|        32 |           0 |           0 |
+------+----------+-----------+-------------+-------------+
|MAC2/3|    250 ps|        32 |           0 |          26 |
+------+----------+-----------+-------------+-------------+
For MAC2/3, the "no delay" condition starts from stage 26.
Setting the RX delay stage to 26 means that no additional RX
delay is applied.
Here lists the RX delay setting of MAC2/3 below.
26 -> 0   ns, 27 -> 0.25 ns, ... , 31 -> 1.25 ns,
0  -> 1.5 ns, 1  -> 1.75 ns, ... , 25 -> 7.75 ns

Therefore, we calculate the delay stage from the
rx-internal-delay-ps of MAC2/3 to add 26. If the stage is equel
to or bigger than 32, the delay stage will be mask 0x1f to get
the correct setting.
Please return -EINVAL. Asking for more than 7.75ns is clearly broken.

    Andrew

---
pw-bot: cr
Thread (21 messages) 21 messages, 2 authors, last reply 2026-03-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help