aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 249541a1814b..83a5cb6aa23b 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -591,6 +591,14 @@ static void gfar_configure_serdes(struct net_device *dev)
591 if (bus) 591 if (bus)
592 mutex_lock(&bus->mdio_lock); 592 mutex_lock(&bus->mdio_lock);
593 593
594 /* If the link is already up, we must already be ok, and don't need to
595 * configure and reset the TBI<->SerDes link. Maybe U-Boot configured
596 * everything for us? Resetting it takes the link down and requires
597 * several seconds for it to come back.
598 */
599 if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS)
600 goto done;
601
594 /* Single clk mode, mii mode off(for serdes communication) */ 602 /* Single clk mode, mii mode off(for serdes communication) */
595 gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); 603 gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT);
596 604
@@ -601,6 +609,7 @@ static void gfar_configure_serdes(struct net_device *dev)
601 gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | 609 gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE |
602 BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); 610 BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000);
603 611
612 done:
604 if (bus) 613 if (bus)
605 mutex_unlock(&bus->mdio_lock); 614 mutex_unlock(&bus->mdio_lock);
606} 615}