diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-12-14 14:42:35 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-12-21 21:55:12 -0500 |
commit | 2092e5ccf89db09ebde94e9aabd3c86d5fa05c6c (patch) | |
tree | c286d08314b82afe63485a79e13013492186e218 /arch/arm/mach-omap2/io.c | |
parent | e4dc8f507c3066d6fcece988d99b6d766c46af85 (diff) |
OMAP2+: hwmod: add postsetup state
Allow board files and OMAP core code to control the state that some or
all of the hwmods end up in at the end of _setup() (called by
omap_hwmod_late_init() ). Reimplement the old skip_setup_idle code in
terms of this new postsetup state code.
There are two use-cases for this patch: the !CONFIG_PM_RUNTIME case,
in which all IP blocks should stay enabled after _setup() finishes;
and the MPU watchdog case, in which the watchdog IP block should enter
idle if watchdog coverage of kernel initialization is desired, and
should be disabled otherwise.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: BenoƮt Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Charulatha Varadarajan <charu@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/io.c')
-rw-r--r-- | arch/arm/mach-omap2/io.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 77bf0d1baeef..7362b69a154d 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -312,6 +312,11 @@ static int __init _omap2_init_reprogram_sdrc(void) | |||
312 | return v; | 312 | return v; |
313 | } | 313 | } |
314 | 314 | ||
315 | static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) | ||
316 | { | ||
317 | return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); | ||
318 | } | ||
319 | |||
315 | /* | 320 | /* |
316 | * Initialize asm_irq_base for entry-macro.S | 321 | * Initialize asm_irq_base for entry-macro.S |
317 | */ | 322 | */ |
@@ -333,6 +338,8 @@ static inline void omap_irq_base_init(void) | |||
333 | 338 | ||
334 | void __init omap2_init_common_infrastructure(void) | 339 | void __init omap2_init_common_infrastructure(void) |
335 | { | 340 | { |
341 | u8 postsetup_state; | ||
342 | |||
336 | pwrdm_init(powerdomains_omap); | 343 | pwrdm_init(powerdomains_omap); |
337 | clkdm_init(clockdomains_omap, clkdm_autodeps); | 344 | clkdm_init(clockdomains_omap, clkdm_autodeps); |
338 | if (cpu_is_omap242x()) | 345 | if (cpu_is_omap242x()) |
@@ -343,6 +350,16 @@ void __init omap2_init_common_infrastructure(void) | |||
343 | omap3xxx_hwmod_init(); | 350 | omap3xxx_hwmod_init(); |
344 | else if (cpu_is_omap44xx()) | 351 | else if (cpu_is_omap44xx()) |
345 | omap44xx_hwmod_init(); | 352 | omap44xx_hwmod_init(); |
353 | else | ||
354 | pr_err("Could not init hwmod data - unknown SoC\n"); | ||
355 | |||
356 | /* Set the default postsetup state for all hwmods */ | ||
357 | #ifdef CONFIG_PM_RUNTIME | ||
358 | postsetup_state = _HWMOD_STATE_IDLE; | ||
359 | #else | ||
360 | postsetup_state = _HWMOD_STATE_ENABLED; | ||
361 | #endif | ||
362 | omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state); | ||
346 | 363 | ||
347 | omap_pm_if_early_init(); | 364 | omap_pm_if_early_init(); |
348 | 365 | ||
@@ -355,25 +372,16 @@ void __init omap2_init_common_infrastructure(void) | |||
355 | else if (cpu_is_omap44xx()) | 372 | else if (cpu_is_omap44xx()) |
356 | omap4xxx_clk_init(); | 373 | omap4xxx_clk_init(); |
357 | else | 374 | else |
358 | pr_err("Could not init clock framework - unknown CPU\n"); | 375 | pr_err("Could not init clock framework - unknown SoC\n"); |
359 | } | 376 | } |
360 | 377 | ||
361 | /* | ||
362 | * XXX Ideally, this function will dwindle into nothingness over time; | ||
363 | * almost all device init code should be possible through initcalls | ||
364 | * and other generalized mechanisms | ||
365 | */ | ||
366 | void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, | 378 | void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, |
367 | struct omap_sdrc_params *sdrc_cs1) | 379 | struct omap_sdrc_params *sdrc_cs1) |
368 | { | 380 | { |
369 | u8 skip_setup_idle = 0; | ||
370 | |||
371 | omap_serial_early_init(); | 381 | omap_serial_early_init(); |
372 | 382 | ||
373 | #ifndef CONFIG_PM_RUNTIME | 383 | omap_hwmod_late_init(); |
374 | skip_setup_idle = 1; | 384 | |
375 | #endif | ||
376 | omap_hwmod_late_init(skip_setup_idle); | ||
377 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | 385 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
378 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); | 386 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); |
379 | _omap2_init_reprogram_sdrc(); | 387 | _omap2_init_reprogram_sdrc(); |