From patchwork Wed Oct 5 19:00:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 117905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AF81DB700E for ; Thu, 6 Oct 2011 06:01:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E6B3A2944F; Wed, 5 Oct 2011 21:01:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y3tXeiuzpOv8; Wed, 5 Oct 2011 21:01:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D7FE92942E; Wed, 5 Oct 2011 21:01:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E661429423 for ; Wed, 5 Oct 2011 21:01:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZOXddObIwjrZ for ; Wed, 5 Oct 2011 21:01:05 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe005.messaging.microsoft.com [216.32.181.185]) by theia.denx.de (Postfix) with ESMTPS id A770A29404 for ; Wed, 5 Oct 2011 21:00:58 +0200 (CEST) Received: from mail206-ch1-R.bigfish.com (10.43.68.247) by CH1EHSOBE003.bigfish.com (10.43.70.53) with Microsoft SMTP Server id 14.1.225.22; Wed, 5 Oct 2011 19:00:56 +0000 Received: from mail206-ch1 (localhost.localdomain [127.0.0.1]) by mail206-ch1-R.bigfish.com (Postfix) with ESMTP id 2976017603E2; Wed, 5 Oct 2011 19:00:56 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-SS: 13, Received: from mail206-ch1 (localhost.localdomain [127.0.0.1]) by mail206-ch1 (MessageSwitch) id 131784125636737_23198; Wed, 5 Oct 2011 19:00:56 +0000 (UTC) Received: from CH1EHSMHS002.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.250]) by mail206-ch1.bigfish.com (Postfix) with ESMTP id 042A11A38054; Wed, 5 Oct 2011 19:00:56 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS002.bigfish.com (10.43.70.2) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 5 Oct 2011 19:00:53 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.323.7; Wed, 5 Oct 2011 14:00:52 -0500 Received: from efes.am.freescale.net (efes.am.freescale.net [10.82.123.3]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p95J0pui008188; Wed, 5 Oct 2011 14:00:51 -0500 (CDT) From: Timur Tabi To: , , , , Date: Wed, 5 Oct 2011 14:00:49 -0500 Message-ID: <1317841251-27295-1-git-send-email-timur@freescale.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH 1/3] phylib: Work around bug in Teranetics PHY X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Andy Fleming 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 --- 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 +#include #include #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, };