aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/io.c')
-rw-r--r--arch/arm/mach-omap2/io.c76
1 files changed, 57 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 5577ab2faad2..e66687b0b9de 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -39,12 +39,9 @@
39#include "io.h" 39#include "io.h"
40 40
41#include <plat/omap-pm.h> 41#include <plat/omap-pm.h>
42#include <plat/powerdomain.h> 42#include "powerdomain.h"
43#include "powerdomains.h"
44
45#include <plat/clockdomain.h>
46#include "clockdomains.h"
47 43
44#include "clockdomain.h"
48#include <plat/omap_hwmod.h> 45#include <plat/omap_hwmod.h>
49#include <plat/multi.h> 46#include <plat/multi.h>
50 47
@@ -312,6 +309,11 @@ static int __init _omap2_init_reprogram_sdrc(void)
312 return v; 309 return v;
313} 310}
314 311
312static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
313{
314 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
315}
316
315/* 317/*
316 * Initialize asm_irq_base for entry-macro.S 318 * Initialize asm_irq_base for entry-macro.S
317 */ 319 */
@@ -331,21 +333,55 @@ static inline void omap_irq_base_init(void)
331#endif 333#endif
332} 334}
333 335
334void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, 336void __init omap2_init_common_infrastructure(void)
335 struct omap_sdrc_params *sdrc_cs1)
336{ 337{
337 u8 skip_setup_idle = 0; 338 u8 postsetup_state;
338 339
339 pwrdm_init(powerdomains_omap); 340 if (cpu_is_omap242x()) {
340 clkdm_init(clockdomains_omap, clkdm_autodeps); 341 omap2xxx_powerdomains_init();
341 if (cpu_is_omap242x()) 342 omap2_clockdomains_init();
342 omap2420_hwmod_init(); 343 omap2420_hwmod_init();
343 else if (cpu_is_omap243x()) 344 } else if (cpu_is_omap243x()) {
345 omap2xxx_powerdomains_init();
346 omap2_clockdomains_init();
344 omap2430_hwmod_init(); 347 omap2430_hwmod_init();
345 else if (cpu_is_omap34xx()) 348 } else if (cpu_is_omap34xx()) {
349 omap3xxx_powerdomains_init();
350 omap2_clockdomains_init();
346 omap3xxx_hwmod_init(); 351 omap3xxx_hwmod_init();
347 else if (cpu_is_omap44xx()) 352 } else if (cpu_is_omap44xx()) {
353 omap44xx_powerdomains_init();
354 omap44xx_clockdomains_init();
348 omap44xx_hwmod_init(); 355 omap44xx_hwmod_init();
356 } else {
357 pr_err("Could not init hwmod data - unknown SoC\n");
358 }
359
360 /* Set the default postsetup state for all hwmods */
361#ifdef CONFIG_PM_RUNTIME
362 postsetup_state = _HWMOD_STATE_IDLE;
363#else
364 postsetup_state = _HWMOD_STATE_ENABLED;
365#endif
366 omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
367
368 /*
369 * Set the default postsetup state for unusual modules (like
370 * MPU WDT).
371 *
372 * The postsetup_state is not actually used until
373 * omap_hwmod_late_init(), so boards that desire full watchdog
374 * coverage of kernel initialization can reprogram the
375 * postsetup_state between the calls to
376 * omap2_init_common_infra() and omap2_init_common_devices().
377 *
378 * XXX ideally we could detect whether the MPU WDT was currently
379 * enabled here and make this conditional
380 */
381 postsetup_state = _HWMOD_STATE_DISABLED;
382 omap_hwmod_for_each_by_class("wd_timer",
383 _set_hwmod_postsetup_state,
384 &postsetup_state);
349 385
350 omap_pm_if_early_init(); 386 omap_pm_if_early_init();
351 387
@@ -358,14 +394,16 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
358 else if (cpu_is_omap44xx()) 394 else if (cpu_is_omap44xx())
359 omap4xxx_clk_init(); 395 omap4xxx_clk_init();
360 else 396 else
361 pr_err("Could not init clock framework - unknown CPU\n"); 397 pr_err("Could not init clock framework - unknown SoC\n");
398}
362 399
400void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
401 struct omap_sdrc_params *sdrc_cs1)
402{
363 omap_serial_early_init(); 403 omap_serial_early_init();
364 404
365#ifndef CONFIG_PM_RUNTIME 405 omap_hwmod_late_init();
366 skip_setup_idle = 1; 406
367#endif
368 omap_hwmod_late_init(skip_setup_idle);
369 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 407 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
370 omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 408 omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
371 _omap2_init_reprogram_sdrc(); 409 _omap2_init_reprogram_sdrc();