[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <add11c8d-34b1-476c-96b3-964eb2a3de6e@lunn.ch>
Date: Fri, 25 Jul 2025 14:21:17 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Heiko Stuebner <heiko@...ech.de>, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel@...labora.com
Subject: Re: [PATCH] arm64: dts: rockchip: use MAC TX delay for ROCK 4D
> > 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
Powered by blists - more mailing lists