summaryrefslogtreecommitdiffstats
path: root/drivers/qe
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/qe')
-rw-r--r--drivers/qe/uec.c4
-rw-r--r--drivers/qe/uec_phy.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index e10c0f328c..48033d750c 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -1223,8 +1223,10 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
i = 50;
do {
err = curphy->read_status(uec->mii_info);
+ if (!(((i-- > 0) && !uec->mii_info->link) || err))
+ break;
udelay(100000);
- } while (((i-- > 0) && !uec->mii_info->link) || err);
+ } while (1);
if (err || i <= 0)
printf("warning: %s: timeout on PHY link\n", dev->name);
diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index 2d3a896d6f..9be784e6ad 100644
--- a/drivers/qe/uec_phy.c
+++ b/drivers/qe/uec_phy.c
@@ -351,6 +351,15 @@ static int marvell_config_aneg (struct uec_mii_info *mii_info)
static int genmii_config_aneg (struct uec_mii_info *mii_info)
{
if (mii_info->autoneg) {
+ /* Speed up the common case, if link is already up, speed and
+ duplex match, skip auto neg as it already matches */
+ if (!genmii_read_status(mii_info) && mii_info->link)
+ if (mii_info->duplex == DUPLEX_FULL &&
+ mii_info->speed == SPEED_100)
+ if (mii_info->advertising &
+ ADVERTISED_100baseT_Full)
+ return 0;
+
config_genmii_advert (mii_info);
genmii_restart_aneg (mii_info);
} else
@@ -389,7 +398,6 @@ static int genmii_update_link (struct uec_mii_info *mii_info)
status = phy_read(mii_info, PHY_BMSR);
}
mii_info->link = 1;
- udelay(500000); /* another 500 ms (results in faster booting) */
} else {
if (status & PHY_BMSR_LS)
mii_info->link = 1;
OpenPOWER on IntegriCloud