Rockchip Ethernet "Cannot attach to PHY (error: -19)": Fix
stmmac_open: Cannot attach to PHY (error: -19)
The GMAC (stmmac) driver could not find the Ethernet PHY on the MDIO bus. -19 is ENODEV: the PHY never answered.
Applies to: RK3588 RK3588S RK3576 RK3568 RK3566 RK3399 RK3328 RK3288
Symptoms
- ip link set eth0 up fails, and dmesg shows "Cannot attach to PHY (error: -19)"
- No PHY ID under /sys/bus/mdio_bus/devices
Common causes
- PHY held in reset: wrong reset GPIO, polarity or too-short reset delays
- PHY unpowered or missing its 25 MHz crystal
- Wrong PHY address (reg) vs hardware straps
- MDIO/MDC pinctrl not applied
- phy-handle points at the wrong node
How to fix it
- See what the MDIO bus found
dmesg | grep -iE 'stmmac|dwmac|mdio|phy' cat /sys/bus/mdio_bus/devices/*/phy_id 2>/dev/null - Fix reset timing and address
&mdio0 { rgmii_phy: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22"; reg = <0x1>; /* must match PHY address straps */ reset-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_LOW>; reset-assert-us = <20000>; reset-deassert-us = <100000>; }; }; - Measure the hardware
Check PHY supply rails and the 25 MHz clock with a scope; confirm the reset line toggles at boot.
Go deeper
FAQ
What does "stmmac_open: Cannot attach to PHY (error: -19)" mean?
The GMAC (stmmac) driver could not find the Ethernet PHY on the MDIO bus. -19 is ENODEV: the PHY never answered.
What causes "stmmac_open: Cannot attach to PHY (error: -19)"?
PHY held in reset: wrong reset GPIO, polarity or too-short reset delays; PHY unpowered or missing its 25 MHz crystal; Wrong PHY address (reg) vs hardware straps; MDIO/MDC pinctrl not applied; phy-handle points at the wrong node.
How do I fix "stmmac_open: Cannot attach to PHY (error: -19)"?
1. See what the MDIO bus found 2. Fix reset timing and address 3. Measure the hardware: Check PHY supply rails and the 25 MHz clock with a scope; confirm the reset line toggles at boot.
Related issues
PCIe Link FailRockchip "PCIe Link Fail" / "Phy link never came up": NVMe Not DetectedLink is Up - 1Gbps/Full but no DHCP / no trafficRockchip Ethernet Link Up but No Traffic (RGMII tx_delay / rx_delay)rknn_init fail! ret=-6 (RKNN_ERR_MODEL_INVALID)RKNN "rknn_init fail! ret=-6" RKNN_ERR_MODEL_INVALID: FixRKNN_ERR_TARGET_PLATFORM_UNMATCH (-13)RKNN_ERR_TARGET_PLATFORM_UNMATCH (-13): Model Built for Another SoCVIDIOC_STREAMON returned -1 (Broken pipe)Rockchip Camera "VIDIOC_STREAMON returned -1 (Broken pipe)": Fix[drm] Cannot find any crtc or sizesRockchip HDMI No Display: "[drm] Cannot find any crtc or sizes"