Skip to content

Commit 4b451b5

Browse files
rubycommclaude
andcommitted
rockchip64: rk3528: fix ethernet PHY detection on NanoPi Zero2 (6.18 + 7.0)
Fix ethernet PHY not being detected on the NanoPi Zero2. The MDIO bus scan was failing because the PHY reset GPIO was only defined on the PHY child node inside the MDIO bus. The kernel processes this reset after the MDIO scan, but the PHY needs reset released before it will respond on the bus. Move the reset control to the gmac1 node using snps,reset-gpios and snps,reset-delays-us properties. The stmmac driver handles these during MDIO bus registration, before scanning for PHY devices. Also change CONFIG_MOTORCOMM_PHY from module (m) to built-in (y) in the rockchip64 kernel config. As a module, the PHY driver loads too late for the MDIO bus scan to find the PHY during boot. Tested on hardware: ethernet link at 1000Mbps full duplex confirmed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7336be8 commit 4b451b5

3 files changed

Lines changed: 97 additions & 1 deletion

File tree

config/kernel/linux-rockchip64-current.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ CONFIG_MARVELL_88X2222_PHY=m
906906
CONFIG_MAXLINEAR_GPHY=m
907907
CONFIG_MICREL_PHY=y
908908
CONFIG_MICROCHIP_T1_PHY=m
909-
CONFIG_MOTORCOMM_PHY=m
909+
CONFIG_MOTORCOMM_PHY=y
910910
CONFIG_NATIONAL_PHY=m
911911
CONFIG_NXP_C45_TJA11XX_PHY=m
912912
CONFIG_AT803X_PHY=m
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Shlomi Marco <s.marco@rubycomm.com>
3+
Date: Wed, 26 Mar 2026 00:00:00 +0000
4+
Subject: arm64: dts: rockchip: nanopi-zero2: fix ethernet PHY reset
5+
6+
Move the Ethernet PHY reset control from the MDIO bus PHY node to the
7+
GMAC controller node using the SNPS reset properties (snps,reset-gpios
8+
and snps,reset-delays-us). This ensures the PHY is properly reset by
9+
the GMAC driver during initialization, which is required for reliable
10+
link establishment on the NanoPi Zero2.
11+
12+
The per-PHY reset-gpios, reset-assert-us, reset-deassert-us, and their
13+
associated pinctrl properties in the MDIO PHY node are removed, as they
14+
are not handled by the generic PHY framework for RGMII PHYs.
15+
16+
Signed-off-by: Shlomi Marco <s.marco@rubycomm.com>
17+
---
18+
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 7 ++-----
19+
1 file changed, 2 insertions(+), 5 deletions(-)
20+
21+
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
22+
index 111111111111..222222222222 100644
23+
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
24+
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
25+
@@ -217,6 +217,8 @@
26+
pinctrl-0 = <&rgmii_miim>, <&rgmii_tx_bus2>, <&rgmii_rx_bus2>,
27+
<&rgmii_rgmii_clk>, <&rgmii_rgmii_bus>;
28+
status = "okay";
29+
+ snps,reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
30+
+ snps,reset-delays-us = <0 20000 100000>;
31+
};
32+
33+
&gpu {
34+
@@ -244,12 +246,7 @@
35+
&mdio1 {
36+
rgmii_phy: ethernet-phy@1 {
37+
compatible = "ethernet-phy-ieee802.3-c22";
38+
reg = <0x1>;
39+
- pinctrl-names = "default";
40+
- pinctrl-0 = <&gmac1_rstn_l>;
41+
- reset-assert-us = <20000>;
42+
- reset-deassert-us = <100000>;
43+
- reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
44+
};
45+
};
46+
47+
--
48+
Armbian
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Shlomi Marco <s.marco@rubycomm.com>
3+
Date: Wed, 26 Mar 2026 00:00:00 +0000
4+
Subject: arm64: dts: rockchip: nanopi-zero2: fix ethernet PHY reset
5+
6+
Move the Ethernet PHY reset control from the MDIO bus PHY node to the
7+
GMAC controller node using the SNPS reset properties (snps,reset-gpios
8+
and snps,reset-delays-us). This ensures the PHY is properly reset by
9+
the GMAC driver during initialization, which is required for reliable
10+
link establishment on the NanoPi Zero2.
11+
12+
The per-PHY reset-gpios, reset-assert-us, reset-deassert-us, and their
13+
associated pinctrl properties in the MDIO PHY node are removed, as they
14+
are not handled by the generic PHY framework for RGMII PHYs.
15+
16+
Signed-off-by: Shlomi Marco <s.marco@rubycomm.com>
17+
---
18+
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 7 ++-----
19+
1 file changed, 2 insertions(+), 5 deletions(-)
20+
21+
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
22+
index 111111111111..222222222222 100644
23+
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
24+
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
25+
@@ -217,6 +217,8 @@
26+
pinctrl-0 = <&rgmii_miim>, <&rgmii_tx_bus2>, <&rgmii_rx_bus2>,
27+
<&rgmii_rgmii_clk>, <&rgmii_rgmii_bus>;
28+
status = "okay";
29+
+ snps,reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
30+
+ snps,reset-delays-us = <0 20000 100000>;
31+
};
32+
33+
&gpu {
34+
@@ -244,12 +246,7 @@
35+
&mdio1 {
36+
rgmii_phy: ethernet-phy@1 {
37+
compatible = "ethernet-phy-ieee802.3-c22";
38+
reg = <0x1>;
39+
- pinctrl-names = "default";
40+
- pinctrl-0 = <&gmac1_rstn_l>;
41+
- reset-assert-us = <20000>;
42+
- reset-deassert-us = <100000>;
43+
- reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
44+
};
45+
};
46+
47+
--
48+
Armbian

0 commit comments

Comments
 (0)