From patchwork Mon Jul 1 12:57:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frederic Leroy X-Patchwork-Id: 256123 X-Patchwork-Delegate: sr@denx.de 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 6B9FA2C00A1 for ; Mon, 1 Jul 2013 22:59:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EFDDB4A266; Mon, 1 Jul 2013 14:59:37 +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 1L+pkeBcFXxt; Mon, 1 Jul 2013 14:59:37 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E3FEA4A0EF; Mon, 1 Jul 2013 14:58:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE7E94A213 for ; Mon, 1 Jul 2013 14:58:14 +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 pybxIdp-M8jx for ; Mon, 1 Jul 2013 14:58:07 +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 sd-34071.dedibox.fr (sd-34071.dedibox.fr [88.191.154.35]) by theia.denx.de (Postfix) with ESMTP id 6A2EE4A22C for ; Mon, 1 Jul 2013 14:57:50 +0200 (CEST) Received: from sd-34071.dedibox.fr (localhost [127.0.0.1]) by sd-34071.dedibox.fr (Postfix) with ESMTP id 51C303FF2C; Mon, 1 Jul 2013 14:57:50 +0200 (CEST) Received: from localhost.localdomain (229.143.122.78.rev.sfr.net [78.122.143.229]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sd-34071.dedibox.fr (Postfix) with ESMTPSA id C10F340C35; Mon, 1 Jul 2013 14:57:49 +0200 (CEST) From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= To: u-boot@lists.denx.de Date: Mon, 1 Jul 2013 14:57:45 +0200 Message-Id: <1372683466-8286-3-git-send-email-fredo@starox.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1372683466-8286-1-git-send-email-fredo@starox.org> References: <1372683466-8286-1-git-send-email-fredo@starox.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [U-Boot] [PATCH v3 2/3] LaCie/common: Uses #defines for ethernet phy leds setup 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 The CloudBox device have a different ethernet phy setup than other ns2 devices. Prepare source to use different init registers Signed-off-by: Frédéric Leroy --- board/LaCie/common/common.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/board/LaCie/common/common.c b/board/LaCie/common/common.c index a62bf9f..85480e7 100644 --- a/board/LaCie/common/common.c +++ b/board/LaCie/common/common.c @@ -21,6 +21,12 @@ #define MV88E1116_RGMII_TXTM_CTRL (1 << 4) #define MV88E1116_RGMII_RXTM_CTRL (1 << 5) +#if !defined(MII_MARVELL_LED_REG) +# define MII_MARVELL_LED_REG 16 +# define MII_MARVELL_LED_MASK 0xf0 +# define MII_MARVELL_LED_VALUE 0x0f +#endif + void mv_phy_88e1116_init(const char *name, u16 phyaddr) { u16 reg; @@ -53,9 +59,10 @@ void mv_phy_88e1318_init(const char *name, u16 phyaddr) * Set control mode 4 for LED[0]. */ miiphy_write(name, phyaddr, MII_MARVELL_PHY_PAGE, 3); - miiphy_read(name, phyaddr, 16, ®); - reg |= 0xf; - miiphy_write(name, phyaddr, 16, reg); + miiphy_read(name, phyaddr, MII_MARVELL_LED_REG, ®); + reg &= MII_MARVELL_LED_MASK; + reg |= MII_MARVELL_LED_VALUE; + miiphy_write(name, phyaddr, MII_MARVELL_LED_REG, reg); /* * Enable RGMII delay on Tx and Rx for CPU port