diff options
author | Vaibhav Hiremath <hvaibhav@ti.com> | 2011-01-24 14:25:55 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-02-17 17:15:57 -0500 |
commit | 9bc64b89cd730a09b02c66af730229e0abc9e2bb (patch) | |
tree | e5e41fc873d4f2c8953c88f2a8a47fbdd228f2d2 | |
parent | 741927f753a41c644840589a382a1d3500f86206 (diff) |
OMAP3EVM: Reset the smsc911x ethernet controller in board_init
With addition of hwmod support to gpio, the ethernet controller
goes undetected for OMAP35xEVM. So explicitly assert the reset signal to
ethernet controller smsc911x -
- GPIO7 (>=RevG version of EVM's)
- GPIO64 (<=RevD version of EVM's)
Tested this patch on RevG version of EVM with ES3.1 Si.
This patch is based on intial version from Charulatha V, reference
to original discussion -
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35784.html
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index ac50bf949447..b9f954e839d3 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -60,6 +60,13 @@ | |||
60 | #define OMAP3EVM_ETHR_ID_REV 0x50 | 60 | #define OMAP3EVM_ETHR_ID_REV 0x50 |
61 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 | 61 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 |
62 | #define OMAP3EVM_SMSC911X_CS 5 | 62 | #define OMAP3EVM_SMSC911X_CS 5 |
63 | /* | ||
64 | * Eth Reset signal | ||
65 | * 64 = Generation 1 (<=RevD) | ||
66 | * 7 = Generation 2 (>=RevE) | ||
67 | */ | ||
68 | #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64 | ||
69 | #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7 | ||
63 | 70 | ||
64 | static u8 omap3_evm_version; | 71 | static u8 omap3_evm_version; |
65 | 72 | ||
@@ -126,10 +133,15 @@ static struct platform_device omap3evm_smsc911x_device = { | |||
126 | 133 | ||
127 | static inline void __init omap3evm_init_smsc911x(void) | 134 | static inline void __init omap3evm_init_smsc911x(void) |
128 | { | 135 | { |
129 | int eth_cs; | 136 | int eth_cs, eth_rst; |
130 | struct clk *l3ck; | 137 | struct clk *l3ck; |
131 | unsigned int rate; | 138 | unsigned int rate; |
132 | 139 | ||
140 | if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) | ||
141 | eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST; | ||
142 | else | ||
143 | eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST; | ||
144 | |||
133 | eth_cs = OMAP3EVM_SMSC911X_CS; | 145 | eth_cs = OMAP3EVM_SMSC911X_CS; |
134 | 146 | ||
135 | l3ck = clk_get(NULL, "l3_ck"); | 147 | l3ck = clk_get(NULL, "l3_ck"); |
@@ -138,6 +150,27 @@ static inline void __init omap3evm_init_smsc911x(void) | |||
138 | else | 150 | else |
139 | rate = clk_get_rate(l3ck); | 151 | rate = clk_get_rate(l3ck); |
140 | 152 | ||
153 | /* Configure ethernet controller reset gpio */ | ||
154 | if (cpu_is_omap3430()) { | ||
155 | if (gpio_request(eth_rst, "SMSC911x gpio") < 0) { | ||
156 | pr_err(KERN_ERR "Failed to request %d for smsc911x\n", | ||
157 | eth_rst); | ||
158 | return; | ||
159 | } | ||
160 | |||
161 | if (gpio_direction_output(eth_rst, 1) < 0) { | ||
162 | pr_err(KERN_ERR "Failed to set direction of %d for" \ | ||
163 | " smsc911x\n", eth_rst); | ||
164 | return; | ||
165 | } | ||
166 | /* reset pulse to ethernet controller*/ | ||
167 | usleep_range(150, 220); | ||
168 | gpio_set_value(eth_rst, 0); | ||
169 | usleep_range(150, 220); | ||
170 | gpio_set_value(eth_rst, 1); | ||
171 | usleep_range(1, 2); | ||
172 | } | ||
173 | |||
141 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { | 174 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { |
142 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", | 175 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
143 | OMAP3EVM_ETHR_GPIO_IRQ); | 176 | OMAP3EVM_ETHR_GPIO_IRQ); |
@@ -713,6 +746,10 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
713 | OMAP_PIN_OFF_WAKEUPENABLE), | 746 | OMAP_PIN_OFF_WAKEUPENABLE), |
714 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | 747 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | |
715 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), | 748 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), |
749 | OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
750 | OMAP_PIN_OFF_NONE), | ||
751 | OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
752 | OMAP_PIN_OFF_NONE), | ||
716 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | 753 | #ifdef CONFIG_WL12XX_PLATFORM_DATA |
717 | /* WLAN IRQ - GPIO 149 */ | 754 | /* WLAN IRQ - GPIO 149 */ |
718 | OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), | 755 | OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), |