summaryrefslogtreecommitdiff
path: root/drivers/qe/uec_phy.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2010-08-10 16:36:49 +0200
committerBen Warren <biggerbadderben@gmail.com>2010-10-11 22:47:48 -0700
commitf29c181cd4a8bd39c256ac8cabb98055a9e672f3 (patch)
tree14148119f62d911e59bb7b09db8f3610e9d07652 /drivers/qe/uec_phy.c
parent68e1ede88a5d6a43beb425d8aa4ac97b850b5720 (diff)
downloadu-boot-imx-f29c181cd4a8bd39c256ac8cabb98055a9e672f3.zip
u-boot-imx-f29c181cd4a8bd39c256ac8cabb98055a9e672f3.tar.gz
u-boot-imx-f29c181cd4a8bd39c256ac8cabb98055a9e672f3.tar.bz2
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 <Joakim.Tjernlund@transmode.se> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/qe/uec_phy.c')
-rw-r--r--drivers/qe/uec_phy.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index 7ea2ae1..9be784e 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