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

From
Jacky Chou <jacky_chou@aspeedtech.com>
Date
2026-03-05 04:45:38
Also in
linux-arm-kernel, linux-aspeed, linux-devicetree, lkml
Reply to
Andrew Lunn, 2026-03-04
quoted
quoted
quoted
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.
quoted
quoted
Please return -EINVAL. Asking for more than 7.75ns is clearly broken.
...
	tx_delay_index = DIV_ROUND_CLOSEST(rgmii_tx_delay,
rgmii_delay_unit);
quoted
	if (tx_delay_index >= 32) {
		dev_err(dev, "The %u ps of TX delay is out of range\n",
			rgmii_tx_delay);
		return -EINVAL;
	}

	rx_delay_index = DIV_ROUND_CLOSEST(rgmii_rx_delay,
rgmii_delay_unit);
quoted
	if (rx_delay_index >= 32) {
		dev_err(dev, "The %u ps of RX delay is out of range\n",
			rgmii_rx_delay);
		return -EINVAL;
	}
...

These codes will calculate the ns delay to MAC delay index.
(rgmii_delay_unit is 250 ps on MAC2/3) If set tx delay to 8 ns on MAC2
or MAC3, it will get index is 32.
It is over the delay configuration range, here will return -EINVAL.
So is the comment wrong? No masking is actually done?
Yes. I will update the comment in next version.
Thank you for reminding me.

Thanks,
Jacky
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