From patchwork Mon Jan 3 13:45:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schwingen X-Patchwork-Id: 77252 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 80B2BB7043 for ; Tue, 4 Jan 2011 00:48:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1449B28134; Mon, 3 Jan 2011 14:48:19 +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 3NZ7brEd1Cmf; Mon, 3 Jan 2011 14:48:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 97E3828135; Mon, 3 Jan 2011 14:47:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 82F8228136 for ; Mon, 3 Jan 2011 14:47:54 +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 IlI9gx9Jo5YW for ; Mon, 3 Jan 2011 14:47:54 +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 mail.dascon.de (pve-mail.dascon.de [93.159.248.171]) by theia.denx.de (Postfix) with ESMTP id 0E13F28137 for ; Mon, 3 Jan 2011 14:47:49 +0100 (CET) Received: by mail.dascon.de (Postfix, from userid 10) id DC82921A2; Mon, 3 Jan 2011 14:47:48 +0100 (CET) Received: from discworld.ms.intern (discworld.dascon.de [192.168.11.1]) by a-tuin.dascon.de (Postfix) with ESMTP id 0F86880837 for ; Mon, 3 Jan 2011 14:45:45 +0100 (CET) From: Michael Schwingen To: u-boot@lists.denx.de Date: Mon, 3 Jan 2011 14:45:37 +0100 Message-Id: <1294062338-21084-13-git-send-email-michael@schwingen.org> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1294062338-21084-1-git-send-email-michael@schwingen.org> References: <1294062338-21084-1-git-send-email-michael@schwingen.org> Subject: [U-Boot] [PATCH 12/13] IXP NPE: add support for fixed-speed MII ports 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de add support for MII ports that lack a PHY with standard PHY registers Signed-off-by: Michael Schwingen --- arch/arm/cpu/ixp/npe/npe.c | 18 +++++++++++++++++- include/configs/actux2.h | 5 +++++ include/configs/actux3.h | 5 +++++ 3 files changed, 27 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/ixp/npe/npe.c b/arch/arm/cpu/ixp/npe/npe.c index 9d1090e..87f4600 100644 --- a/arch/arm/cpu/ixp/npe/npe.c +++ b/arch/arm/cpu/ixp/npe/npe.c @@ -359,6 +359,21 @@ static int npe_init(struct eth_device *dev, bd_t * bis) debug("%s: 1\n", __FUNCTION__); +#ifdef CONFIG_MII_NPE0_FIXEDLINK + if (0 == p_npe->eth_id) { + speed = CONFIG_MII_NPE0_SPEED; + duplex = CONFIG_MII_NPE0_FULLDUPLEX ? FULL : HALF; + } + else +#endif +#ifdef CONFIG_MII_NPE1_FIXEDLINK + if (1 == p_npe->eth_id) { + speed = CONFIG_MII_NPE1_SPEED; + duplex = CONFIG_MII_NPE1_FULLDUPLEX ? FULL : HALF; + } + else +#endif + { miiphy_read (dev->name, p_npe->phy_no, PHY_BMSR, ®_short); /* @@ -388,7 +403,8 @@ static int npe_init(struct eth_device *dev, bd_t * bis) speed = miiphy_speed (dev->name, p_npe->phy_no); duplex = miiphy_duplex (dev->name, p_npe->phy_no); - + } + if (p_npe->print_speed) { p_npe->print_speed = 0; printf ("ENET Speed is %d Mbps - %s duplex connection\n", diff --git a/include/configs/actux2.h b/include/configs/actux2.h index 4ba3ce0..fc0af32 100644 --- a/include/configs/actux2.h +++ b/include/configs/actux2.h @@ -152,6 +152,11 @@ #define CONFIG_PHY_ADDR 0x00 /* MII PHY management */ #define CONFIG_MII 1 +/* fixed-speed switch without standard PHY registers on MII */ +#define CONFIG_MII_NPE0_FIXEDLINK 1 +#define CONFIG_MII_NPE0_SPEED 100 +#define CONFIG_MII_NPE0_FULLDUPLEX 1 + /* Number of ethernet rx buffers & descriptors */ #define CONFIG_SYS_RX_ETH_BUFFER 16 #define CONFIG_RESET_PHY_R 1 diff --git a/include/configs/actux3.h b/include/configs/actux3.h index 4b9b496..01b5d12 100644 --- a/include/configs/actux3.h +++ b/include/configs/actux3.h @@ -152,6 +152,11 @@ #define CONFIG_PHY_ADDR 0x10 /* MII PHY management */ #define CONFIG_MII 1 +/* fixed-speed switch without standard PHY registers on MII */ +#define CONFIG_MII_NPE0_FIXEDLINK 1 +#define CONFIG_MII_NPE0_SPEED 100 +#define CONFIG_MII_NPE0_FULLDUPLEX 1 + /* Number of ethernet rx buffers & descriptors */ #define CONFIG_SYS_RX_ETH_BUFFER 16 #define CONFIG_RESET_PHY_R 1