diff options
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 81ed252a0f8a..910a7acf542d 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
27 | #include <linux/gpio.h> | 27 | #include <linux/gpio.h> |
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/delay.h> | ||
29 | 30 | ||
30 | #include <plat/sram.h> | 31 | #include <plat/sram.h> |
31 | #include <plat/clockdomain.h> | 32 | #include <plat/clockdomain.h> |
@@ -124,9 +125,17 @@ static void omap3_core_save_context(void) | |||
124 | control_padconf_off |= START_PADCONF_SAVE; | 125 | control_padconf_off |= START_PADCONF_SAVE; |
125 | omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); | 126 | omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); |
126 | /* wait for the save to complete */ | 127 | /* wait for the save to complete */ |
127 | while (!omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) | 128 | while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) |
128 | & PADCONF_SAVE_DONE) | 129 | & PADCONF_SAVE_DONE)) |
129 | ; | 130 | udelay(1); |
131 | |||
132 | /* | ||
133 | * Force write last pad into memory, as this can fail in some | ||
134 | * cases according to erratas 1.157, 1.185 | ||
135 | */ | ||
136 | omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14), | ||
137 | OMAP343X_CONTROL_MEM_WKUP + 0x2a0); | ||
138 | |||
130 | /* Save the Interrupt controller context */ | 139 | /* Save the Interrupt controller context */ |
131 | omap_intc_save_context(); | 140 | omap_intc_save_context(); |
132 | /* Save the GPMC context */ | 141 | /* Save the GPMC context */ |
@@ -392,6 +401,7 @@ void omap_sram_idle(void) | |||
392 | prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); | 401 | prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); |
393 | omap3_enable_io_chain(); | 402 | omap3_enable_io_chain(); |
394 | } | 403 | } |
404 | omap3_intc_prepare_idle(); | ||
395 | 405 | ||
396 | /* | 406 | /* |
397 | * On EMU/HS devices ROM code restores a SRDC value | 407 | * On EMU/HS devices ROM code restores a SRDC value |
@@ -438,6 +448,7 @@ void omap_sram_idle(void) | |||
438 | OMAP3430_GR_MOD, | 448 | OMAP3430_GR_MOD, |
439 | OMAP3_PRM_VOLTCTRL_OFFSET); | 449 | OMAP3_PRM_VOLTCTRL_OFFSET); |
440 | } | 450 | } |
451 | omap3_intc_resume_idle(); | ||
441 | 452 | ||
442 | /* PER */ | 453 | /* PER */ |
443 | if (per_next_state < PWRDM_POWER_ON) { | 454 | if (per_next_state < PWRDM_POWER_ON) { |
@@ -578,6 +589,8 @@ static int omap3_pm_suspend(void) | |||
578 | } | 589 | } |
579 | 590 | ||
580 | omap_uart_prepare_suspend(); | 591 | omap_uart_prepare_suspend(); |
592 | omap3_intc_suspend(); | ||
593 | |||
581 | omap_sram_idle(); | 594 | omap_sram_idle(); |
582 | 595 | ||
583 | restore: | 596 | restore: |
@@ -835,6 +848,8 @@ static void __init prcm_setup_regs(void) | |||
835 | CM_AUTOIDLE); | 848 | CM_AUTOIDLE); |
836 | } | 849 | } |
837 | 850 | ||
851 | omap_ctrl_writel(OMAP3430_AUTOIDLE, OMAP2_CONTROL_SYSCONFIG); | ||
852 | |||
838 | /* | 853 | /* |
839 | * Set all plls to autoidle. This is needed until autoidle is | 854 | * Set all plls to autoidle. This is needed until autoidle is |
840 | * enabled by clockfw | 855 | * enabled by clockfw |
@@ -875,15 +890,23 @@ static void __init prcm_setup_regs(void) | |||
875 | prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN, | 890 | prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN, |
876 | OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); | 891 | OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); |
877 | 892 | ||
893 | /* Enable PM_WKEN to support DSS LPR */ | ||
894 | prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS, | ||
895 | OMAP3430_DSS_MOD, PM_WKEN); | ||
896 | |||
878 | /* Enable wakeups in PER */ | 897 | /* Enable wakeups in PER */ |
879 | prm_write_mod_reg(OMAP3430_EN_GPIO2 | OMAP3430_EN_GPIO3 | | 898 | prm_write_mod_reg(OMAP3430_EN_GPIO2 | OMAP3430_EN_GPIO3 | |
880 | OMAP3430_EN_GPIO4 | OMAP3430_EN_GPIO5 | | 899 | OMAP3430_EN_GPIO4 | OMAP3430_EN_GPIO5 | |
881 | OMAP3430_EN_GPIO6 | OMAP3430_EN_UART3, | 900 | OMAP3430_EN_GPIO6 | OMAP3430_EN_UART3 | |
901 | OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 | | ||
902 | OMAP3430_EN_MCBSP4, | ||
882 | OMAP3430_PER_MOD, PM_WKEN); | 903 | OMAP3430_PER_MOD, PM_WKEN); |
883 | /* and allow them to wake up MPU */ | 904 | /* and allow them to wake up MPU */ |
884 | prm_write_mod_reg(OMAP3430_GRPSEL_GPIO2 | OMAP3430_EN_GPIO3 | | 905 | prm_write_mod_reg(OMAP3430_GRPSEL_GPIO2 | OMAP3430_EN_GPIO3 | |
885 | OMAP3430_GRPSEL_GPIO4 | OMAP3430_EN_GPIO5 | | 906 | OMAP3430_GRPSEL_GPIO4 | OMAP3430_EN_GPIO5 | |
886 | OMAP3430_GRPSEL_GPIO6 | OMAP3430_EN_UART3, | 907 | OMAP3430_GRPSEL_GPIO6 | OMAP3430_EN_UART3 | |
908 | OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 | | ||
909 | OMAP3430_EN_MCBSP4, | ||
887 | OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL); | 910 | OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL); |
888 | 911 | ||
889 | /* Don't attach IVA interrupts */ | 912 | /* Don't attach IVA interrupts */ |
@@ -904,24 +927,6 @@ static void __init prcm_setup_regs(void) | |||
904 | /* Clear any pending PRCM interrupts */ | 927 | /* Clear any pending PRCM interrupts */ |
905 | prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); | 928 | prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); |
906 | 929 | ||
907 | /* Don't attach IVA interrupts */ | ||
908 | prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL); | ||
909 | prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1); | ||
910 | prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3); | ||
911 | prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL); | ||
912 | |||
913 | /* Clear any pending 'reset' flags */ | ||
914 | prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST); | ||
915 | prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST); | ||
916 | prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST); | ||
917 | prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST); | ||
918 | prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST); | ||
919 | prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST); | ||
920 | prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST); | ||
921 | |||
922 | /* Clear any pending PRCM interrupts */ | ||
923 | prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); | ||
924 | |||
925 | omap3_iva_idle(); | 930 | omap3_iva_idle(); |
926 | omap3_d2d_idle(); | 931 | omap3_d2d_idle(); |
927 | } | 932 | } |