From: Joakim Tjernlund Date: Tue, 10 Aug 2010 14:36:49 +0000 (+0200) Subject: UEC PHY: Speed up initial PHY neg. X-Git-Tag: v2010.12-rc1~135^2~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f29c181cd4a8bd39c256ac8cabb98055a9e672f3;p=u-boot UEC PHY: Speed up initial PHY neg. Instead of always performing an autoneg, check if the PHY already has a link and if it matches one of the requested modes. Initially only 100MbFD is optimized this way. Signed-off-by: Joakim Tjernlund Signed-off-by: Ben Warren --- diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c index 7ea2ae1af7..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