From patchwork Tue May 15 14:10:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Longchamp X-Patchwork-Id: 159327 X-Patchwork-Delegate: prafulla@marvell.com 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 56100B6F9F for ; Wed, 16 May 2012 00:23:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 17DFD280A6; Tue, 15 May 2012 16:23:27 +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 aB9VghbWw-IK; Tue, 15 May 2012 16:23:26 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0EF47280A9; Tue, 15 May 2012 16:21:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 38D3A28086 for ; Tue, 15 May 2012 16:21: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 FIhHyeHbQwkJ for ; Tue, 15 May 2012 16:21:27 +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 mail.ch.keymile.com (mail.ch.keymile.com [193.17.201.103]) by theia.denx.de (Postfix) with SMTP id BB9BB28093 for ; Tue, 15 May 2012 16:21:24 +0200 (CEST) Received: from SRVCHBER1212.ch.keymile.net ([172.31.32.9]) by eSafe SMTP Relay 1334159602; Tue, 15 May 2012 16:11:08 +0200 Received: from chber1-10533x.ch.keymile.net ([172.31.40.3]) by SRVCHBER1212.ch.keymile.net with Microsoft SMTPSVC(6.0.3790.4675); Tue, 15 May 2012 16:11:06 +0200 From: Valentin Longchamp To: To: prafulla@marvell.com, holger.brunck@keymile.com Date: Tue, 15 May 2012 16:10:57 +0200 Message-Id: <1337091064-30561-21-git-send-email-valentin.longchamp@keymile.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1337091064-30561-1-git-send-email-valentin.longchamp@keymile.com> References: <1337091064-30561-1-git-send-email-valentin.longchamp@keymile.com> X-OriginalArrivalTime: 15 May 2012 14:11:06.0968 (UTC) FILETIME=[9208AD80:01CD32A4] X-ESAFE-STATUS: [srvchber1306.keymile.net] Mail allowed Cc: Valentin Longchamp , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v4 20/27] arm/km: enable external switch configuration for kmnusa 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The configuration EEPROM should be removed for P1B. Signed-off-by: Valentin Longchamp --- board/keymile/km_arm/km_arm.c | 11 +++++------ board/keymile/km_arm/managed_switch.c | 3 ++- board/keymile/km_arm/managed_switch.h | 7 +++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index ea96c45..ebc82ef 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -43,6 +43,7 @@ #include #include "../common/common.h" +#include "managed_switch.h" DECLARE_GLOBAL_DATA_PTR; @@ -405,13 +406,11 @@ void reset_phy(void) if (miiphy_set_current_dev(name)) return; - /* enable autoneg on port 0 phy */ - ext_switch_reg_write(name, CONFIG_KM_MANAGED_SW_ADDR, 0, 0, 0x3300); +#if defined(CONFIG_KM_NUSA) + ext_switch_program(name, CONFIG_KM_MANAGED_SW_ADDR); +#endif - /* egress broadcast franes on all macs, with forwarding */ - ext_switch_reg_write(name, CONFIG_KM_MANAGED_SW_ADDR, 16, 4, 0x000f); - ext_switch_reg_write(name, CONFIG_KM_MANAGED_SW_ADDR, 20, 4, 0x000f); - ext_switch_reg_write(name, CONFIG_KM_MANAGED_SW_ADDR, 21, 4, 0x000f); + ext_switch_reset(name, CONFIG_KM_MANAGED_SW_ADDR); } #endif diff --git a/board/keymile/km_arm/managed_switch.c b/board/keymile/km_arm/managed_switch.c index 3b022cd..a776f1d 100644 --- a/board/keymile/km_arm/managed_switch.c +++ b/board/keymile/km_arm/managed_switch.c @@ -32,9 +32,10 @@ struct switch_reg sw_conf[] = { /* port 0, PIGY4, autoneg */ { PORT(0), PORT_PHY, NO_SPEED_FOR }, { PORT(0), PORT_CTRL, FORWARDING | EGRS_FLD_ALL }, + { PHY(0), PHY_1000_CTRL, NO_ADV }, + { PHY(0), PHY_SPEC_CTRL, AUTO_MDIX_EN }, { PHY(0), PHY_CTRL, PHY_100_MBPS | AUTONEG_EN | AUTONEG_RST | FULL_DUPLEX }, - { PHY(0), PHY_SPEC_CTRL, AUTO_MDIX_EN }, /* port 1, unused */ { PORT(1), PORT_CTRL, PORT_DIS }, { PHY(1), PHY_CTRL, PHY_PWR_DOWN }, diff --git a/board/keymile/km_arm/managed_switch.h b/board/keymile/km_arm/managed_switch.h index c0dcf82..d5b938a 100644 --- a/board/keymile/km_arm/managed_switch.h +++ b/board/keymile/km_arm/managed_switch.h @@ -51,6 +51,7 @@ #define PHY_CTRL 0x00 #define PHY_100_MBPS 0x2000 +#define PHY_1_GBPS 0x0040 #define AUTONEG_EN 0x1000 #define AUTONEG_RST 0x0200 #define FULL_DUPLEX 0x0100 @@ -62,6 +63,12 @@ #define SPEC_PWR_DOWN 0x0004 #define AUTO_MDIX_EN 0x0060 +#define PHY_1000_CTRL 0x9 + +#define NO_ADV 0x0000 +#define ADV_1000_FDPX 0x0200 +#define ADV_1000_HDPX 0x0100 + /* PORT or MAC registers */ #define PORT(itf) (itf+0x10)