lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mqoyjn7mnq6tmt6n6oev4wa3herjaxlupml2fmcampwiajvj4a@r5zs4d3jdm5p>
Date: Fri, 25 Jul 2025 07:24:01 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Andrew Lunn <andrew@...n.ch>
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

Hi,

On Thu, Jul 24, 2025 at 05:51:16PM +0200, Andrew Lunn wrote:
> >  &gmac0 {
> >  	clock_in_out = "output";
> >  	phy-handle = <&rgmii_phy0>;
> > -	phy-mode = "rgmii-id";
> > +	phy-mode = "rgmii-rxid";
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&eth0m0_miim
> >  		     &eth0m0_tx_bus2
> > @@ -246,6 +246,8 @@ &eth0m0_rgmii_clk
> >  		     &eth0m0_rgmii_bus
> >  		     &ethm0_clk0_25m_out>;
> >  	status = "okay";
> > +	tx_delay = <0x20>;
> > +	rx_delay = <0x00>;
> 
> What does 0x20 mean? Is it less than 2ns, or greater than 2ns?

Unfortunately I don't know. This part is not documented in the TRM I
have access to. Also my scope is not good enough for measuring
delays in the pico-second range. Previous measurements for RK3588
(RK3576 uses most of its IP and probably shared most of its quirks)
suggested, that mapping this to the standard properties may not
easily be possible:

https://lore.kernel.org/all/bb3486c6-93df-4453-acc6-deba3c8f7f0e@lunn.ch/

> 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 :(

> What PHY is this? Have you looked it you can control the delays the
> PHY adds? If you actually need a delay of 1.9ns, maybe the PHY can be
> configured to do this? That would also allow you to conform to the DT
> binding.

The Rock 4D uses a RTL8211F. As far as I can see that just offers
one delay control knob.

Greetings,

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ