diff options
author | Tony Lindgren <tony@atomide.com> | 2011-10-04 21:26:28 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-10-19 19:34:10 -0400 |
commit | 7b250aff1ce346b6c7bc0329a2350334d1c66525 (patch) | |
tree | 8508301ab376f1f95e30b5a63414dc52337bc906 | |
parent | 7b88e62f5d219a86d81bdf4388012c97dc42e8f8 (diff) |
ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done
This way we don't need to initialize SoC detection early
and can start using generic map_io.
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-omap2/io.c | 95 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/common.h | 1 |
3 files changed, 50 insertions, 53 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 4a5d75f11610..4c25742ebf6d 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -444,11 +444,6 @@ static struct platform_device keys_gpio = { | |||
444 | }, | 444 | }, |
445 | }; | 445 | }; |
446 | 446 | ||
447 | static void __init omap3_beagle_init_early(void) | ||
448 | { | ||
449 | omap2_init_common_infrastructure(); | ||
450 | } | ||
451 | |||
452 | static struct platform_device *omap3_beagle_devices[] __initdata = { | 447 | static struct platform_device *omap3_beagle_devices[] __initdata = { |
453 | &leds_gpio, | 448 | &leds_gpio, |
454 | &keys_gpio, | 449 | &keys_gpio, |
@@ -555,7 +550,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | |||
555 | .boot_params = 0x80000100, | 550 | .boot_params = 0x80000100, |
556 | .reserve = omap_reserve, | 551 | .reserve = omap_reserve, |
557 | .map_io = omap3_map_io, | 552 | .map_io = omap3_map_io, |
558 | .init_early = omap3_beagle_init_early, | 553 | .init_early = omap3_init_early, |
559 | .init_irq = omap3_init_irq, | 554 | .init_irq = omap3_init_irq, |
560 | .init_machine = omap3_beagle_init, | 555 | .init_machine = omap3_beagle_init, |
561 | .timer = &omap3_secure_timer, | 556 | .timer = &omap3_secure_timer, |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 15f91c42be66..e8123d010307 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -248,9 +248,6 @@ static void __init _omap2_map_common_io(void) | |||
248 | */ | 248 | */ |
249 | local_flush_tlb_all(); | 249 | local_flush_tlb_all(); |
250 | flush_cache_all(); | 250 | flush_cache_all(); |
251 | |||
252 | omap2_check_revision(); | ||
253 | omap_sram_init(); | ||
254 | } | 251 | } |
255 | 252 | ||
256 | #ifdef CONFIG_SOC_OMAP2420 | 253 | #ifdef CONFIG_SOC_OMAP2420 |
@@ -337,33 +334,15 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) | |||
337 | /* See irq.c, omap4-common.c and entry-macro.S */ | 334 | /* See irq.c, omap4-common.c and entry-macro.S */ |
338 | void __iomem *omap_irq_base; | 335 | void __iomem *omap_irq_base; |
339 | 336 | ||
340 | void __init omap2_init_common_infrastructure(void) | 337 | static void __init omap_common_init_early(void) |
341 | { | 338 | { |
342 | u8 postsetup_state; | 339 | omap2_check_revision(); |
340 | omap_sram_init(); | ||
341 | } | ||
343 | 342 | ||
344 | if (cpu_is_omap242x()) { | 343 | static void __init omap_hwmod_init_postsetup(void) |
345 | omap2xxx_voltagedomains_init(); | 344 | { |
346 | omap242x_powerdomains_init(); | 345 | u8 postsetup_state; |
347 | omap242x_clockdomains_init(); | ||
348 | omap2420_hwmod_init(); | ||
349 | } else if (cpu_is_omap243x()) { | ||
350 | omap2xxx_voltagedomains_init(); | ||
351 | omap243x_powerdomains_init(); | ||
352 | omap243x_clockdomains_init(); | ||
353 | omap2430_hwmod_init(); | ||
354 | } else if (cpu_is_omap34xx()) { | ||
355 | omap3xxx_voltagedomains_init(); | ||
356 | omap3xxx_powerdomains_init(); | ||
357 | omap3xxx_clockdomains_init(); | ||
358 | omap3xxx_hwmod_init(); | ||
359 | } else if (cpu_is_omap44xx()) { | ||
360 | omap44xx_voltagedomains_init(); | ||
361 | omap44xx_powerdomains_init(); | ||
362 | omap44xx_clockdomains_init(); | ||
363 | omap44xx_hwmod_init(); | ||
364 | } else { | ||
365 | pr_err("Could not init hwmod data - unknown SoC\n"); | ||
366 | } | ||
367 | 346 | ||
368 | /* Set the default postsetup state for all hwmods */ | 347 | /* Set the default postsetup state for all hwmods */ |
369 | #ifdef CONFIG_PM_RUNTIME | 348 | #ifdef CONFIG_PM_RUNTIME |
@@ -392,57 +371,79 @@ void __init omap2_init_common_infrastructure(void) | |||
392 | &postsetup_state); | 371 | &postsetup_state); |
393 | 372 | ||
394 | omap_pm_if_early_init(); | 373 | omap_pm_if_early_init(); |
395 | |||
396 | if (cpu_is_omap2420()) | ||
397 | omap2420_clk_init(); | ||
398 | else if (cpu_is_omap2430()) | ||
399 | omap2430_clk_init(); | ||
400 | else if (cpu_is_omap34xx()) | ||
401 | omap3xxx_clk_init(); | ||
402 | else if (cpu_is_omap44xx()) | ||
403 | omap4xxx_clk_init(); | ||
404 | else | ||
405 | pr_err("Could not init clock framework - unknown SoC\n"); | ||
406 | } | 374 | } |
407 | 375 | ||
408 | void __init omap2420_init_early(void) | 376 | void __init omap2420_init_early(void) |
409 | { | 377 | { |
410 | omap2_init_common_infrastructure(); | 378 | omap_common_init_early(); |
379 | omap2xxx_voltagedomains_init(); | ||
380 | omap242x_powerdomains_init(); | ||
381 | omap242x_clockdomains_init(); | ||
382 | omap2420_hwmod_init(); | ||
383 | omap_hwmod_init_postsetup(); | ||
384 | omap2420_clk_init(); | ||
411 | } | 385 | } |
412 | 386 | ||
413 | void __init omap2430_init_early(void) | 387 | void __init omap2430_init_early(void) |
414 | { | 388 | { |
415 | omap2_init_common_infrastructure(); | 389 | omap_common_init_early(); |
390 | omap2xxx_voltagedomains_init(); | ||
391 | omap243x_powerdomains_init(); | ||
392 | omap243x_clockdomains_init(); | ||
393 | omap2430_hwmod_init(); | ||
394 | omap_hwmod_init_postsetup(); | ||
395 | omap2430_clk_init(); | ||
396 | } | ||
397 | |||
398 | /* | ||
399 | * Currently only board-omap3beagle.c should call this because of the | ||
400 | * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT. | ||
401 | */ | ||
402 | void __init omap3_init_early(void) | ||
403 | { | ||
404 | omap_common_init_early(); | ||
405 | omap3xxx_voltagedomains_init(); | ||
406 | omap3xxx_powerdomains_init(); | ||
407 | omap3xxx_clockdomains_init(); | ||
408 | omap3xxx_hwmod_init(); | ||
409 | omap_hwmod_init_postsetup(); | ||
410 | omap3xxx_clk_init(); | ||
416 | } | 411 | } |
417 | 412 | ||
418 | void __init omap3430_init_early(void) | 413 | void __init omap3430_init_early(void) |
419 | { | 414 | { |
420 | omap2_init_common_infrastructure(); | 415 | omap3_init_early(); |
421 | } | 416 | } |
422 | 417 | ||
423 | void __init omap35xx_init_early(void) | 418 | void __init omap35xx_init_early(void) |
424 | { | 419 | { |
425 | omap2_init_common_infrastructure(); | 420 | omap3_init_early(); |
426 | } | 421 | } |
427 | 422 | ||
428 | void __init omap3630_init_early(void) | 423 | void __init omap3630_init_early(void) |
429 | { | 424 | { |
430 | omap2_init_common_infrastructure(); | 425 | omap3_init_early(); |
431 | } | 426 | } |
432 | 427 | ||
433 | void __init am35xx_init_early(void) | 428 | void __init am35xx_init_early(void) |
434 | { | 429 | { |
435 | omap2_init_common_infrastructure(); | 430 | omap3_init_early(); |
436 | } | 431 | } |
437 | 432 | ||
438 | void __init ti816x_init_early(void) | 433 | void __init ti816x_init_early(void) |
439 | { | 434 | { |
440 | omap2_init_common_infrastructure(); | 435 | omap3_init_early(); |
441 | } | 436 | } |
442 | 437 | ||
443 | void __init omap4430_init_early(void) | 438 | void __init omap4430_init_early(void) |
444 | { | 439 | { |
445 | omap2_init_common_infrastructure(); | 440 | omap_common_init_early(); |
441 | omap44xx_voltagedomains_init(); | ||
442 | omap44xx_powerdomains_init(); | ||
443 | omap44xx_clockdomains_init(); | ||
444 | omap44xx_hwmod_init(); | ||
445 | omap_hwmod_init_postsetup(); | ||
446 | omap4xxx_clk_init(); | ||
446 | } | 447 | } |
447 | 448 | ||
448 | void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | 449 | void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, |
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h index abda2c7e499b..5eac3553f96d 100644 --- a/arch/arm/plat-omap/include/plat/common.h +++ b/arch/arm/plat-omap/include/plat/common.h | |||
@@ -50,6 +50,7 @@ void omap2430_init_early(void); | |||
50 | void omap3430_init_early(void); | 50 | void omap3430_init_early(void); |
51 | void omap35xx_init_early(void); | 51 | void omap35xx_init_early(void); |
52 | void omap3630_init_early(void); | 52 | void omap3630_init_early(void); |
53 | void omap3_init_early(void); /* Do not use this one */ | ||
53 | void am35xx_init_early(void); | 54 | void am35xx_init_early(void); |
54 | void ti816x_init_early(void); | 55 | void ti816x_init_early(void); |
55 | void omap4430_init_early(void); | 56 | void omap4430_init_early(void); |