aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2009-09-03 13:14:02 -0400
committerpaul <paul@twilight.(none)>2009-09-03 13:14:02 -0400
commitb3c6df3ab2b17cd7ddf927d39a64f235b25ac8d4 (patch)
tree58d26a0b0dc5dc597519260ef04f8bff67cc4f8c /arch
parent71348bcaac6f4c372525d4d62e88a82a7330435b (diff)
OMAP2/3 board-*.c files: read bootloader configuration earlier
Most board-*.c files read configuration data from the bootloader in their .init_machine() function. This needs to happen earlier, at some point before omap2_init_common_hw() is called. This is because a future patch will use the bootloader serial console port information to enable the UART clocks earlier, immediately after omap2_clk_init(). This is in turn necessary since otherwise clock tree usecounts on clocks like dpll4_m2x2_ck will be bogus, which can cause the currently-active console UART clock to be disabled during boot. Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c13
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c18
-rw-r--r--arch/arm/mach-omap2/board-apollon.c20
-rw-r--r--arch/arm/mach-omap2/board-generic.c10
-rw-r--r--arch/arm/mach-omap2/board-h4.c20
-rw-r--r--arch/arm/mach-omap2/board-ldp.c20
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c26
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c12
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c20
-rw-r--r--arch/arm/mach-omap2/board-overo.c20
-rw-r--r--arch/arm/mach-omap2/board-rx51.c4
-rw-r--r--arch/arm/mach-omap2/board-zoom2.c18
-rw-r--r--arch/arm/mach-omap2/io.c2
-rw-r--r--arch/arm/mach-omap2/serial.c14
-rw-r--r--arch/arm/plat-omap/include/mach/serial.h3
15 files changed, 118 insertions, 102 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 7f5a74d59243..42217b32f835 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -139,18 +139,19 @@ static inline void board_smc91x_init(void)
139 139
140#endif 140#endif
141 141
142static struct omap_board_config_kernel sdp2430_config[] = {
143 {OMAP_TAG_LCD, &sdp2430_lcd_config},
144};
145
142static void __init omap_2430sdp_init_irq(void) 146static void __init omap_2430sdp_init_irq(void)
143{ 147{
148 omap_board_config = sdp2430_config;
149 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
144 omap2_init_common_hw(NULL, NULL); 150 omap2_init_common_hw(NULL, NULL);
145 omap_init_irq(); 151 omap_init_irq();
146 omap_gpio_init(); 152 omap_gpio_init();
147} 153}
148 154
149static struct omap_board_config_kernel sdp2430_config[] = {
150 {OMAP_TAG_LCD, &sdp2430_lcd_config},
151};
152
153
154static struct twl4030_gpio_platform_data sdp2430_gpio_data = { 155static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
155 .gpio_base = OMAP_MAX_GPIO_LINES, 156 .gpio_base = OMAP_MAX_GPIO_LINES,
156 .irq_base = TWL4030_GPIO_IRQ_BASE, 157 .irq_base = TWL4030_GPIO_IRQ_BASE,
@@ -200,8 +201,6 @@ static void __init omap_2430sdp_init(void)
200 omap2430_i2c_init(); 201 omap2430_i2c_init();
201 202
202 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); 203 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
203 omap_board_config = sdp2430_config;
204 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
205 omap_serial_init(); 204 omap_serial_init();
206 twl4030_mmc_init(mmc); 205 twl4030_mmc_init(mmc);
207 usb_musb_init(); 206 usb_musb_init();
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 7e9b76cc7675..4500e7f674d7 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -167,13 +167,6 @@ static struct platform_device *sdp3430_devices[] __initdata = {
167 &sdp3430_lcd_device, 167 &sdp3430_lcd_device,
168}; 168};
169 169
170static void __init omap_3430sdp_init_irq(void)
171{
172 omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
173 omap_init_irq();
174 omap_gpio_init();
175}
176
177static struct omap_lcd_config sdp3430_lcd_config __initdata = { 170static struct omap_lcd_config sdp3430_lcd_config __initdata = {
178 .ctrl_name = "internal", 171 .ctrl_name = "internal",
179}; 172};
@@ -182,6 +175,15 @@ static struct omap_board_config_kernel sdp3430_config[] __initdata = {
182 { OMAP_TAG_LCD, &sdp3430_lcd_config }, 175 { OMAP_TAG_LCD, &sdp3430_lcd_config },
183}; 176};
184 177
178static void __init omap_3430sdp_init_irq(void)
179{
180 omap_board_config = sdp3430_config;
181 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
182 omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
183 omap_init_irq();
184 omap_gpio_init();
185}
186
185static int sdp3430_batt_table[] = { 187static int sdp3430_batt_table[] = {
186/* 0 C*/ 188/* 0 C*/
18730800, 29500, 28300, 27100, 18930800, 29500, 28300, 27100,
@@ -477,8 +479,6 @@ static void __init omap_3430sdp_init(void)
477{ 479{
478 omap3430_i2c_init(); 480 omap3430_i2c_init();
479 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices)); 481 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
480 omap_board_config = sdp3430_config;
481 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
482 if (omap_rev() > OMAP3430_REV_ES1_0) 482 if (omap_rev() > OMAP3430_REV_ES1_0)
483 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; 483 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
484 else 484 else
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 615f21d1eb23..7a2b54c7291a 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -248,14 +248,6 @@ out:
248 clk_put(gpmc_fck); 248 clk_put(gpmc_fck);
249} 249}
250 250
251static void __init omap_apollon_init_irq(void)
252{
253 omap2_init_common_hw(NULL, NULL);
254 omap_init_irq();
255 omap_gpio_init();
256 apollon_init_smc91x();
257}
258
259static struct omap_usb_config apollon_usb_config __initdata = { 251static struct omap_usb_config apollon_usb_config __initdata = {
260 .register_dev = 1, 252 .register_dev = 1,
261 .hmc_mode = 0x14, /* 0:dev 1:host1 2:disable */ 253 .hmc_mode = 0x14, /* 0:dev 1:host1 2:disable */
@@ -271,6 +263,16 @@ static struct omap_board_config_kernel apollon_config[] = {
271 { OMAP_TAG_LCD, &apollon_lcd_config }, 263 { OMAP_TAG_LCD, &apollon_lcd_config },
272}; 264};
273 265
266static void __init omap_apollon_init_irq(void)
267{
268 omap_board_config = apollon_config;
269 omap_board_config_size = ARRAY_SIZE(apollon_config);
270 omap2_init_common_hw(NULL, NULL);
271 omap_init_irq();
272 omap_gpio_init();
273 apollon_init_smc91x();
274}
275
274static void __init apollon_led_init(void) 276static void __init apollon_led_init(void)
275{ 277{
276 /* LED0 - AA10 */ 278 /* LED0 - AA10 */
@@ -319,8 +321,6 @@ static void __init omap_apollon_init(void)
319 * if not needed. 321 * if not needed.
320 */ 322 */
321 platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices)); 323 platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
322 omap_board_config = apollon_config;
323 omap_board_config_size = ARRAY_SIZE(apollon_config);
324 omap_serial_init(); 324 omap_serial_init();
325} 325}
326 326
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 3e401c5b6e41..2e09a1c444cb 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -31,19 +31,19 @@
31#include <mach/board.h> 31#include <mach/board.h>
32#include <mach/common.h> 32#include <mach/common.h>
33 33
34static struct omap_board_config_kernel generic_config[] = {
35};
36
34static void __init omap_generic_init_irq(void) 37static void __init omap_generic_init_irq(void)
35{ 38{
39 omap_board_config = generic_config;
40 omap_board_config_size = ARRAY_SIZE(generic_config);
36 omap2_init_common_hw(NULL, NULL); 41 omap2_init_common_hw(NULL, NULL);
37 omap_init_irq(); 42 omap_init_irq();
38} 43}
39 44
40static struct omap_board_config_kernel generic_config[] = {
41};
42
43static void __init omap_generic_init(void) 45static void __init omap_generic_init(void)
44{ 46{
45 omap_board_config = generic_config;
46 omap_board_config_size = ARRAY_SIZE(generic_config);
47 omap_serial_init(); 47 omap_serial_init();
48} 48}
49 49
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index b6501d241c10..eaa02d012c5c 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -268,14 +268,6 @@ static void __init h4_init_flash(void)
268 h4_flash_resource.end = base + SZ_64M - 1; 268 h4_flash_resource.end = base + SZ_64M - 1;
269} 269}
270 270
271static void __init omap_h4_init_irq(void)
272{
273 omap2_init_common_hw(NULL, NULL);
274 omap_init_irq();
275 omap_gpio_init();
276 h4_init_flash();
277}
278
279static struct omap_lcd_config h4_lcd_config __initdata = { 271static struct omap_lcd_config h4_lcd_config __initdata = {
280 .ctrl_name = "internal", 272 .ctrl_name = "internal",
281}; 273};
@@ -317,6 +309,16 @@ static struct omap_board_config_kernel h4_config[] = {
317 { OMAP_TAG_LCD, &h4_lcd_config }, 309 { OMAP_TAG_LCD, &h4_lcd_config },
318}; 310};
319 311
312static void __init omap_h4_init_irq(void)
313{
314 omap_board_config = h4_config;
315 omap_board_config_size = ARRAY_SIZE(h4_config);
316 omap2_init_common_hw(NULL, NULL);
317 omap_init_irq();
318 omap_gpio_init();
319 h4_init_flash();
320}
321
320static struct at24_platform_data m24c01 = { 322static struct at24_platform_data m24c01 = {
321 .byte_len = SZ_1K / 8, 323 .byte_len = SZ_1K / 8,
322 .page_size = 16, 324 .page_size = 16,
@@ -361,8 +363,6 @@ static void __init omap_h4_init(void)
361 ARRAY_SIZE(h4_i2c_board_info)); 363 ARRAY_SIZE(h4_i2c_board_info));
362 364
363 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); 365 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
364 omap_board_config = h4_config;
365 omap_board_config_size = ARRAY_SIZE(h4_config);
366 omap_usb_init(&h4_usb_config); 366 omap_usb_init(&h4_usb_config);
367 omap_serial_init(); 367 omap_serial_init();
368} 368}
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 2dd6806a1e8e..ec6854cbdd9f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -268,14 +268,6 @@ static inline void __init ldp_init_smsc911x(void)
268 gpio_direction_input(eth_gpio); 268 gpio_direction_input(eth_gpio);
269} 269}
270 270
271static void __init omap_ldp_init_irq(void)
272{
273 omap2_init_common_hw(NULL, NULL);
274 omap_init_irq();
275 omap_gpio_init();
276 ldp_init_smsc911x();
277}
278
279static struct platform_device ldp_lcd_device = { 271static struct platform_device ldp_lcd_device = {
280 .name = "ldp_lcd", 272 .name = "ldp_lcd",
281 .id = -1, 273 .id = -1,
@@ -289,6 +281,16 @@ static struct omap_board_config_kernel ldp_config[] __initdata = {
289 { OMAP_TAG_LCD, &ldp_lcd_config }, 281 { OMAP_TAG_LCD, &ldp_lcd_config },
290}; 282};
291 283
284static void __init omap_ldp_init_irq(void)
285{
286 omap_board_config = ldp_config;
287 omap_board_config_size = ARRAY_SIZE(ldp_config);
288 omap2_init_common_hw(NULL, NULL);
289 omap_init_irq();
290 omap_gpio_init();
291 ldp_init_smsc911x();
292}
293
292static struct twl4030_usb_data ldp_usb_data = { 294static struct twl4030_usb_data ldp_usb_data = {
293 .usb_mode = T2_USB_MODE_ULPI, 295 .usb_mode = T2_USB_MODE_ULPI,
294}; 296};
@@ -372,8 +374,6 @@ static void __init omap_ldp_init(void)
372{ 374{
373 omap_i2c_init(); 375 omap_i2c_init();
374 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 376 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
375 omap_board_config = ldp_config;
376 omap_board_config_size = ARRAY_SIZE(ldp_config);
377 ts_gpio = 54; 377 ts_gpio = 54;
378 ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio); 378 ldp_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
379 spi_register_board_info(ldp_spi_board_info, 379 spi_register_board_info(ldp_spi_board_info,
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index d79ea8da6270..500c9956876d 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -281,17 +281,6 @@ static int __init omap3_beagle_i2c_init(void)
281 return 0; 281 return 0;
282} 282}
283 283
284static void __init omap3_beagle_init_irq(void)
285{
286 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
287 mt46h32m32lf6_sdrc_params);
288 omap_init_irq();
289#ifdef CONFIG_OMAP_32K_TIMER
290 omap2_gp_clockevent_set_gptimer(12);
291#endif
292 omap_gpio_init();
293}
294
295static struct gpio_led gpio_leds[] = { 284static struct gpio_led gpio_leds[] = {
296 { 285 {
297 .name = "beagleboard::usr0", 286 .name = "beagleboard::usr0",
@@ -349,6 +338,19 @@ static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
349 { OMAP_TAG_LCD, &omap3_beagle_lcd_config }, 338 { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
350}; 339};
351 340
341static void __init omap3_beagle_init_irq(void)
342{
343 omap_board_config = omap3_beagle_config;
344 omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
345 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
346 mt46h32m32lf6_sdrc_params);
347 omap_init_irq();
348#ifdef CONFIG_OMAP_32K_TIMER
349 omap2_gp_clockevent_set_gptimer(12);
350#endif
351 omap_gpio_init();
352}
353
352static struct platform_device *omap3_beagle_devices[] __initdata = { 354static struct platform_device *omap3_beagle_devices[] __initdata = {
353 &omap3_beagle_lcd_device, 355 &omap3_beagle_lcd_device,
354 &leds_gpio, 356 &leds_gpio,
@@ -398,8 +400,6 @@ static void __init omap3_beagle_init(void)
398 omap3_beagle_i2c_init(); 400 omap3_beagle_i2c_init();
399 platform_add_devices(omap3_beagle_devices, 401 platform_add_devices(omap3_beagle_devices,
400 ARRAY_SIZE(omap3_beagle_devices)); 402 ARRAY_SIZE(omap3_beagle_devices));
401 omap_board_config = omap3_beagle_config;
402 omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
403 omap_serial_init(); 403 omap_serial_init();
404 404
405 omap_cfg_reg(J25_34XX_GPIO170); 405 omap_cfg_reg(J25_34XX_GPIO170);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3e0435371ce6..d50b9be90580 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -274,18 +274,20 @@ struct spi_board_info omap3evm_spi_board_info[] = {
274 }, 274 },
275}; 275};
276 276
277static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
278 { OMAP_TAG_LCD, &omap3_evm_lcd_config },
279};
280
277static void __init omap3_evm_init_irq(void) 281static void __init omap3_evm_init_irq(void)
278{ 282{
283 omap_board_config = omap3_evm_config;
284 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
279 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); 285 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
280 omap_init_irq(); 286 omap_init_irq();
281 omap_gpio_init(); 287 omap_gpio_init();
282 omap3evm_init_smc911x(); 288 omap3evm_init_smc911x();
283} 289}
284 290
285static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
286 { OMAP_TAG_LCD, &omap3_evm_lcd_config },
287};
288
289static struct platform_device *omap3_evm_devices[] __initdata = { 291static struct platform_device *omap3_evm_devices[] __initdata = {
290 &omap3_evm_lcd_device, 292 &omap3_evm_lcd_device,
291 &omap3evm_smc911x_device, 293 &omap3evm_smc911x_device,
@@ -296,8 +298,6 @@ static void __init omap3_evm_init(void)
296 omap3_evm_i2c_init(); 298 omap3_evm_i2c_init();
297 299
298 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); 300 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
299 omap_board_config = omap3_evm_config;
300 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
301 301
302 spi_register_board_info(omap3evm_spi_board_info, 302 spi_register_board_info(omap3evm_spi_board_info,
303 ARRAY_SIZE(omap3evm_spi_board_info)); 303 ARRAY_SIZE(omap3evm_spi_board_info));
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 8236708c3627..b43f6e36b6d9 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -305,14 +305,6 @@ static int __init omap3pandora_i2c_init(void)
305 return 0; 305 return 0;
306} 306}
307 307
308static void __init omap3pandora_init_irq(void)
309{
310 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
311 mt46h32m32lf6_sdrc_params);
312 omap_init_irq();
313 omap_gpio_init();
314}
315
316static void __init omap3pandora_ads7846_init(void) 308static void __init omap3pandora_ads7846_init(void)
317{ 309{
318 int gpio = OMAP3_PANDORA_TS_GPIO; 310 int gpio = OMAP3_PANDORA_TS_GPIO;
@@ -375,6 +367,16 @@ static struct omap_board_config_kernel omap3pandora_config[] __initdata = {
375 { OMAP_TAG_LCD, &omap3pandora_lcd_config }, 367 { OMAP_TAG_LCD, &omap3pandora_lcd_config },
376}; 368};
377 369
370static void __init omap3pandora_init_irq(void)
371{
372 omap_board_config = omap3pandora_config;
373 omap_board_config_size = ARRAY_SIZE(omap3pandora_config);
374 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
375 mt46h32m32lf6_sdrc_params);
376 omap_init_irq();
377 omap_gpio_init();
378}
379
378static struct platform_device *omap3pandora_devices[] __initdata = { 380static struct platform_device *omap3pandora_devices[] __initdata = {
379 &omap3pandora_lcd_device, 381 &omap3pandora_lcd_device,
380 &pandora_leds_gpio, 382 &pandora_leds_gpio,
@@ -386,8 +388,6 @@ static void __init omap3pandora_init(void)
386 omap3pandora_i2c_init(); 388 omap3pandora_i2c_init();
387 platform_add_devices(omap3pandora_devices, 389 platform_add_devices(omap3pandora_devices,
388 ARRAY_SIZE(omap3pandora_devices)); 390 ARRAY_SIZE(omap3pandora_devices));
389 omap_board_config = omap3pandora_config;
390 omap_board_config_size = ARRAY_SIZE(omap3pandora_config);
391 omap_serial_init(); 391 omap_serial_init();
392 spi_register_board_info(omap3pandora_spi_board_info, 392 spi_register_board_info(omap3pandora_spi_board_info,
393 ARRAY_SIZE(omap3pandora_spi_board_info)); 393 ARRAY_SIZE(omap3pandora_spi_board_info));
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index eb78e6eab4f4..9917d2fddc2f 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -357,14 +357,6 @@ static int __init overo_i2c_init(void)
357 return 0; 357 return 0;
358} 358}
359 359
360static void __init overo_init_irq(void)
361{
362 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
363 mt46h32m32lf6_sdrc_params);
364 omap_init_irq();
365 omap_gpio_init();
366}
367
368static struct platform_device overo_lcd_device = { 360static struct platform_device overo_lcd_device = {
369 .name = "overo_lcd", 361 .name = "overo_lcd",
370 .id = -1, 362 .id = -1,
@@ -378,6 +370,16 @@ static struct omap_board_config_kernel overo_config[] __initdata = {
378 { OMAP_TAG_LCD, &overo_lcd_config }, 370 { OMAP_TAG_LCD, &overo_lcd_config },
379}; 371};
380 372
373static void __init overo_init_irq(void)
374{
375 omap_board_config = overo_config;
376 omap_board_config_size = ARRAY_SIZE(overo_config);
377 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
378 mt46h32m32lf6_sdrc_params);
379 omap_init_irq();
380 omap_gpio_init();
381}
382
381static struct platform_device *overo_devices[] __initdata = { 383static struct platform_device *overo_devices[] __initdata = {
382 &overo_lcd_device, 384 &overo_lcd_device,
383}; 385};
@@ -386,8 +388,6 @@ static void __init overo_init(void)
386{ 388{
387 overo_i2c_init(); 389 overo_i2c_init();
388 platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); 390 platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
389 omap_board_config = overo_config;
390 omap_board_config_size = ARRAY_SIZE(overo_config);
391 omap_serial_init(); 391 omap_serial_init();
392 overo_flash_init(); 392 overo_flash_init();
393 usb_musb_init(); 393 usb_musb_init();
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index c0d13401425f..f9196c3b1a7b 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -56,6 +56,8 @@ static struct omap_board_config_kernel rx51_config[] = {
56 56
57static void __init rx51_init_irq(void) 57static void __init rx51_init_irq(void)
58{ 58{
59 omap_board_config = rx51_config;
60 omap_board_config_size = ARRAY_SIZE(rx51_config);
59 omap2_init_common_hw(NULL, NULL); 61 omap2_init_common_hw(NULL, NULL);
60 omap_init_irq(); 62 omap_init_irq();
61 omap_gpio_init(); 63 omap_gpio_init();
@@ -65,8 +67,6 @@ extern void __init rx51_peripherals_init(void);
65 67
66static void __init rx51_init(void) 68static void __init rx51_init(void)
67{ 69{
68 omap_board_config = rx51_config;
69 omap_board_config_size = ARRAY_SIZE(rx51_config);
70 omap_serial_init(); 70 omap_serial_init();
71 usb_musb_init(); 71 usb_musb_init();
72 rx51_peripherals_init(); 72 rx51_peripherals_init();
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index dabba2720a9b..324009edbd53 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -90,13 +90,6 @@ static struct twl4030_keypad_data zoom2_kp_twl4030_data = {
90 .rep = 1, 90 .rep = 1,
91}; 91};
92 92
93static void __init omap_zoom2_init_irq(void)
94{
95 omap2_init_common_hw(NULL, NULL);
96 omap_init_irq();
97 omap_gpio_init();
98}
99
100static struct omap_board_config_kernel zoom2_config[] __initdata = { 93static struct omap_board_config_kernel zoom2_config[] __initdata = {
101}; 94};
102 95
@@ -212,6 +205,15 @@ static struct twl4030_usb_data zoom2_usb_data = {
212 .usb_mode = T2_USB_MODE_ULPI, 205 .usb_mode = T2_USB_MODE_ULPI,
213}; 206};
214 207
208static void __init omap_zoom2_init_irq(void)
209{
210 omap_board_config = zoom2_config;
211 omap_board_config_size = ARRAY_SIZE(zoom2_config);
212 omap2_init_common_hw(NULL, NULL);
213 omap_init_irq();
214 omap_gpio_init();
215}
216
215static struct twl4030_gpio_platform_data zoom2_gpio_data = { 217static struct twl4030_gpio_platform_data zoom2_gpio_data = {
216 .gpio_base = OMAP_MAX_GPIO_LINES, 218 .gpio_base = OMAP_MAX_GPIO_LINES,
217 .irq_base = TWL4030_GPIO_IRQ_BASE, 219 .irq_base = TWL4030_GPIO_IRQ_BASE,
@@ -262,8 +264,6 @@ extern int __init omap_zoom2_debugboard_init(void);
262static void __init omap_zoom2_init(void) 264static void __init omap_zoom2_init(void)
263{ 265{
264 omap_i2c_init(); 266 omap_i2c_init();
265 omap_board_config = zoom2_config;
266 omap_board_config_size = ARRAY_SIZE(zoom2_config);
267 omap_serial_init(); 267 omap_serial_init();
268 omap_zoom2_debugboard_init(); 268 omap_zoom2_debugboard_init();
269 usb_musb_init(); 269 usb_musb_init();
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 4bfe873e1b83..470b1d10c4e5 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -32,6 +32,7 @@
32#include <mach/sram.h> 32#include <mach/sram.h>
33#include <mach/sdrc.h> 33#include <mach/sdrc.h>
34#include <mach/gpmc.h> 34#include <mach/gpmc.h>
35#include <mach/serial.h>
35 36
36#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdev is ready */ 37#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdev is ready */
37#include "clock.h" 38#include "clock.h"
@@ -287,6 +288,7 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
287 pwrdm_init(powerdomains_omap); 288 pwrdm_init(powerdomains_omap);
288 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); 289 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
289 omap2_clk_init(); 290 omap2_clk_init();
291 omap_serial_early_init();
290 omap_pm_if_init(); 292 omap_pm_if_init();
291 omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 293 omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
292 _omap2_init_reprogram_sdrc(); 294 _omap2_init_reprogram_sdrc();
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index dd3c735b5588..ca28424f2fbd 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -552,7 +552,7 @@ static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = {
552 }, 552 },
553}; 553};
554 554
555void __init omap_serial_init(void) 555void __init omap_serial_early_init(void)
556{ 556{
557 int i; 557 int i;
558 char name[16]; 558 char name[16];
@@ -595,6 +595,18 @@ void __init omap_serial_init(void)
595 p->irq += 32; 595 p->irq += 32;
596 596
597 omap_uart_enable_clocks(uart); 597 omap_uart_enable_clocks(uart);
598 }
599}
600
601void __init omap_serial_init(void)
602{
603 int i;
604
605 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
606 struct omap_uart_state *uart = &omap_uart[i];
607 struct platform_device *pdev = &uart->pdev;
608 struct device *dev = &pdev->dev;
609
598 omap_uart_reset(uart); 610 omap_uart_reset(uart);
599 omap_uart_idle_init(uart); 611 omap_uart_idle_init(uart);
600 612
diff --git a/arch/arm/plat-omap/include/mach/serial.h b/arch/arm/plat-omap/include/mach/serial.h
index def0529c75eb..e249186d26e2 100644
--- a/arch/arm/plat-omap/include/mach/serial.h
+++ b/arch/arm/plat-omap/include/mach/serial.h
@@ -13,6 +13,8 @@
13#ifndef __ASM_ARCH_SERIAL_H 13#ifndef __ASM_ARCH_SERIAL_H
14#define __ASM_ARCH_SERIAL_H 14#define __ASM_ARCH_SERIAL_H
15 15
16#include <linux/init.h>
17
16#if defined(CONFIG_ARCH_OMAP1) 18#if defined(CONFIG_ARCH_OMAP1)
17/* OMAP1 serial ports */ 19/* OMAP1 serial ports */
18#define OMAP_UART1_BASE 0xfffb0000 20#define OMAP_UART1_BASE 0xfffb0000
@@ -53,6 +55,7 @@
53 }) 55 })
54 56
55#ifndef __ASSEMBLER__ 57#ifndef __ASSEMBLER__
58extern void __init omap_serial_early_init(void);
56extern void omap_serial_init(void); 59extern void omap_serial_init(void);
57extern int omap_uart_can_sleep(void); 60extern int omap_uart_can_sleep(void);
58extern void omap_uart_check_wakeup(void); 61extern void omap_uart_check_wakeup(void);