diff options
authorMax Krummenacher <>2015-12-09 15:38:17 +0100
committerMarcel Ziswiler <>2015-12-15 13:44:12 +0100
commit3473c2e3e88f4a2046a24f164d7d67ad5db27b1e (patch)
parent24fa00c8b43358ea4bf9c1200d209656c36f27e1 (diff)
phy.c: clear flags for special PHY modes on phy_reset
Clear the following flags on SW reset: BMCR_PDOWN|BMCR_LOOPBACK|BMCR_CTST They are cleared by a HW/POR reset but not if the PHY goes through a SW reset. If the BMCR_PDOWN bit is set on reboot U-Boot fails to use Ethernet otherwise. Steps to reproduce the issue without the patch (from within Linux): Don't use phy_reset or use the unpatched version in U-Boot. Then: ip link set down eth0 reboot stop in U-Boot ping <connected host> -> Link stays down, a ping to a valid address does fail. Signed-off-by: Max Krummenacher <> Acked-by: Marcel Ziswiler <>
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index df7e9450c2..48e86d76af 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -696,6 +696,12 @@ int phy_reset(struct phy_device *phydev)
reg |= BMCR_RESET;
+#ifdef CONFIG_MX6
+ /* at least on a Micrel KSZ8041 the following bits do not get
+ * cleared by a SW reset, but they should */
if (phy_write(phydev, devad, MII_BMCR, reg) < 0) {
debug("PHY reset failed\n");
return -1;