diff options
author | David S. Miller <davem@davemloft.net> | 2008-10-31 03:17:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:17:34 -0400 |
commit | a1744d3bee19d3b9cbfb825ab316a101b9c9f109 (patch) | |
tree | c0e2324c09beca0eb5782eb5abf241ea2b7a4a11 /drivers/net/gianfar.c | |
parent | 275f165fa970174f8a98205529750e8abb6c0a33 (diff) | |
parent | a432226614c5616e3cfd211e0acffa0acfb4770c (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/p54/p54common.c
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 15c422387028..013525f3c3bd 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -584,6 +584,18 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
584 | struct gfar_mii __iomem *regs = | 584 | struct gfar_mii __iomem *regs = |
585 | (void __iomem *)&priv->regs->gfar_mii_regs; | 585 | (void __iomem *)&priv->regs->gfar_mii_regs; |
586 | int tbipa = gfar_read(&priv->regs->tbipa); | 586 | int tbipa = gfar_read(&priv->regs->tbipa); |
587 | struct mii_bus *bus = gfar_get_miibus(priv); | ||
588 | |||
589 | if (bus) | ||
590 | mutex_lock(&bus->mdio_lock); | ||
591 | |||
592 | /* If the link is already up, we must already be ok, and don't need to | ||
593 | * configure and reset the TBI<->SerDes link. Maybe U-Boot configured | ||
594 | * everything for us? Resetting it takes the link down and requires | ||
595 | * several seconds for it to come back. | ||
596 | */ | ||
597 | if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS) | ||
598 | goto done; | ||
587 | 599 | ||
588 | /* Single clk mode, mii mode off(for serdes communication) */ | 600 | /* Single clk mode, mii mode off(for serdes communication) */ |
589 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); | 601 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); |
@@ -594,6 +606,10 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
594 | 606 | ||
595 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | | 607 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | |
596 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); | 608 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); |
609 | |||
610 | done: | ||
611 | if (bus) | ||
612 | mutex_unlock(&bus->mdio_lock); | ||
597 | } | 613 | } |
598 | 614 | ||
599 | static void init_registers(struct net_device *dev) | 615 | static void init_registers(struct net_device *dev) |