From patchwork Thu Jan 19 12:27:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 136834 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 8F6B8B6EFE for ; Thu, 19 Jan 2012 23:29:50 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 83E7D283C8; Thu, 19 Jan 2012 13:29:46 +0100 (CET) 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 p3TeVeeUOLxe; Thu, 19 Jan 2012 13:29:46 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3A73228371; Thu, 19 Jan 2012 13:29:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46B9728371 for ; Thu, 19 Jan 2012 13:29:41 +0100 (CET) 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 ph7X-UxSg9Cy for ; Thu, 19 Jan 2012 13:29:40 +0100 (CET) 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 smtp2-v.fe.bosch.de (smtp2-v.fe.bosch.de [139.15.237.6]) by theia.denx.de (Postfix) with ESMTPS id 71F932832E for ; Thu, 19 Jan 2012 13:29:38 +0100 (CET) Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.30]) by imta23.fe.bosch.de (Postfix) with ESMTP id 2443E5820369; Thu, 19 Jan 2012 13:29:38 +0100 (CET) Received: from localhost (vsgw3.fe.internet.bosch.com [10.4.98.16]) by vsmta14.fe.internet.bosch.com (Postfix) with SMTP id 1278332B025C; Thu, 19 Jan 2012 13:29:38 +0100 (CET) Received: from FE-HUB1000.de.bosch.com (10.4.103.107) by fe-hub05.de.bosch.com (10.3.153.64) with Microsoft SMTP Server (TLS) id 8.3.213.0; Thu, 19 Jan 2012 13:29:33 +0100 Received: from [10.34.217.145] (10.34.217.145) by FE-HUB1000.de.bosch.com (10.4.103.107) with Microsoft SMTP Server id 14.1.355.2; Thu, 19 Jan 2012 13:29:32 +0100 Message-ID: <4F180C2C.7080303@de.bosch.com> Date: Thu, 19 Jan 2012 13:27:24 +0100 From: Dirk Behme Organization: Robert Bosch Car Multimedia GmbH User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Troy Kisky References: <1326456604-25137-1-git-send-email-dirk.behme@de.bosch.com> <1326456604-25137-3-git-send-email-dirk.behme@de.bosch.com> In-Reply-To: <1326456604-25137-3-git-send-email-dirk.behme@de.bosch.com> X-Originating-IP: [10.34.217.145] Cc: "u-boot@lists.denx.de" Subject: Re: [U-Boot] [PATCH 3/5] miiphyutil: Add Micrel KSZ9021 support to miiphy_speed X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Hi Troy, On 13.01.2012 13:10, Dirk Behme wrote: > From: Troy Kisky > > Previously, only GIGE phy was supported in this function. > > Signed-off-by: Troy Kisky > CC: Troy Kisky > CC: Stefano Babic > CC: Marek Vasut > --- > common/miiphyutil.c | 18 +++++++++++++++++- > 1 files changed, 17 insertions(+), 1 deletions(-) > > diff --git a/common/miiphyutil.c b/common/miiphyutil.c > index 2cc23b4..8cb4748 100644 > --- a/common/miiphyutil.c > +++ b/common/miiphyutil.c > @@ -471,7 +471,23 @@ int miiphy_speed(const char *devname, unsigned char addr) > (btsr & (PHY_1000BTSR_1000FD | PHY_1000BTSR_1000HD))) > return _1000BASET; > #endif /* CONFIG_PHY_GIGE */ > - > +#ifdef CONFIG_PHY_MICREL_KSZ9021 > +#define MII_PHY_CTL 0x1f > +#define MII_PHY_CTL_1000 (1 << 6) > +#define MII_PHY_CTL_100 (1 << 5) > +#define MII_PHY_CTL_10 (1 << 4) > + u16 btsr; > + if (miiphy_read(devname, addr, MII_PHY_CTL, &btsr)) { > + printf("PHY 1000BT status"); > + goto miiphy_read_failed; > + } > + if (btsr & MII_PHY_CTL_1000) > + return _1000BASET; > + if (btsr & MII_PHY_CTL_100) > + return _100BASET; > + if (btsr & MII_PHY_CTL_10) > + return _10BASET; > +#endif > /* Check Basic Management Control Register first. */ > if (miiphy_read(devname, addr, MII_BMCR, &bmcr)) { > printf("PHY speed"); Thilo mentioned that on an ARM2 board he additionally needs /* Get speed from basic control settings. */ to make GbE work on that board. What do you think? Best regards Dirk diff --git a/common/miiphyutil.c b/common/miiphyutil.c index 8cb4748..d3ff2af 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -500,6 +500,8 @@ int miiphy_speed(const char *devname, unsigned char addr) printf("PHY AN speed"); goto miiphy_read_failed; } + if (anlpar & LPA_1000XFULL ) + return _1000BASET; return (anlpar & LPA_100) ? _100BASET : _10BASET; }