diff options
Diffstat (limited to 'arch/arm/mach-omap2/control.c')
-rw-r--r-- | arch/arm/mach-omap2/control.c | 60 |
1 files changed, 45 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index 751f3549bf6f..f4796c002070 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c | |||
@@ -44,8 +44,7 @@ struct omap3_scratchpad { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct omap3_scratchpad_prcm_block { | 46 | struct omap3_scratchpad_prcm_block { |
47 | u32 prm_clksrc_ctrl; | 47 | u32 prm_contents[2]; |
48 | u32 prm_clksel; | ||
49 | u32 cm_contents[11]; | 48 | u32 cm_contents[11]; |
50 | u32 prcm_block_size; | 49 | u32 prcm_block_size; |
51 | }; | 50 | }; |
@@ -282,13 +281,9 @@ void omap3_clear_scratchpad_contents(void) | |||
282 | void __iomem *v_addr; | 281 | void __iomem *v_addr; |
283 | u32 offset = 0; | 282 | u32 offset = 0; |
284 | v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM); | 283 | v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM); |
285 | if (omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) & | 284 | if (omap3xxx_prm_clear_global_cold_reset()) { |
286 | OMAP3430_GLOBAL_COLD_RST_MASK) { | ||
287 | for ( ; offset <= max_offset; offset += 0x4) | 285 | for ( ; offset <= max_offset; offset += 0x4) |
288 | writel_relaxed(0x0, (v_addr + offset)); | 286 | writel_relaxed(0x0, (v_addr + offset)); |
289 | omap2_prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK, | ||
290 | OMAP3430_GR_MOD, | ||
291 | OMAP3_PRM_RSTST_OFFSET); | ||
292 | } | 287 | } |
293 | } | 288 | } |
294 | 289 | ||
@@ -331,13 +326,7 @@ void omap3_save_scratchpad_contents(void) | |||
331 | scratchpad_contents.sdrc_block_offset = 0x64; | 326 | scratchpad_contents.sdrc_block_offset = 0x64; |
332 | 327 | ||
333 | /* Populate the PRCM block contents */ | 328 | /* Populate the PRCM block contents */ |
334 | prcm_block_contents.prm_clksrc_ctrl = | 329 | omap3_prm_save_scratchpad_contents(prcm_block_contents.prm_contents); |
335 | omap2_prm_read_mod_reg(OMAP3430_GR_MOD, | ||
336 | OMAP3_PRM_CLKSRC_CTRL_OFFSET); | ||
337 | prcm_block_contents.prm_clksel = | ||
338 | omap2_prm_read_mod_reg(OMAP3430_CCR_MOD, | ||
339 | OMAP3_PRM_CLKSEL_OFFSET); | ||
340 | |||
341 | omap3_cm_save_scratchpad_contents(prcm_block_contents.cm_contents); | 330 | omap3_cm_save_scratchpad_contents(prcm_block_contents.cm_contents); |
342 | 331 | ||
343 | prcm_block_contents.prcm_block_size = 0x0; | 332 | prcm_block_contents.prcm_block_size = 0x0; |
@@ -575,9 +564,50 @@ int omap3_ctrl_save_padconf(void) | |||
575 | * Sets the bootmode for IVA2 to idle. This is needed by the PM code to | 564 | * Sets the bootmode for IVA2 to idle. This is needed by the PM code to |
576 | * force disable IVA2 so that it does not prevent any low-power states. | 565 | * force disable IVA2 so that it does not prevent any low-power states. |
577 | */ | 566 | */ |
578 | void omap3_ctrl_set_iva_bootmode_idle(void) | 567 | static void __init omap3_ctrl_set_iva_bootmode_idle(void) |
579 | { | 568 | { |
580 | omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE, | 569 | omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE, |
581 | OMAP343X_CONTROL_IVA2_BOOTMOD); | 570 | OMAP343X_CONTROL_IVA2_BOOTMOD); |
582 | } | 571 | } |
572 | |||
573 | /** | ||
574 | * omap3_ctrl_setup_d2d_padconf - setup stacked modem pads for idle | ||
575 | * | ||
576 | * Sets up the pads controlling the stacked modem in such way that the | ||
577 | * device can enter idle. | ||
578 | */ | ||
579 | static void __init omap3_ctrl_setup_d2d_padconf(void) | ||
580 | { | ||
581 | u16 mask, padconf; | ||
582 | |||
583 | /* | ||
584 | * In a stand alone OMAP3430 where there is not a stacked | ||
585 | * modem for the D2D Idle Ack and D2D MStandby must be pulled | ||
586 | * high. S CONTROL_PADCONF_SAD2D_IDLEACK and | ||
587 | * CONTROL_PADCONF_SAD2D_MSTDBY to have a pull up. | ||
588 | */ | ||
589 | mask = (1 << 4) | (1 << 3); /* pull-up, enabled */ | ||
590 | padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_MSTANDBY); | ||
591 | padconf |= mask; | ||
592 | omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_MSTANDBY); | ||
593 | |||
594 | padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_IDLEACK); | ||
595 | padconf |= mask; | ||
596 | omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK); | ||
597 | } | ||
598 | |||
599 | /** | ||
600 | * omap3_ctrl_init - does static initializations for control module | ||
601 | * | ||
602 | * Initializes system control module. This sets up the sysconfig autoidle, | ||
603 | * and sets up modem and iva2 so that they can be idled properly. | ||
604 | */ | ||
605 | void __init omap3_ctrl_init(void) | ||
606 | { | ||
607 | omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); | ||
608 | |||
609 | omap3_ctrl_set_iva_bootmode_idle(); | ||
610 | |||
611 | omap3_ctrl_setup_d2d_padconf(); | ||
612 | } | ||
583 | #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ | 613 | #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ |