Thread (6 messages) 6 messages, 3 authors, 2025-07-25

Re: [PATCH] arm64: dts: rockchip: use MAC TX delay for ROCK 4D

From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-07-25 12:21:32
Also in: linux-devicetree, linux-rockchip, lkml

quoted
Have you tried "rgmii-id" and small values for tx_delay? If the
hardware needs 2.1ns, for example, the MAC could add 0.1ns and the PHY
adds the default 2ns. That would allow you to conform to the DT
binding.
The MAC code (drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c) looks
like this, so "rgmii-id" results in no MAC delays being applied:

	case PHY_INTERFACE_MODE_RGMII:
		bsp_priv->ops->set_to_rgmii(bsp_priv, bsp_priv->tx_delay,
					    bsp_priv->rx_delay);
		break;
	case PHY_INTERFACE_MODE_RGMII_ID:
		bsp_priv->ops->set_to_rgmii(bsp_priv, 0, 0);
		break;
	case PHY_INTERFACE_MODE_RGMII_RXID:
		bsp_priv->ops->set_to_rgmii(bsp_priv, bsp_priv->tx_delay, 0);
		break;
	case PHY_INTERFACE_MODE_RGMII_TXID:
		bsp_priv->ops->set_to_rgmii(bsp_priv, 0, bsp_priv->rx_delay);
		break;
    ...

Also the default values (if properties are missing in DT) are
rx_delay=0x10 and tx_delay=0x30, so changing this logic risks
breaking some boards :(
Just as an experiment, could you enable setting delays for
PHY_INTERFACE_MODE_RGMII_ID and see if small values do work for you.

If they do, we can then figure out a way to actually do it without
breaking other boards.

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help