]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
net: phy: marvell: Fix init function for m88e1145
authorYork Sun <york.sun@nxp.com>
Tue, 6 Jun 2017 16:22:40 +0000 (09:22 -0700)
committerYork Sun <york.sun@nxp.com>
Mon, 12 Jun 2017 19:18:14 +0000 (12:18 -0700)
Commit a058052c changed the generic phy_reset() to clear all bits in
BMCR. This inevitably clears the ANEG bit. m88e1145 requires any
change to ANEG bit to be followed by a software reset. This seems to
be different from other PHYs. Implement read-modify-write procedure
for this PHY init.

Signed-off-by: York Sun <york.sun@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/phy/marvell.c

index 8041922a02dc6ff533536dd5c96a0df3cfdd0438..b7f300e40f2798c09bfa697d8edc860007fe4c17 100644 (file)
@@ -482,7 +482,10 @@ static int m88e1145_config(struct phy_device *phydev)
 
        genphy_config_aneg(phydev);
 
-       phy_reset(phydev);
+       /* soft reset */
+       reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
+       reg |= BMCR_RESET;
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, reg);
 
        return 0;
 }