diff options
author | Tim Nordell <tim.nordell@logicpd.com> | 2010-09-27 12:05:50 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-09-28 14:39:18 -0400 |
commit | 26428b5c4f675434d52c8dc09c4c8d5e6198a6ac (patch) | |
tree | 23b547658d3e7c48ddc1874558bbb77b7c117b5d /arch/arm/mach-omap2/board-omap3logic.c | |
parent | cdd280b9958d71ccbaf7c00c0d63dab0a48c1db0 (diff) |
ARM: OMAP3LOGIC: Added SMSC Ethernet board support
Enable SMSC911x Ethernet driver for LogicPD's OMAP
3530 LV SOM and OMAP 35x Torpedo board.
Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3logic.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3logic.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index 8b6036053e1b..4c045cf91bc8 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <plat/mux.h> | 39 | #include <plat/mux.h> |
40 | #include <plat/board.h> | 40 | #include <plat/board.h> |
41 | #include <plat/common.h> | 41 | #include <plat/common.h> |
42 | #include <plat/gpmc-smsc911x.h> | ||
42 | #include <plat/gpmc.h> | 43 | #include <plat/gpmc.h> |
43 | #include <plat/timer-gp.h> | 44 | #include <plat/timer-gp.h> |
44 | #include <plat/sdrc.h> | 45 | #include <plat/sdrc.h> |
@@ -142,6 +143,58 @@ static void __init board_mmc_init(void) | |||
142 | omap3logic_vmmc1_supply.dev = board_mmc_info[0].dev; | 143 | omap3logic_vmmc1_supply.dev = board_mmc_info[0].dev; |
143 | } | 144 | } |
144 | 145 | ||
146 | static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = { | ||
147 | .cs = OMAP3LOGIC_SMSC911X_CS, | ||
148 | .gpio_irq = -EINVAL, | ||
149 | .gpio_reset = -EINVAL, | ||
150 | .flags = IORESOURCE_IRQ_LOWLEVEL, | ||
151 | }; | ||
152 | |||
153 | /* TODO/FIXME (comment by Peter Barada, LogicPD): | ||
154 | * Fix the PBIAS voltage for Torpedo MMC1 pins that | ||
155 | * are used for other needs (IRQs, etc). */ | ||
156 | static void omap3torpedo_fix_pbias_voltage(void) | ||
157 | { | ||
158 | u16 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; | ||
159 | u32 reg; | ||
160 | |||
161 | if (machine_is_omap3_torpedo()) | ||
162 | { | ||
163 | /* Set the bias for the pin */ | ||
164 | reg = omap_ctrl_readl(control_pbias_offset); | ||
165 | |||
166 | reg &= ~OMAP343X_PBIASLITEPWRDNZ1; | ||
167 | omap_ctrl_writel(reg, control_pbias_offset); | ||
168 | |||
169 | /* 100ms delay required for PBIAS configuration */ | ||
170 | msleep(100); | ||
171 | |||
172 | reg |= OMAP343X_PBIASLITEVMODE1; | ||
173 | reg |= OMAP343X_PBIASLITEPWRDNZ1; | ||
174 | omap_ctrl_writel(reg | 0x300, control_pbias_offset); | ||
175 | } | ||
176 | } | ||
177 | |||
178 | static inline void __init board_smsc911x_init(void) | ||
179 | { | ||
180 | if (machine_is_omap3530_lv_som()) { | ||
181 | /* OMAP3530 LV SOM board */ | ||
182 | board_smsc911x_data.gpio_irq = | ||
183 | OMAP3530_LV_SOM_SMSC911X_GPIO_IRQ; | ||
184 | omap_mux_init_signal("gpio_152", OMAP_PIN_INPUT); | ||
185 | } else if (machine_is_omap3_torpedo()) { | ||
186 | /* OMAP3 Torpedo board */ | ||
187 | board_smsc911x_data.gpio_irq = OMAP3_TORPEDO_SMSC911X_GPIO_IRQ; | ||
188 | omap_mux_init_signal("gpio_129", OMAP_PIN_INPUT); | ||
189 | } else { | ||
190 | /* unsupported board */ | ||
191 | printk(KERN_ERR "%s(): unknown machine type\n", __func__); | ||
192 | return; | ||
193 | } | ||
194 | |||
195 | gpmc_smsc911x_init(&board_smsc911x_data); | ||
196 | } | ||
197 | |||
145 | static void __init omap3logic_init_irq(void) | 198 | static void __init omap3logic_init_irq(void) |
146 | { | 199 | { |
147 | omap2_init_common_hw(NULL, NULL); | 200 | omap2_init_common_hw(NULL, NULL); |
@@ -149,11 +202,23 @@ static void __init omap3logic_init_irq(void) | |||
149 | omap_gpio_init(); | 202 | omap_gpio_init(); |
150 | } | 203 | } |
151 | 204 | ||
205 | #ifdef CONFIG_OMAP_MUX | ||
206 | static struct omap_board_mux board_mux[] __initdata = { | ||
207 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
208 | }; | ||
209 | #else | ||
210 | #define board_mux NULL | ||
211 | #endif | ||
212 | |||
152 | static void __init omap3logic_init(void) | 213 | static void __init omap3logic_init(void) |
153 | { | 214 | { |
215 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | ||
216 | omap3torpedo_fix_pbias_voltage(); | ||
154 | omap3logic_i2c_init(); | 217 | omap3logic_i2c_init(); |
155 | omap_serial_init(); | 218 | omap_serial_init(); |
156 | board_mmc_init(); | 219 | board_mmc_init(); |
220 | board_smsc911x_init(); | ||
221 | |||
157 | /* Ensure SDRC pins are mux'd for self-refresh */ | 222 | /* Ensure SDRC pins are mux'd for self-refresh */ |
158 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 223 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
159 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 224 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |