diff options
author | Tony Lindgren <tony@atomide.com> | 2010-01-20 21:20:47 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-01-20 21:20:47 -0500 |
commit | ccaae273c3f92d7e7acb796d6747077a93dcca4b (patch) | |
tree | 3b3853db3d4b0db18c9cbc51469538aa767aeaee /arch/arm/mach-omap2 | |
parent | fa8d1d6c2a72659f773f919c4356b68884c875d0 (diff) | |
parent | 6b34f9d4e60a4fb9f847533a207e31316603e840 (diff) |
Merge branch 'pm-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-fixes-for-linus
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/irq.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm-debug.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 47 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sleep34xx.S | 13 |
7 files changed, 66 insertions, 45 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index a26d6a08ae3f..12f0cbfc2894 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -137,7 +137,7 @@ return_sleep_time: | |||
137 | local_irq_enable(); | 137 | local_irq_enable(); |
138 | local_fiq_enable(); | 138 | local_fiq_enable(); |
139 | 139 | ||
140 | return (u32)timespec_to_ns(&ts_idle)/1000; | 140 | return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC; |
141 | } | 141 | } |
142 | 142 | ||
143 | /** | 143 | /** |
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index e9bc782fa414..27054025da2b 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c | |||
@@ -274,4 +274,22 @@ void omap_intc_restore_context(void) | |||
274 | } | 274 | } |
275 | /* MIRs are saved and restore with other PRCM registers */ | 275 | /* MIRs are saved and restore with other PRCM registers */ |
276 | } | 276 | } |
277 | |||
278 | void omap3_intc_suspend(void) | ||
279 | { | ||
280 | /* A pending interrupt would prevent OMAP from entering suspend */ | ||
281 | omap_ack_irq(0); | ||
282 | } | ||
283 | |||
284 | void omap3_intc_prepare_idle(void) | ||
285 | { | ||
286 | /* Disable autoidle as it can stall interrupt controller */ | ||
287 | intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG); | ||
288 | } | ||
289 | |||
290 | void omap3_intc_resume_idle(void) | ||
291 | { | ||
292 | /* Re-enable autoidle */ | ||
293 | intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG); | ||
294 | } | ||
277 | #endif /* CONFIG_ARCH_OMAP3 */ | 295 | #endif /* CONFIG_ARCH_OMAP3 */ |
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 860b755d2220..a0866268aa41 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c | |||
@@ -54,8 +54,6 @@ int omap2_pm_debug; | |||
54 | regs[reg_count++].val = \ | 54 | regs[reg_count++].val = \ |
55 | __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off))) | 55 | __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off))) |
56 | 56 | ||
57 | static int __init pm_dbg_init(void); | ||
58 | |||
59 | void omap2_pm_dump(int mode, int resume, unsigned int us) | 57 | void omap2_pm_dump(int mode, int resume, unsigned int us) |
60 | { | 58 | { |
61 | struct reg { | 59 | struct reg { |
@@ -167,6 +165,8 @@ struct dentry *pm_dbg_dir; | |||
167 | 165 | ||
168 | static int pm_dbg_init_done; | 166 | static int pm_dbg_init_done; |
169 | 167 | ||
168 | static int __init pm_dbg_init(void); | ||
169 | |||
170 | enum { | 170 | enum { |
171 | DEBUG_FILE_COUNTERS = 0, | 171 | DEBUG_FILE_COUNTERS = 0, |
172 | DEBUG_FILE_TIMERS, | 172 | DEBUG_FILE_TIMERS, |
@@ -488,9 +488,11 @@ int pm_dbg_regset_init(int reg_set) | |||
488 | 488 | ||
489 | static int pwrdm_suspend_get(void *data, u64 *val) | 489 | static int pwrdm_suspend_get(void *data, u64 *val) |
490 | { | 490 | { |
491 | *val = omap3_pm_get_suspend_state((struct powerdomain *)data); | 491 | int ret; |
492 | ret = omap3_pm_get_suspend_state((struct powerdomain *)data); | ||
493 | *val = ret; | ||
492 | 494 | ||
493 | if (*val >= 0) | 495 | if (ret >= 0) |
494 | return 0; | 496 | return 0; |
495 | return *val; | 497 | return *val; |
496 | } | 498 | } |
@@ -604,6 +606,4 @@ static int __init pm_dbg_init(void) | |||
604 | } | 606 | } |
605 | arch_initcall(pm_dbg_init); | 607 | arch_initcall(pm_dbg_init); |
606 | 608 | ||
607 | #else | ||
608 | void pm_dbg_update_time(struct powerdomain *pwrdm, int prev) {} | ||
609 | #endif | 609 | #endif |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 0bf345db7147..7a9c2d004511 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -32,12 +32,16 @@ extern struct omap_dm_timer *gptimer_wakeup; | |||
32 | #ifdef CONFIG_PM_DEBUG | 32 | #ifdef CONFIG_PM_DEBUG |
33 | extern void omap2_pm_dump(int mode, int resume, unsigned int us); | 33 | extern void omap2_pm_dump(int mode, int resume, unsigned int us); |
34 | extern int omap2_pm_debug; | 34 | extern int omap2_pm_debug; |
35 | #else | ||
36 | #define omap2_pm_dump(mode, resume, us) do {} while (0); | ||
37 | #define omap2_pm_debug 0 | ||
38 | #endif | ||
39 | |||
40 | #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) | ||
35 | extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev); | 41 | extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev); |
36 | extern int pm_dbg_regset_save(int reg_set); | 42 | extern int pm_dbg_regset_save(int reg_set); |
37 | extern int pm_dbg_regset_init(int reg_set); | 43 | extern int pm_dbg_regset_init(int reg_set); |
38 | #else | 44 | #else |
39 | #define omap2_pm_dump(mode, resume, us) do {} while (0); | ||
40 | #define omap2_pm_debug 0 | ||
41 | #define pm_dbg_update_time(pwrdm, prev) do {} while (0); | 45 | #define pm_dbg_update_time(pwrdm, prev) do {} while (0); |
42 | #define pm_dbg_regset_save(reg_set) do {} while (0); | 46 | #define pm_dbg_regset_save(reg_set) do {} while (0); |
43 | #define pm_dbg_regset_init(reg_set) do {} while (0); | 47 | #define pm_dbg_regset_init(reg_set) do {} while (0); |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index c6cc809afb79..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> |
@@ -126,7 +127,15 @@ static void omap3_core_save_context(void) | |||
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 | } |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 3ea8177ffb25..cf466ea1dffc 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -44,7 +44,6 @@ struct omap3_prcm_regs { | |||
44 | u32 iva2_cm_clksel2; | 44 | u32 iva2_cm_clksel2; |
45 | u32 cm_sysconfig; | 45 | u32 cm_sysconfig; |
46 | u32 sgx_cm_clksel; | 46 | u32 sgx_cm_clksel; |
47 | u32 wkup_cm_clksel; | ||
48 | u32 dss_cm_clksel; | 47 | u32 dss_cm_clksel; |
49 | u32 cam_cm_clksel; | 48 | u32 cam_cm_clksel; |
50 | u32 per_cm_clksel; | 49 | u32 per_cm_clksel; |
@@ -53,7 +52,6 @@ struct omap3_prcm_regs { | |||
53 | u32 pll_cm_autoidle2; | 52 | u32 pll_cm_autoidle2; |
54 | u32 pll_cm_clksel4; | 53 | u32 pll_cm_clksel4; |
55 | u32 pll_cm_clksel5; | 54 | u32 pll_cm_clksel5; |
56 | u32 pll_cm_clken; | ||
57 | u32 pll_cm_clken2; | 55 | u32 pll_cm_clken2; |
58 | u32 cm_polctrl; | 56 | u32 cm_polctrl; |
59 | u32 iva2_cm_fclken; | 57 | u32 iva2_cm_fclken; |
@@ -77,7 +75,6 @@ struct omap3_prcm_regs { | |||
77 | u32 usbhost_cm_iclken; | 75 | u32 usbhost_cm_iclken; |
78 | u32 iva2_cm_autiidle2; | 76 | u32 iva2_cm_autiidle2; |
79 | u32 mpu_cm_autoidle2; | 77 | u32 mpu_cm_autoidle2; |
80 | u32 pll_cm_autoidle; | ||
81 | u32 iva2_cm_clkstctrl; | 78 | u32 iva2_cm_clkstctrl; |
82 | u32 mpu_cm_clkstctrl; | 79 | u32 mpu_cm_clkstctrl; |
83 | u32 core_cm_clkstctrl; | 80 | u32 core_cm_clkstctrl; |
@@ -274,7 +271,6 @@ void omap3_prcm_save_context(void) | |||
274 | prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG); | 271 | prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG); |
275 | prcm_context.sgx_cm_clksel = | 272 | prcm_context.sgx_cm_clksel = |
276 | cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL); | 273 | cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL); |
277 | prcm_context.wkup_cm_clksel = cm_read_mod_reg(WKUP_MOD, CM_CLKSEL); | ||
278 | prcm_context.dss_cm_clksel = | 274 | prcm_context.dss_cm_clksel = |
279 | cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL); | 275 | cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL); |
280 | prcm_context.cam_cm_clksel = | 276 | prcm_context.cam_cm_clksel = |
@@ -291,8 +287,6 @@ void omap3_prcm_save_context(void) | |||
291 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4); | 287 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4); |
292 | prcm_context.pll_cm_clksel5 = | 288 | prcm_context.pll_cm_clksel5 = |
293 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5); | 289 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5); |
294 | prcm_context.pll_cm_clken = | ||
295 | cm_read_mod_reg(PLL_MOD, CM_CLKEN); | ||
296 | prcm_context.pll_cm_clken2 = | 290 | prcm_context.pll_cm_clken2 = |
297 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2); | 291 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2); |
298 | prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL); | 292 | prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL); |
@@ -338,8 +332,6 @@ void omap3_prcm_save_context(void) | |||
338 | cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2); | 332 | cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2); |
339 | prcm_context.mpu_cm_autoidle2 = | 333 | prcm_context.mpu_cm_autoidle2 = |
340 | cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2); | 334 | cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2); |
341 | prcm_context.pll_cm_autoidle = | ||
342 | cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); | ||
343 | prcm_context.iva2_cm_clkstctrl = | 335 | prcm_context.iva2_cm_clkstctrl = |
344 | cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSTCTRL); | 336 | cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSTCTRL); |
345 | prcm_context.mpu_cm_clkstctrl = | 337 | prcm_context.mpu_cm_clkstctrl = |
@@ -431,7 +423,6 @@ void omap3_prcm_restore_context(void) | |||
431 | __raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG); | 423 | __raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG); |
432 | cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD, | 424 | cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD, |
433 | CM_CLKSEL); | 425 | CM_CLKSEL); |
434 | cm_write_mod_reg(prcm_context.wkup_cm_clksel, WKUP_MOD, CM_CLKSEL); | ||
435 | cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD, | 426 | cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD, |
436 | CM_CLKSEL); | 427 | CM_CLKSEL); |
437 | cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD, | 428 | cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD, |
@@ -448,7 +439,6 @@ void omap3_prcm_restore_context(void) | |||
448 | OMAP3430ES2_CM_CLKSEL4); | 439 | OMAP3430ES2_CM_CLKSEL4); |
449 | cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD, | 440 | cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD, |
450 | OMAP3430ES2_CM_CLKSEL5); | 441 | OMAP3430ES2_CM_CLKSEL5); |
451 | cm_write_mod_reg(prcm_context.pll_cm_clken, PLL_MOD, CM_CLKEN); | ||
452 | cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD, | 442 | cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD, |
453 | OMAP3430ES2_CM_CLKEN2); | 443 | OMAP3430ES2_CM_CLKEN2); |
454 | __raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL); | 444 | __raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL); |
@@ -487,7 +477,6 @@ void omap3_prcm_restore_context(void) | |||
487 | cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD, | 477 | cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD, |
488 | CM_AUTOIDLE2); | 478 | CM_AUTOIDLE2); |
489 | cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2); | 479 | cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2); |
490 | cm_write_mod_reg(prcm_context.pll_cm_autoidle, PLL_MOD, CM_AUTOIDLE); | ||
491 | cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD, | 480 | cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD, |
492 | CM_CLKSTCTRL); | 481 | CM_CLKSTCTRL); |
493 | cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD, CM_CLKSTCTRL); | 482 | cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD, CM_CLKSTCTRL); |
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 15268f8b61de..c3626ea48143 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -245,7 +245,8 @@ restore: | |||
245 | mov r1, #0 @ set task id for ROM code in r1 | 245 | mov r1, #0 @ set task id for ROM code in r1 |
246 | mov r2, #4 @ set some flags in r2, r6 | 246 | mov r2, #4 @ set some flags in r2, r6 |
247 | mov r6, #0xff | 247 | mov r6, #0xff |
248 | adr r3, write_aux_control_params @ r3 points to parameters | 248 | ldr r4, scratchpad_base |
249 | ldr r3, [r4, #0xBC] @ r3 points to parameters | ||
249 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | 250 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier |
250 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier | 251 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier |
251 | .word 0xE1600071 @ call SMI monitor (smi #1) | 252 | .word 0xE1600071 @ call SMI monitor (smi #1) |
@@ -253,14 +254,14 @@ restore: | |||
253 | b logic_l1_restore | 254 | b logic_l1_restore |
254 | l2_inv_api_params: | 255 | l2_inv_api_params: |
255 | .word 0x1, 0x00 | 256 | .word 0x1, 0x00 |
256 | write_aux_control_params: | ||
257 | .word 0x1, 0x72 | ||
258 | l2_inv_gp: | 257 | l2_inv_gp: |
259 | /* Execute smi to invalidate L2 cache */ | 258 | /* Execute smi to invalidate L2 cache */ |
260 | mov r12, #0x1 @ set up to invalide L2 | 259 | mov r12, #0x1 @ set up to invalide L2 |
261 | smi: .word 0xE1600070 @ Call SMI monitor (smieq) | 260 | smi: .word 0xE1600070 @ Call SMI monitor (smieq) |
262 | /* Write to Aux control register to set some bits */ | 261 | /* Write to Aux control register to set some bits */ |
263 | mov r0, #0x72 | 262 | ldr r4, scratchpad_base |
263 | ldr r3, [r4,#0xBC] | ||
264 | ldr r0, [r3,#4] | ||
264 | mov r12, #0x3 | 265 | mov r12, #0x3 |
265 | .word 0xE1600070 @ Call SMI monitor (smieq) | 266 | .word 0xE1600070 @ Call SMI monitor (smieq) |
266 | logic_l1_restore: | 267 | logic_l1_restore: |
@@ -271,6 +272,7 @@ logic_l1_restore: | |||
271 | 272 | ||
272 | ldr r4, scratchpad_base | 273 | ldr r4, scratchpad_base |
273 | ldr r3, [r4,#0xBC] | 274 | ldr r3, [r4,#0xBC] |
275 | adds r3, r3, #8 | ||
274 | ldmia r3!, {r4-r6} | 276 | ldmia r3!, {r4-r6} |
275 | mov sp, r4 | 277 | mov sp, r4 |
276 | msr spsr_cxsf, r5 | 278 | msr spsr_cxsf, r5 |
@@ -387,6 +389,9 @@ usettbr0: | |||
387 | save_context_wfi: | 389 | save_context_wfi: |
388 | /*b save_context_wfi*/ @ enable to debug save code | 390 | /*b save_context_wfi*/ @ enable to debug save code |
389 | mov r8, r0 /* Store SDRAM address in r8 */ | 391 | mov r8, r0 /* Store SDRAM address in r8 */ |
392 | mrc p15, 0, r5, c1, c0, 1 @ Read Auxiliary Control Register | ||
393 | mov r4, #0x1 @ Number of parameters for restore call | ||
394 | stmia r8!, {r4-r5} | ||
390 | /* Check what that target sleep state is:stored in r1*/ | 395 | /* Check what that target sleep state is:stored in r1*/ |
391 | /* 1 - Only L1 and logic lost */ | 396 | /* 1 - Only L1 and logic lost */ |
392 | /* 2 - Only L2 lost */ | 397 | /* 2 - Only L2 lost */ |