aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm34xx.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-02-26 10:30:43 -0500
committerTero Kristo <t-kristo@ti.com>2014-07-04 10:02:17 -0400
commitc5180a2b3e26d9b82277986f830c89a50103e65a (patch)
treeb7c7ca7ac908337b88e6048766b4244c431cb995 /arch/arm/mach-omap2/pm34xx.c
parent6bdc4b44b3acc95655b061a88c951c6d9742d8e3 (diff)
ARM: OMAP3: PRM: move PRM init code from PM core to the driver
Helps to isolate the PRM driver. Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r--arch/arm/mach-omap2/pm34xx.c71
1 files changed, 1 insertions, 70 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index acb895deb3cc..3ea04ac10d16 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -376,79 +376,10 @@ static void __init omap3_d2d_idle(void)
376 376
377static void __init prcm_setup_regs(void) 377static void __init prcm_setup_regs(void)
378{ 378{
379 u32 omap3630_en_uart4_mask = cpu_is_omap3630() ?
380 OMAP3630_EN_UART4_MASK : 0;
381 u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ?
382 OMAP3630_GRPSEL_UART4_MASK : 0;
383
384 /* XXX This should be handled by hwmod code or SCM init code */ 379 /* XXX This should be handled by hwmod code or SCM init code */
385 omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); 380 omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
386 381
387 /* 382 omap3_prm_init_pm(cpu_is_omap3630(), omap3_has_iva());
388 * Enable control of expternal oscillator through
389 * sys_clkreq. In the long run clock framework should
390 * take care of this.
391 */
392 omap2_prm_rmw_mod_reg_bits(OMAP_AUTOEXTCLKMODE_MASK,
393 1 << OMAP_AUTOEXTCLKMODE_SHIFT,
394 OMAP3430_GR_MOD,
395 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
396
397 /* setup wakup source */
398 omap2_prm_write_mod_reg(OMAP3430_EN_IO_MASK | OMAP3430_EN_GPIO1_MASK |
399 OMAP3430_EN_GPT1_MASK | OMAP3430_EN_GPT12_MASK,
400 WKUP_MOD, PM_WKEN);
401 /* No need to write EN_IO, that is always enabled */
402 omap2_prm_write_mod_reg(OMAP3430_GRPSEL_GPIO1_MASK |
403 OMAP3430_GRPSEL_GPT1_MASK |
404 OMAP3430_GRPSEL_GPT12_MASK,
405 WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
406
407 /* Enable PM_WKEN to support DSS LPR */
408 omap2_prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS_MASK,
409 OMAP3430_DSS_MOD, PM_WKEN);
410
411 /* Enable wakeups in PER */
412 omap2_prm_write_mod_reg(omap3630_en_uart4_mask |
413 OMAP3430_EN_GPIO2_MASK | OMAP3430_EN_GPIO3_MASK |
414 OMAP3430_EN_GPIO4_MASK | OMAP3430_EN_GPIO5_MASK |
415 OMAP3430_EN_GPIO6_MASK | OMAP3430_EN_UART3_MASK |
416 OMAP3430_EN_MCBSP2_MASK | OMAP3430_EN_MCBSP3_MASK |
417 OMAP3430_EN_MCBSP4_MASK,
418 OMAP3430_PER_MOD, PM_WKEN);
419 /* and allow them to wake up MPU */
420 omap2_prm_write_mod_reg(omap3630_grpsel_uart4_mask |
421 OMAP3430_GRPSEL_GPIO2_MASK |
422 OMAP3430_GRPSEL_GPIO3_MASK |
423 OMAP3430_GRPSEL_GPIO4_MASK |
424 OMAP3430_GRPSEL_GPIO5_MASK |
425 OMAP3430_GRPSEL_GPIO6_MASK |
426 OMAP3430_GRPSEL_UART3_MASK |
427 OMAP3430_GRPSEL_MCBSP2_MASK |
428 OMAP3430_GRPSEL_MCBSP3_MASK |
429 OMAP3430_GRPSEL_MCBSP4_MASK,
430 OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
431
432 /* Don't attach IVA interrupts */
433 if (omap3_has_iva()) {
434 omap2_prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
435 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
436 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
437 omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD,
438 OMAP3430_PM_IVAGRPSEL);
439 }
440
441 /* Clear any pending 'reset' flags */
442 omap2_prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST);
443 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST);
444 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST);
445 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST);
446 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST);
447 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST);
448 omap2_prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, OMAP2_RM_RSTST);
449
450 /* Clear any pending PRCM interrupts */
451 omap2_prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
452 383
453 /* 384 /*
454 * We need to idle iva2_pwrdm even on am3703 with no iva2. 385 * We need to idle iva2_pwrdm even on am3703 with no iva2.