public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] UEC PHY: Speed up initial PHY neg.
@ 2010-08-10 14:36 Joakim Tjernlund
  2010-08-10 20:23 ` Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Joakim Tjernlund @ 2010-08-10 14:36 UTC (permalink / raw)
  To: u-boot

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>
---
 drivers/qe/uec_phy.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index 3baffe4..5237960 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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-09-13  4:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 14:36 [U-Boot] [PATCH] UEC PHY: Speed up initial PHY neg Joakim Tjernlund
2010-08-10 20:23 ` Mike Frysinger
2010-08-11  6:20   ` Joakim Tjernlund
2010-08-12 12:58 ` Detlev Zundel
2010-08-12 14:09   ` Joakim Tjernlund
2010-08-13  8:20     ` Detlev Zundel
2010-08-13 13:18       ` Joakim Tjernlund
2010-08-23  7:08       ` Ben Warren
2010-08-23  7:53         ` Joakim Tjernlund
2010-08-23 14:12           ` Ben Warren
2010-08-23 14:53             ` Joakim Tjernlund
2010-08-23 15:19         ` [U-Boot] Start/stop of network devices (was: Re: [PATCH] UEC PHY: Speed up initial PHY neg.) Detlev Zundel
2010-08-24 18:35           ` Joakim Tjernlund
2010-09-13  4:18 ` [U-Boot] [PATCH] UEC PHY: Speed up initial PHY neg Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox