diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-apollon.c')
-rw-r--r-- | arch/arm/mach-omap2/board-apollon.c | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index c6421a72514a..b124bdfb4239 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -27,21 +27,21 @@ | |||
27 | #include <linux/err.h> | 27 | #include <linux/err.h> |
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/smc91x.h> | 29 | #include <linux/smc91x.h> |
30 | #include <linux/gpio.h> | ||
30 | 31 | ||
31 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
33 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
34 | #include <asm/mach/flash.h> | 35 | #include <asm/mach/flash.h> |
35 | 36 | ||
36 | #include <mach/gpio.h> | ||
37 | #include <plat/led.h> | 37 | #include <plat/led.h> |
38 | #include <plat/usb.h> | 38 | #include <plat/usb.h> |
39 | #include <plat/board.h> | 39 | #include <plat/board.h> |
40 | #include <plat/common.h> | 40 | #include <plat/common.h> |
41 | #include <plat/gpmc.h> | 41 | #include <plat/gpmc.h> |
42 | #include <plat/control.h> | ||
43 | 42 | ||
44 | #include "mux.h" | 43 | #include "mux.h" |
44 | #include "control.h" | ||
45 | 45 | ||
46 | /* LED & Switch macros */ | 46 | /* LED & Switch macros */ |
47 | #define LED0_GPIO13 13 | 47 | #define LED0_GPIO13 13 |
@@ -202,6 +202,7 @@ static inline void __init apollon_init_smc91x(void) | |||
202 | unsigned int rate; | 202 | unsigned int rate; |
203 | struct clk *gpmc_fck; | 203 | struct clk *gpmc_fck; |
204 | int eth_cs; | 204 | int eth_cs; |
205 | int err; | ||
205 | 206 | ||
206 | gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */ | 207 | gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */ |
207 | if (IS_ERR(gpmc_fck)) { | 208 | if (IS_ERR(gpmc_fck)) { |
@@ -245,15 +246,13 @@ static inline void __init apollon_init_smc91x(void) | |||
245 | apollon_smc91x_resources[0].end = base + 0x30f; | 246 | apollon_smc91x_resources[0].end = base + 0x30f; |
246 | udelay(100); | 247 | udelay(100); |
247 | 248 | ||
248 | omap_mux_init_gpio(74, 0); | 249 | omap_mux_init_gpio(APOLLON_ETHR_GPIO_IRQ, 0); |
249 | if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { | 250 | err = gpio_request_one(APOLLON_ETHR_GPIO_IRQ, GPIOF_IN, "SMC91x irq"); |
251 | if (err) { | ||
250 | printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", | 252 | printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", |
251 | APOLLON_ETHR_GPIO_IRQ); | 253 | APOLLON_ETHR_GPIO_IRQ); |
252 | gpmc_cs_free(APOLLON_ETH_CS); | 254 | gpmc_cs_free(APOLLON_ETH_CS); |
253 | goto out; | ||
254 | } | 255 | } |
255 | gpio_direction_input(APOLLON_ETHR_GPIO_IRQ); | ||
256 | |||
257 | out: | 256 | out: |
258 | clk_disable(gpmc_fck); | 257 | clk_disable(gpmc_fck); |
259 | clk_put(gpmc_fck); | 258 | clk_put(gpmc_fck); |
@@ -270,34 +269,29 @@ static struct omap_lcd_config apollon_lcd_config __initdata = { | |||
270 | .ctrl_name = "internal", | 269 | .ctrl_name = "internal", |
271 | }; | 270 | }; |
272 | 271 | ||
273 | static struct omap_board_config_kernel apollon_config[] = { | 272 | static struct omap_board_config_kernel apollon_config[] __initdata = { |
274 | { OMAP_TAG_LCD, &apollon_lcd_config }, | 273 | { OMAP_TAG_LCD, &apollon_lcd_config }, |
275 | }; | 274 | }; |
276 | 275 | ||
277 | static void __init omap_apollon_init_irq(void) | 276 | static void __init omap_apollon_init_early(void) |
278 | { | 277 | { |
279 | omap_board_config = apollon_config; | 278 | omap2_init_common_infrastructure(); |
280 | omap_board_config_size = ARRAY_SIZE(apollon_config); | 279 | omap2_init_common_devices(NULL, NULL); |
281 | omap2_init_common_hw(NULL, NULL); | ||
282 | omap_init_irq(); | ||
283 | omap_gpio_init(); | ||
284 | apollon_init_smc91x(); | ||
285 | } | 280 | } |
286 | 281 | ||
282 | static struct gpio apollon_gpio_leds[] __initdata = { | ||
283 | { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */ | ||
284 | { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */ | ||
285 | { LED2_GPIO15, GPIOF_OUT_INIT_LOW, "LED2" }, /* LED2 - AA4 */ | ||
286 | }; | ||
287 | |||
287 | static void __init apollon_led_init(void) | 288 | static void __init apollon_led_init(void) |
288 | { | 289 | { |
289 | /* LED0 - AA10 */ | ||
290 | omap_mux_init_signal("vlynq_clk.gpio_13", 0); | 290 | omap_mux_init_signal("vlynq_clk.gpio_13", 0); |
291 | gpio_request(LED0_GPIO13, "LED0"); | ||
292 | gpio_direction_output(LED0_GPIO13, 0); | ||
293 | /* LED1 - AA6 */ | ||
294 | omap_mux_init_signal("vlynq_rx1.gpio_14", 0); | 291 | omap_mux_init_signal("vlynq_rx1.gpio_14", 0); |
295 | gpio_request(LED1_GPIO14, "LED1"); | ||
296 | gpio_direction_output(LED1_GPIO14, 0); | ||
297 | /* LED2 - AA4 */ | ||
298 | omap_mux_init_signal("vlynq_rx0.gpio_15", 0); | 292 | omap_mux_init_signal("vlynq_rx0.gpio_15", 0); |
299 | gpio_request(LED2_GPIO15, "LED2"); | 293 | |
300 | gpio_direction_output(LED2_GPIO15, 0); | 294 | gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds)); |
301 | } | 295 | } |
302 | 296 | ||
303 | static void __init apollon_usb_init(void) | 297 | static void __init apollon_usb_init(void) |
@@ -305,8 +299,7 @@ static void __init apollon_usb_init(void) | |||
305 | /* USB device */ | 299 | /* USB device */ |
306 | /* DEVICE_SUSPEND */ | 300 | /* DEVICE_SUSPEND */ |
307 | omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); | 301 | omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); |
308 | gpio_request(12, "USB suspend"); | 302 | gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend"); |
309 | gpio_direction_output(12, 0); | ||
310 | omap2_usbfs_init(&apollon_usb_config); | 303 | omap2_usbfs_init(&apollon_usb_config); |
311 | } | 304 | } |
312 | 305 | ||
@@ -314,8 +307,6 @@ static void __init apollon_usb_init(void) | |||
314 | static struct omap_board_mux board_mux[] __initdata = { | 307 | static struct omap_board_mux board_mux[] __initdata = { |
315 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 308 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
316 | }; | 309 | }; |
317 | #else | ||
318 | #define board_mux NULL | ||
319 | #endif | 310 | #endif |
320 | 311 | ||
321 | static void __init omap_apollon_init(void) | 312 | static void __init omap_apollon_init(void) |
@@ -323,7 +314,10 @@ static void __init omap_apollon_init(void) | |||
323 | u32 v; | 314 | u32 v; |
324 | 315 | ||
325 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 316 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); |
317 | omap_board_config = apollon_config; | ||
318 | omap_board_config_size = ARRAY_SIZE(apollon_config); | ||
326 | 319 | ||
320 | apollon_init_smc91x(); | ||
327 | apollon_led_init(); | 321 | apollon_led_init(); |
328 | apollon_flash_init(); | 322 | apollon_flash_init(); |
329 | apollon_usb_init(); | 323 | apollon_usb_init(); |
@@ -356,12 +350,11 @@ static void __init omap_apollon_map_io(void) | |||
356 | 350 | ||
357 | MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") | 351 | MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") |
358 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ | 352 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ |
359 | .phys_io = 0x48000000, | ||
360 | .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, | ||
361 | .boot_params = 0x80000100, | 353 | .boot_params = 0x80000100, |
362 | .map_io = omap_apollon_map_io, | ||
363 | .reserve = omap_reserve, | 354 | .reserve = omap_reserve, |
364 | .init_irq = omap_apollon_init_irq, | 355 | .map_io = omap_apollon_map_io, |
356 | .init_early = omap_apollon_init_early, | ||
357 | .init_irq = omap_init_irq, | ||
365 | .init_machine = omap_apollon_init, | 358 | .init_machine = omap_apollon_init, |
366 | .timer = &omap_timer, | 359 | .timer = &omap_timer, |
367 | MACHINE_END | 360 | MACHINE_END |