From patchwork Wed Jun 22 19:24:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjeev Premi X-Patchwork-Id: 101537 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 70228B6F7F for ; Thu, 23 Jun 2011 05:24:49 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 325B2280C6; Wed, 22 Jun 2011 21:24:41 +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 o0Sifx80dLLb; Wed, 22 Jun 2011 21:24:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A75E2809E; Wed, 22 Jun 2011 21:24:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE0B328088 for ; Wed, 22 Jun 2011 21:24: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 5BhKdY6hPJbh for ; Wed, 22 Jun 2011 21:24:26 +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 bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by theia.denx.de (Postfix) with ESMTPS id 614B32808F for ; Wed, 22 Jun 2011 21:24:24 +0200 (CEST) Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p5MJOKjh001034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 22 Jun 2011 14:24:22 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5MJOJSU028904 for ; Thu, 23 Jun 2011 00:54:19 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Thu, 23 Jun 2011 00:54:19 +0530 Received: from psplinux050.india.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5MJODRc028070; Thu, 23 Jun 2011 00:54:18 +0530 (IST) From: Sanjeev Premi To: Date: Thu, 23 Jun 2011 00:54:07 +0530 Message-ID: <1308770649-3802-2-git-send-email-premi@ti.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: <1308770649-3802-1-git-send-email-premi@ti.com> References: <1308770649-3802-1-git-send-email-premi@ti.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 1/3] omap3evm: eth: split function setup_net_chip 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de In current implementation, the function sets up the ethernet chip and resets it. The steps to reset depend upon the board revision. The patch moves the reset actions to new function reset_net_chip(). Signed-off-by: Sanjeev Premi --- board/ti/evm/evm.c | 12 +++++++++++- board/ti/evm/evm.h | 1 + 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index aaf3033..8f9f141 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -130,6 +130,9 @@ int misc_init_r(void) #endif omap3_evm_get_revision(); +#if defined(CONFIG_CMD_NET) + reset_net_chip(); +#endif dieid_num_r(); return 0; @@ -153,7 +156,6 @@ void set_muxconf_regs(void) */ static void setup_net_chip(void) { - struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE; struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE; /* Configure GPMC registers */ @@ -172,6 +174,14 @@ static void setup_net_chip(void) /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */ writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00, &ctrl_base->gpmc_nadv_ale); +} + +/** + * Reset the ethernet chip. + */ +static void reset_net_chip(void) +{ + struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE; /* Make GPIO 64 as output pin */ writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe); diff --git a/board/ti/evm/evm.h b/board/ti/evm/evm.h index b721ad6..623cf1b 100644 --- a/board/ti/evm/evm.h +++ b/board/ti/evm/evm.h @@ -49,6 +49,7 @@ u32 get_omap3_evm_rev(void); #if defined(CONFIG_CMD_NET) static void setup_net_chip(void); +static void reset_net_chip(void); #endif /*