From patchwork Fri Dec 6 09:19:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 297645 X-Patchwork-Delegate: trini@ti.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 2331B2C00A8 for ; Fri, 6 Dec 2013 20:20:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58F64A7BFD; Fri, 6 Dec 2013 10:20:05 +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 SSUec0JHFTCz; Fri, 6 Dec 2013 10:20:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 329AEA7C02; Fri, 6 Dec 2013 10:20:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B98E4A7C83 for ; Fri, 6 Dec 2013 10:19:57 +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 4A0j2uGTbDve for ; Fri, 6 Dec 2013 10:19:52 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail.visionsystems.de (ns.vscom.de [62.145.30.242]) by theia.denx.de (Postfix) with ESMTP id 7A7FEA7C81 for ; Fri, 6 Dec 2013 10:19:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.visionsystems.de (Postfix) with ESMTP id 8F0822D844B; Fri, 6 Dec 2013 10:19:41 +0100 (CET) Received: from mail.visionsystems.de ([127.0.0.1]) by localhost (mail.visionsystems.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15490-07; Fri, 6 Dec 2013 10:19:27 +0100 (CET) Received: from visionsystems.de (kallisto.visionsystems.local [192.168.1.3]) by mail.visionsystems.de (Postfix) with ESMTP id 8D5692D8449; Fri, 6 Dec 2013 10:19:27 +0100 (CET) Received: from development1.visionsystems.local ([192.168.1.36]) by visionsystems.de with Microsoft SMTPSVC(6.0.3790.4675); Fri, 6 Dec 2013 10:19:27 +0100 From: yegorslists@googlemail.com To: u-boot@lists.denx.de Date: Fri, 6 Dec 2013 10:19:22 +0100 Message-Id: <1386321562-26504-1-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 1.7.7 X-OriginalArrivalTime: 06 Dec 2013 09:19:27.0608 (UTC) FILETIME=[430FBF80:01CEF264] X-Virus-Scanned: amavisd-new at visionsystems.de Cc: trini@ti.com Subject: [U-Boot] [PATCH v2] am3517_evm: activate Ethernet PHY 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 From: Yegor Yefremov Pin 30 is connected to PHY's RESET# signal, so it must be put to high. Otherwise PHY won't be found via MDIO interface. Signed-off-by: Yegor Yefremov --- Changes: v2: put ctr and reset under #if defined statement. to avoid compilerwarnigs, when EMAC is not selected board/logicpd/am3517evm/am3517evm.c | 36 +++++++++++++++++++++++++++++++++++ board/logicpd/am3517evm/am3517evm.h | 2 +- 2 files changed, 37 insertions(+), 1 deletions(-) diff --git a/board/logicpd/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c index 1569905..a917a03 100644 --- a/board/logicpd/am3517evm/am3517evm.c +++ b/board/logicpd/am3517evm/am3517evm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,9 @@ DECLARE_GLOBAL_DATA_PTR; +#define AM3517_IP_SW_RESET 0x48002598 +#define CPGMACSS_SW_RST (1 << 1) + /* * Routine: board_init * Description: Early hardware init. @@ -98,6 +102,11 @@ static void am3517_evm_musb_init(void) */ int misc_init_r(void) { +#if defined(CONFIG_DRIVER_TI_EMAC) + volatile unsigned int ctr; + u32 reset; +#endif + #ifdef CONFIG_SYS_I2C_OMAP34XX i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); #endif @@ -106,6 +115,33 @@ int misc_init_r(void) am3517_evm_musb_init(); +#if defined(CONFIG_DRIVER_TI_EMAC) + /* activate PHY reset */ + gpio_direction_output(30, 0); + gpio_set_value(30, 0); + + ctr = 0; + do { + udelay(1000); + ctr++; + } while (ctr < 300); + + /* deactivate PHY reset */ + gpio_set_value(30, 1); + + /* allow the PHY to stabilize and settle down */ + ctr = 0; + do { + udelay(1000); + ctr++; + } while (ctr < 300); + + /* ensure that the module is out of reset */ + reset = readl(AM3517_IP_SW_RESET); + reset &= (~CPGMACSS_SW_RST); + writel(reset,AM3517_IP_SW_RESET); +#endif + return 0; } diff --git a/board/logicpd/am3517evm/am3517evm.h b/board/logicpd/am3517evm/am3517evm.h index 704af84..d407d66 100644 --- a/board/logicpd/am3517evm/am3517evm.h +++ b/board/logicpd/am3517evm/am3517evm.h @@ -315,7 +315,7 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) \ MUX_VAL(CP(SYS_NIRQ), (IEN | PTU | EN | M0)) \ /*SYS_nRESWARM */\ - MUX_VAL(CP(SYS_NRESWARM), (IDIS | PTU | DIS | M4)) \ + MUX_VAL(CP(SYS_NRESWARM), (IDIS | PTU | EN | M4)) \ /* - GPIO30 */\ MUX_VAL(CP(SYS_BOOT0), (IEN | PTD | DIS | M4)) /*GPIO_2*/\ /* - PEN_IRQ */\