From: Igor Velkov <redacted>
The ROCK Pi 4 GMAC node has no mdio subnode and no phy-handle, so stmmac
scans the whole MDIO bus. The RTL8211E answers at its strapped address 1
and at the Realtek broadcast address 0, so two phy_devices are created
for one chip, and the netdev attaches to the one at address 0.
On system suspend mdio_bus_phy_suspend() leaves the attached PHY to the
MAC (mac_managed_pm) but suspends the unattached one, which writes
BMCR_PDOWN into the same chip. With s2idle and a MAC Wake-on-LAN magic
packet, 17 of 40 cycles did not wake.
Describe the PHY at address 1 and point phy-handle at it, so only one
phy_device is created.
Tested on ROCK Pi 4A (RTL8211E), s2idle: one PHY on the bus; 40 of 40
cycles woke on a magic packet sent 15 s into sleep, and 35 of 35 more
woke from the expected source with magic packets sent after 5 s to
20 min, RTC alarms, and the two alternating. Later board revisions use
an RTL8211F; their schematics strap it to address 1 as well.
Fixes: 1b5715c602fd ("arm64: dts: rockchip: add ROCK Pi 4 DTS support")
Signed-off-by: Igor Velkov <redacted>
---
The deprecated snps,reset-* properties stay in the MAC node; moving the
reset to the PHY node is a separate change.
---
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
index a8ab043e4062..52de4a79e2f4 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
@@ -202,6 +202,7 @@ &gmac {
clock_in_out = "input";
phy-supply = <&vcc3v3_lan>;
phy-mode = "rgmii";
+ phy-handle = <&rgmii_phy>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;@@ -210,6 +211,16 @@ &gmac {
tx_delay = <0x28>;
rx_delay = <0x11>;
status = "okay";
+
+ mdio {
+ compatible = "snps,dwmac-mdio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ rgmii_phy: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
};
&gpu {
---
base-commit: d2abcbb905b0e4b2e06b257fa1e5bcf4faa6dbda
change-id: 20261025-rockpi4-gmac-phy-18f13c9c37fc
Best regards,
--
Igor Velkov [off-list ref]