diff options
author | Heiko Schocher <hs@denx.de> | 2013-07-23 15:32:36 +0200 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-07-30 09:21:42 -0400 |
commit | f6d1f6e4a58edae4776937647381a43fea5e83a5 (patch) | |
tree | e9c2f7d57da0fb9740a105357f136cc25b12d706 /drivers/net/phy | |
parent | 486da22967474f3f72717883a4315fda46346897 (diff) | |
download | u-boot-f6d1f6e4a58edae4776937647381a43fea5e83a5.tar.gz u-boot-f6d1f6e4a58edae4776937647381a43fea5e83a5.tar.xz u-boot-f6d1f6e4a58edae4776937647381a43fea5e83a5.zip |
net, phy, cpsw: fix gigabit register access
accessing a lan9303 switch with the cpsw driver results in wrong
speed detection, as the switch sets the BMSR_ERCAP in BMSR
register, and follow read of the MII_STAT1000 register fails, as
the switch does not support it. Current code did not check,
if a phy_read() fails ... fix this.
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 6fe793de5d..62925bb286 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -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; } |