diff mbox

[U-Boot] phylib: Work around bug in Teranetics PHY

Message ID 1313532507-3584-1-git-send-email-afleming@freescale.com
State Accepted
Commit ebfdacb42b5e29ed847a8bee05affc24e3d4eb10
Delegated to: Kumar Gala
Headers show

Commit Message

Andy Fleming Aug. 16, 2011, 10:08 p.m. UTC
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 |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

Comments

Kumar Gala Oct. 7, 2011, 2:53 p.m. UTC | #1
On Aug 16, 2011, at 5:08 PM, Andy Fleming wrote:

> 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 |   21 ++++++++++++++++++++-
> 1 files changed, 20 insertions(+), 1 deletions(-)

applied to 85xx

- k
diff mbox

Patch

diff --git a/drivers/net/phy/teranetics.c b/drivers/net/phy/teranetics.c
index a771791..a13b48c 100644
--- a/drivers/net/phy/teranetics.c
+++ b/drivers/net/phy/teranetics.c
@@ -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,
 };