diff mbox

[RFC:] FIX: OMAP3EVM: Ethernet controller smsc911x reset

Message ID 1285414593-28013-1-git-send-email-charu@ti.com (mailing list archive)
State Awaiting Upstream, archived
Delegated to: Tony Lindgren
Headers show

Commit Message

charu@ti.com Sept. 25, 2010, 11:36 a.m. UTC
None
diff mbox

Patch

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);