[v3,2/7] arm64: dts: allwinner: orangepi-zero2: Let the PHY add the RX delay

Message ID 20261112-h616-zero2-dt-v3-2-1cd2664230c8@gmail.com (mailing list archive)
State New
Headers
Series arm64: dts: allwinner: h616: Orange Pi Zero2 fixes, GPU DVFS and GPU cooling |

Commit Message

Arun Iyengar via B4 Relay Nov. 12, 2026, 9:22 a.m. UTC
From: Arun Iyengar <aiyengar1990@gmail.com>

The Orange Pi Zero2 describes its RTL8211F link as "rgmii", with the
whole RX clock delay (3100 ps, the maximum the H616 EMAC syscon can
add) inserted by the MAC. With "rgmii" the Realtek PHY driver also
clears the PHY's own RX delay bit, so RX sampling relies on the MAC
delay alone and sits at the edge of the window.

On the board this shows up as intermittent boots with a dead receive
path, after cold and warm resets alike: the link comes up at
1000/full and frames are transmitted and seen by the peer, but nothing
is ever received and the EMAC raises no RX interrupt. All EMAC clock,
pinmux, drive strength and syscon registers are the same on good and
bad boots. On a bad boot, setting the PHY RX delay bit and clearing
the syscon RX delay restores reception at once, without a link reset.

Use "rgmii-rxid" (RX delay in the PHY, none in the MAC), as the Orange
Pi Zero3 with the same PHY already does, and as the vendor BSP does.
The 700 ps MAC TX delay is kept. With this change 10 of 10 cold boots
had a working receive path.

Fixes: 5a378f9f2b15 ("arm64: dts: allwinner: h616: Add OrangePi Zero 2 board support")
Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Chen-Yu Tsai Nov. 15, 2026, 10:51 a.m. UTC | #1
On Thu, Nov 12, 2026 at 5:22 PM Arun Iyengar via B4 Relay
<devnull+aiyengar1990.gmail.com@kernel.org> wrote:
>
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> The Orange Pi Zero2 describes its RTL8211F link as "rgmii", with the
> whole RX clock delay (3100 ps, the maximum the H616 EMAC syscon can
> add) inserted by the MAC. With "rgmii" the Realtek PHY driver also
> clears the PHY's own RX delay bit, so RX sampling relies on the MAC
> delay alone and sits at the edge of the window.
>
> On the board this shows up as intermittent boots with a dead receive
> path, after cold and warm resets alike: the link comes up at
> 1000/full and frames are transmitted and seen by the peer, but nothing
> is ever received and the EMAC raises no RX interrupt. All EMAC clock,
> pinmux, drive strength and syscon registers are the same on good and
> bad boots. On a bad boot, setting the PHY RX delay bit and clearing
> the syscon RX delay restores reception at once, without a link reset.
>
> Use "rgmii-rxid" (RX delay in the PHY, none in the MAC), as the Orange
> Pi Zero3 with the same PHY already does, and as the vendor BSP does.

Flagged by my review agent, and documents reviewed by me:

The Orange Pi Zero3 uses a different PHY, but the pin strapping is the
same, and has the same meaning: the PHY provides the RX delays, while
the MAC provides the TX delays.

I can fix up the commit message when applying.

> The 700 ps MAC TX delay is kept. With this change 10 of 10 cold boots
> had a working receive path.
>
> Fixes: 5a378f9f2b15 ("arm64: dts: allwinner: h616: Add OrangePi Zero 2 board support")
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> index f2e3300e078a..1fdf2d3c1a87 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> @@ -18,9 +18,9 @@ &cpu0 {
>  };
>
>  &emac0 {
> -       allwinner,rx-delay-ps = <3100>;
>         allwinner,tx-delay-ps = <700>;
> -       phy-mode = "rgmii";
> +       /* RX delay is added by the PHY, TX delay by the EMAC */
> +       phy-mode = "rgmii-rxid";
>         phy-supply = <&reg_dcdce>;
>  };
>
>
> --
> 2.55.0
>
>
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
index f2e3300e078a..1fdf2d3c1a87 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
@@ -18,9 +18,9 @@  &cpu0 {
 };
 
 &emac0 {
-	allwinner,rx-delay-ps = <3100>;
 	allwinner,tx-delay-ps = <700>;
-	phy-mode = "rgmii";
+	/* RX delay is added by the PHY, TX delay by the EMAC */
+	phy-mode = "rgmii-rxid";
 	phy-supply = <&reg_dcdce>;
 };