public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP3EVM:FIX: Reset the SMSC911x Ethernet controller in board_init
@ 2011-01-24 14:41 hvaibhav
  2011-01-24 15:01 ` Varadarajan, Charulatha
  2011-01-24 19:44 ` Kevin Hilman
  0 siblings, 2 replies; 11+ messages in thread
From: hvaibhav @ 2011-01-24 14:41 UTC (permalink / raw)
  To: linux-omap; +Cc: charu, khilman, tony, Vaibhav Hiremath

From: Vaibhav Hiremath <hvaibhav@ti.com>

With addition of HWMOD support to GPIO, the Ethernet controller
goes undetected for OMAP35xEVM. So explicitely assert the reset signal to
Ethernet controller smsc911x -

	- GPIO7 (>=RevG version of EVM's)
	- GPIO64 (<=RevD version of EVM's)

I have tested this patch on RevG version of EVM with ES3.1 Si.
This patch is based on intial version from Charulatha V.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
NOTE: I have not been able to test it on older version of EVM's.

 arch/arm/mach-omap2/board-omap3evm.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 212d88c..336c012 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -124,10 +124,15 @@ static struct platform_device omap3evm_smsc911x_device = {

 static inline void __init omap3evm_init_smsc911x(void)
 {
-	int eth_cs;
+	int eth_cs, eth_rst;
 	struct clk *l3ck;
 	unsigned int rate;

+	if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
+		eth_rst = 64;
+	else
+		eth_rst = 7;
+
 	eth_cs = OMAP3EVM_SMSC911X_CS;

 	l3ck = clk_get(NULL, "l3_ck");
@@ -136,6 +141,22 @@ static inline void __init omap3evm_init_smsc911x(void)
 	else
 		rate = clk_get_rate(l3ck);

+	/* Configure ethernet controller reset gpio */
+	if (cpu_is_omap3430()) {
+		if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
+			pr_err(KERN_ERR "Failed to request GPIO7 for smsc911x\n");
+			return;
+		}
+
+		gpio_direction_output(eth_rst, 1);
+		/* reset pulse to ethernet controller*/
+		usleep_range(150, 220);
+		gpio_set_value(eth_rst, 0);
+		usleep_range(150, 220);
+		gpio_set_value(eth_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);
@@ -703,6 +724,10 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
 	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 				OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
 				OMAP_PIN_OFF_WAKEUPENABLE),
+	OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
+	OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };

--
1.6.2.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-01-25 14:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-24 14:41 [PATCH] OMAP3EVM:FIX: Reset the SMSC911x Ethernet controller in board_init hvaibhav
2011-01-24 15:01 ` Varadarajan, Charulatha
2011-01-24 15:12   ` Hiremath, Vaibhav
2011-01-25  6:50     ` Varadarajan, Charulatha
2011-01-25  6:56       ` Hiremath, Vaibhav
2011-01-25  7:10         ` Varadarajan, Charulatha
2011-01-24 19:44 ` Kevin Hilman
2011-01-24 19:58   ` Hiremath, Vaibhav
2011-01-24 21:22     ` Kevin Hilman
2011-01-25  4:44       ` Hiremath, Vaibhav
2011-01-25 14:58       ` Hiremath, Vaibhav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox