diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2008-11-25 14:48:24 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-28 13:59:05 -0400 |
commit | 1155e426b7365f7909f5a32612feff7361aa0f4c (patch) | |
tree | 1d465e4c722e02a54fde113888f9c684e63c8eeb /arch/arm/mach-omap2/pm34xx.c | |
parent | 94434535bd36ca010a81e1199f954beef2c4de64 (diff) |
OMAP3: PM: Force IVA2 into idle during bootup
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 4474947ddd64..b2a8730771e9 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -352,6 +352,54 @@ static struct platform_suspend_ops omap_pm_ops = { | |||
352 | .valid = suspend_valid_only_mem, | 352 | .valid = suspend_valid_only_mem, |
353 | }; | 353 | }; |
354 | 354 | ||
355 | |||
356 | /** | ||
357 | * omap3_iva_idle(): ensure IVA is in idle so it can be put into | ||
358 | * retention | ||
359 | * | ||
360 | * In cases where IVA2 is activated by bootcode, it may prevent | ||
361 | * full-chip retention or off-mode because it is not idle. This | ||
362 | * function forces the IVA2 into idle state so it can go | ||
363 | * into retention/off and thus allow full-chip retention/off. | ||
364 | * | ||
365 | **/ | ||
366 | static void __init omap3_iva_idle(void) | ||
367 | { | ||
368 | /* ensure IVA2 clock is disabled */ | ||
369 | cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); | ||
370 | |||
371 | /* if no clock activity, nothing else to do */ | ||
372 | if (!(cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) & | ||
373 | OMAP3430_CLKACTIVITY_IVA2_MASK)) | ||
374 | return; | ||
375 | |||
376 | /* Reset IVA2 */ | ||
377 | prm_write_mod_reg(OMAP3430_RST1_IVA2 | | ||
378 | OMAP3430_RST2_IVA2 | | ||
379 | OMAP3430_RST3_IVA2, | ||
380 | OMAP3430_IVA2_MOD, RM_RSTCTRL); | ||
381 | |||
382 | /* Enable IVA2 clock */ | ||
383 | cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2, | ||
384 | OMAP3430_IVA2_MOD, CM_FCLKEN); | ||
385 | |||
386 | /* Set IVA2 boot mode to 'idle' */ | ||
387 | omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE, | ||
388 | OMAP343X_CONTROL_IVA2_BOOTMOD); | ||
389 | |||
390 | /* Un-reset IVA2 */ | ||
391 | prm_write_mod_reg(0, OMAP3430_IVA2_MOD, RM_RSTCTRL); | ||
392 | |||
393 | /* Disable IVA2 clock */ | ||
394 | cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); | ||
395 | |||
396 | /* Reset IVA2 */ | ||
397 | prm_write_mod_reg(OMAP3430_RST1_IVA2 | | ||
398 | OMAP3430_RST2_IVA2 | | ||
399 | OMAP3430_RST3_IVA2, | ||
400 | OMAP3430_IVA2_MOD, RM_RSTCTRL); | ||
401 | } | ||
402 | |||
355 | static void __init prcm_setup_regs(void) | 403 | static void __init prcm_setup_regs(void) |
356 | { | 404 | { |
357 | /* reset modem */ | 405 | /* reset modem */ |
@@ -511,6 +559,8 @@ static void __init prcm_setup_regs(void) | |||
511 | * it is selected to mpu wakeup goup */ | 559 | * it is selected to mpu wakeup goup */ |
512 | prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN, | 560 | prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN, |
513 | OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); | 561 | OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); |
562 | |||
563 | omap3_iva_idle(); | ||
514 | } | 564 | } |
515 | 565 | ||
516 | static int __init pwrdms_setup(struct powerdomain *pwrdm) | 566 | static int __init pwrdms_setup(struct powerdomain *pwrdm) |