Commit bdb59f94 authored by Trent Piepho's avatar Trent Piepho Committed by Jeff Garzik

gianfar: Don't reset TBI<->SerDes link if it's already up

The link may be up already via the chip's reset strapping, or though action
of U-Boot, or from the last time the interface was brought up.  Resetting
the link causes it to go down for several seconds.  This can significantly
increase the time from power-on to DHCP completion and a device being
accessible to the network.
Signed-off-by: default avatarTrent Piepho <tpiepho@freescale.com>
Acked-by: default avatarAndy Fleming <afleming@freescale.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent c132419e
...@@ -591,6 +591,14 @@ static void gfar_configure_serdes(struct net_device *dev) ...@@ -591,6 +591,14 @@ static void gfar_configure_serdes(struct net_device *dev)
if (bus) if (bus)
mutex_lock(&bus->mdio_lock); mutex_lock(&bus->mdio_lock);
/* If the link is already up, we must already be ok, and don't need to
* configure and reset the TBI<->SerDes link. Maybe U-Boot configured
* everything for us? Resetting it takes the link down and requires
* several seconds for it to come back.
*/
if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS)
goto done;
/* Single clk mode, mii mode off(for serdes communication) */ /* Single clk mode, mii mode off(for serdes communication) */
gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT);
...@@ -601,6 +609,7 @@ static void gfar_configure_serdes(struct net_device *dev) ...@@ -601,6 +609,7 @@ static void gfar_configure_serdes(struct net_device *dev)
gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE |
BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000);
done:
if (bus) if (bus)
mutex_unlock(&bus->mdio_lock); mutex_unlock(&bus->mdio_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment