net: phy: bcm7xxx: workaround MDIO management controller initial read
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 26 Jun 2015 17:39:04 +0000 (10:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jun 2015 03:28:20 +0000 (20:28 -0700)
The initial MDIO read or write towards the BCM7xxx integrated PHY may
fail, workaround this by inserting a dummy MII_BMSR read to force the
MDIO management controller to see at least one valid transaction and get
out of stuck state out of reset.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/bcm7xxx.c

index 4dea85bfc545b86d5874031531a9ce4963facbe2..6b701b3ded749642b6cdf2309e7b25d2b373ed37 100644 (file)
@@ -246,6 +246,13 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
        pr_info_once("%s: %s PHY revision: 0x%02x, patch: %d\n",
                     dev_name(&phydev->dev), phydev->drv->name, rev, patch);
 
+       /* Dummy read to a register to workaround an issue upon reset where the
+        * internal inverter may not allow the first MDIO transaction to pass
+        * the MDIO management controller and make us return 0xffff for such
+        * reads.
+        */
+       phy_read(phydev, MII_BMSR);
+
        switch (rev) {
        case 0xb0:
                ret = bcm7xxx_28nm_b0_afe_config_init(phydev);
This page took 0.025279 seconds and 5 git commands to generate.