[U-Boot] [PATCH 5/5] tsec: Add TSEC_FIBER flag

Peter Tyser ptyser at xes-inc.com
Mon Nov 9 20:09:48 CET 2009


The TSEC_FIBER flag should be set when a PHY is operating with an
external fiber interface.  Currently it is only used to notify a user
that the PHY is operating in fiber mode.

A short description was also added to the other TSEC flag defines so
that it is clear how they differ from one another.

Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
 drivers/net/tsec.c |    6 ++++--
 include/tsec.h     |    6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 2f41024..618dadd 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -616,6 +616,7 @@ static uint mii_parse_BCM5482_sr(uint mii_reg, struct tsec_private *priv)
 {
 	if (BCM8482_is_serdes(priv)) {
 		mii_parse_BCM5482_serdes_sr(priv);
+		priv->flags |= TSEC_FIBER;
 	} else {
 		/* Wait for auto-negotiation to complete or fail */
 		mii_parse_sr(mii_reg, priv);
@@ -939,8 +940,9 @@ static void adjust_link(struct eth_device *dev)
 			break;
 		}
 
-		printf("Speed: %d, %s duplex\n", priv->speed,
-		       (priv->duplexity) ? "full" : "half");
+		printf("Speed: %d, %s duplex%s\n", priv->speed,
+		       (priv->duplexity) ? "full" : "half",
+		       (priv->flags & TSEC_FIBER) ? ", fiber mode" : "");
 
 	} else {
 		printf("%s: No link.\n", dev->name);
diff --git a/include/tsec.h b/include/tsec.h
index b2e37d4..1e90365 100644
--- a/include/tsec.h
+++ b/include/tsec.h
@@ -584,9 +584,9 @@ typedef struct tsec
 
 /* This flag currently only has
  * meaning if we're using the eTSEC */
-#define TSEC_REDUCED	(1 << 1)
-
-#define TSEC_SGMII	(1 << 2)
+#define TSEC_REDUCED	(1 << 1)	/* MAC-PHY interface uses RGMII */
+#define TSEC_SGMII	(1 << 2)	/* MAC-PHY interface uses SGMII */
+#define TSEC_FIBER	(1 << 3)	/* PHY uses fiber, eg 1000 Base-X */
 
 struct tsec_private {
 	volatile tsec_t *regs;
-- 
1.6.2.1



More information about the U-Boot mailing list