From patchwork Sat Sep 25 11:36:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: charu@ti.com X-Patchwork-Id: 208892 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8PBanqE032131 for ; Sat, 25 Sep 2010 11:36:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755714Ab0IYLgq (ORCPT ); Sat, 25 Sep 2010 07:36:46 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:36464 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755335Ab0IYLgq (ORCPT ); Sat, 25 Sep 2010 07:36:46 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o8PBadg0011838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Sep 2010 06:36:41 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o8PBaZRl014791; Sat, 25 Sep 2010 17:06:36 +0530 (IST) From: "Varadarajan, Charulatha" To: linux-omap@vger.kernel.org Cc: khilman@deeprootsystems.com, tony@atomide.com, premi@ti.com, "Varadarajan, Charulatha" Subject: [PATCH RFC:] FIX: OMAP3EVM: Ethernet controller smsc911x reset Date: Sat, 25 Sep 2010 17:06:33 +0530 Message-Id: <1285414593-28013-1-git-send-email-charu@ti.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 25 Sep 2010 11:36:50 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index f76d9c0..54a7e20 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -55,6 +55,7 @@ #define OMAP3EVM_ETHR_SIZE 1024 #define OMAP3EVM_ETHR_ID_REV 0x50 #define OMAP3EVM_ETHR_GPIO_IRQ 176 +#define OMAP3EVM_ETHR_GPIO_RST 7 #define OMAP3EVM_SMSC911X_CS 5 static u8 omap3_evm_version; @@ -134,6 +135,20 @@ static inline void __init omap3evm_init_smsc911x(void) else rate = clk_get_rate(l3ck); + /* Configure ethernet controller reset gpio */ + if (gpio_request(OMAP3EVM_ETHR_GPIO_RST, "SMSC911x gpio") < 0) { + pr_err(KERN_ERR "Failed to request GPIO8 for smsc911x gpio\n"); + return; + } + + gpio_direction_output(OMAP3EVM_ETHR_GPIO_RST, 1); + + /* reset pulse to ethernet controller*/ + gpio_set_value(OMAP3EVM_ETHR_GPIO_RST, 0); + usleep_range(150, 220); + gpio_set_value(OMAP3EVM_ETHR_GPIO_RST, 1); + usleep_range(1, 2); + if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", OMAP3EVM_ETHR_GPIO_IRQ);