public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] phylib: Work around bug in Teranetics PHY
@ 2011-10-05 19:00 Timur Tabi
  2011-10-05 19:00 ` [U-Boot] [PATCH 2/3] phylib: wait for TN2020 to achieve SERDES lane alignment at startup Timur Tabi
  2011-10-05 19:00 ` [U-Boot] [PATCH 3/3] powerpc/85xx: wait for alignment before resetting SERDES RX lanes (SERDES9) Timur Tabi
  0 siblings, 2 replies; 6+ messages in thread
From: Timur Tabi @ 2011-10-05 19:00 UTC (permalink / raw)
  To: u-boot

From: Andy Fleming <afleming@freescale.com>

The Teranetics PHY does not properly report the link state
for fiber connections. The new PHY code actually checked the link,
and so the FM driver would refuse to talk over a linkless PHY.

But the link may actually be up, so now we always report it as up
for fiber connections on the tn2020.

Signed-off-by: Andy Fleming <afleming@freescale.com>
---
 drivers/net/phy/teranetics.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/teranetics.c b/drivers/net/phy/teranetics.c
index a771791..5932bf0 100644
--- a/drivers/net/phy/teranetics.c
+++ b/drivers/net/phy/teranetics.c
@@ -20,7 +20,7 @@
  * author Andy Fleming
  *
  */
-#include <config.h>
+#include <common.h>
 #include <phy.h>
 
 #ifndef CONFIG_PHYLIB_10G
@@ -41,6 +41,25 @@ int tn2020_config(struct phy_device *phydev)
 	return 0;
 }
 
+int tn2020_startup(struct phy_device *phydev)
+{
+	if (phydev->port != PORT_FIBRE)
+		return gen10g_startup(phydev);
+
+	/*
+	 * The TN2020 only pretends to support fiber.
+	 * It works, but it doesn't look like it works,
+	 * so the link status reports no link.
+	 */
+	phydev->link = 1;
+
+	/* For now just lie and say it's 10G all the time */
+	phydev->speed = SPEED_10000;
+	phydev->duplex = DUPLEX_FULL;
+
+	return 0;
+}
+
 struct phy_driver tn2020_driver = {
 	.name = "Teranetics TN2020",
 	.uid = 0x00a19410,
@@ -50,7 +69,7 @@ struct phy_driver tn2020_driver = {
 			MDIO_DEVS_PHYXS | MDIO_DEVS_AN |
 			MDIO_DEVS_VEND1 | MDIO_DEVS_VEND2),
 	.config = &tn2020_config,
-	.startup = &gen10g_startup,
+	.startup = &tn2020_startup,
 	.shutdown = &gen10g_shutdown,
 };
 
-- 
1.7.3.4

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

end of thread, other threads:[~2011-10-06 22:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-05 19:00 [U-Boot] [PATCH 1/3] phylib: Work around bug in Teranetics PHY Timur Tabi
2011-10-05 19:00 ` [U-Boot] [PATCH 2/3] phylib: wait for TN2020 to achieve SERDES lane alignment at startup Timur Tabi
2011-10-05 19:00 ` [U-Boot] [PATCH 3/3] powerpc/85xx: wait for alignment before resetting SERDES RX lanes (SERDES9) Timur Tabi
2011-10-06 21:03   ` Wolfgang Denk
2011-10-06 21:07     ` Timur Tabi
2011-10-06 22:21       ` Wolfgang Denk

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