]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/phy/phy.c
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[u-boot] / drivers / net / phy / phy.c
index 6fe793de5daf951e6e0f6c334931d48efa843840..62925bb2863225056d414c3283fc94a534d8f1b0 100644 (file)
@@ -277,7 +277,7 @@ int genphy_parse_link(struct phy_device *phydev)
        /* We're using autonegotiation */
        if (mii_reg & BMSR_ANEGCAPABLE) {
                u32 lpa = 0;
-               u32 gblpa = 0;
+               int gblpa = 0;
                u32 estatus = 0;
 
                /* Check for gigabit capability */
@@ -286,6 +286,10 @@ int genphy_parse_link(struct phy_device *phydev)
                         * both PHYs in the link
                         */
                        gblpa = phy_read(phydev, MDIO_DEVAD_NONE, MII_STAT1000);
+                       if (gblpa < 0) {
+                               debug("Could not read MII_STAT1000. Ignoring gigabit capability\n");
+                               gblpa = 0;
+                       }
                        gblpa &= phy_read(phydev,
                                        MDIO_DEVAD_NONE, MII_CTRL1000) << 2;
                }