]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: phy: dp83867: reset PHY on init to ensure clean state
authorPranav Tilak <pranav.vinaytilak@amd.com>
Wed, 25 Mar 2026 15:36:34 +0000 (16:36 +0100)
committerJerome Forissier <jerome.forissier@arm.com>
Tue, 31 Mar 2026 14:54:49 +0000 (16:54 +0200)
After a warm reboot, the PHY is left in power-down state
(BMCR_PDOWN set) causing auto-negotiation to timeout when
running the dhcp command.

Fix this by calling phy_reset() in dp83867_config() which
brings the PHY to a known clean state. The existing
DP83867_SW_RESTART is removed as it is redundant after phy_reset().

Fixes: 721aed79126b ("net: phy: Add support for Texas Instruments DP83867")
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
drivers/net/phy/dp83867.c

index 772cde1c520cd20f656cccb7b2370615176798f1..7ce03b59b6aba17f674a53d1e882939af564e5b6 100644 (file)
@@ -257,14 +257,14 @@ static int dp83867_config(struct phy_device *phydev)
 
        dp83867 = (struct dp83867_private *)phydev->priv;
 
-       ret = dp83867_of_init(phydev);
+       /* Reset PHY to clear any stale state after warm reboot */
+       ret = phy_reset(phydev);
        if (ret)
                return ret;
 
-       /* Restart the PHY.  */
-       val = phy_read(phydev, MDIO_DEVAD_NONE, DP83867_CTRL);
-       phy_write(phydev, MDIO_DEVAD_NONE, DP83867_CTRL,
-                 val | DP83867_SW_RESTART);
+       ret = dp83867_of_init(phydev);
+       if (ret)
+               return ret;
 
        /* Mode 1 or 2 workaround */
        if (dp83867->rxctrl_strap_quirk) {