aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm34xx.c
diff options
context:
space:
mode:
authorJean Pihet <j-pihet@ti.com>2011-06-29 12:40:23 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-06-29 14:07:47 -0400
commit46e130d298a384b677426e19faec311749ff2677 (patch)
tree5996accec8e0b1be693636085229afc95e372ded /arch/arm/mach-omap2/pm34xx.c
parent0853f96f13e0b60f1c319bcd7f6a3a84d0d1e706 (diff)
ARM: pm: omap3: run the ASM sleep code from DDR
Most of the ASM sleep code (in arch/arm/mach-omap2/sleep34xx.S) is copied to internal SRAM at boot and after wake-up from CORE OFF mode. However only a small part of the code really needs to run from internal SRAM. This fix lets most of the ASM idle code run from the DDR in order to minimize the SRAM usage and the overhead in the code copy. The only pieces of code that are mandatory in SRAM are: - the i443 erratum WA, - the i581 erratum WA, - the security extension code. SRAM usage: - original code: . 560 bytes for omap3_sram_configure_core_dpll (used by DVFS), . 852 bytes for omap_sram_idle (used by suspend/resume in RETention), . 124 bytes for es3_sdrc_fix (used by suspend/resume in OFF mode on ES3.x), . 108 bytes for save_secure_ram_context (used on HS parts only). With this fix the usage for suspend/resume in RETention goes down 288 bytes, so the gain in SRAM usage for suspend/resume is 564 bytes. Also fixed the SRAM initialization sequence to avoid an unnecessary copy to SRAM at boot time and for readability. Tested on Beagleboard (ES2.x) in idle with full RET and OFF modes. Kevin Hilman tested retention and off on 3430/n900, 3530/Overo and 3630/Zoom3 Signed-off-by: Jean Pihet <j-pihet@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Tested-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r--arch/arm/mach-omap2/pm34xx.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 3e9a13e1ac57..e1c79bae7670 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -78,9 +78,8 @@ struct power_state {
78 78
79static LIST_HEAD(pwrst_list); 79static LIST_HEAD(pwrst_list);
80 80
81static void (*_omap_sram_idle)(u32 *addr, int save_state);
82
83static int (*_omap_save_secure_sram)(u32 *addr); 81static int (*_omap_save_secure_sram)(u32 *addr);
82void (*omap3_do_wfi_sram)(void);
84 83
85static struct powerdomain *mpu_pwrdm, *neon_pwrdm; 84static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
86static struct powerdomain *core_pwrdm, *per_pwrdm; 85static struct powerdomain *core_pwrdm, *per_pwrdm;
@@ -309,7 +308,7 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
309 308
310static void omap34xx_do_sram_idle(unsigned long save_state) 309static void omap34xx_do_sram_idle(unsigned long save_state)
311{ 310{
312 _omap_sram_idle(omap3_arm_context, save_state); 311 omap34xx_cpu_suspend(omap3_arm_context, save_state);
313} 312}
314 313
315void omap_sram_idle(void) 314void omap_sram_idle(void)
@@ -328,9 +327,6 @@ void omap_sram_idle(void)
328 int core_prev_state, per_prev_state; 327 int core_prev_state, per_prev_state;
329 u32 sdrc_pwr = 0; 328 u32 sdrc_pwr = 0;
330 329
331 if (!_omap_sram_idle)
332 return;
333
334 pwrdm_clear_all_prev_pwrst(mpu_pwrdm); 330 pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
335 pwrdm_clear_all_prev_pwrst(neon_pwrdm); 331 pwrdm_clear_all_prev_pwrst(neon_pwrdm);
336 pwrdm_clear_all_prev_pwrst(core_pwrdm); 332 pwrdm_clear_all_prev_pwrst(core_pwrdm);
@@ -826,10 +822,17 @@ static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
826 return 0; 822 return 0;
827} 823}
828 824
825/*
826 * Push functions to SRAM
827 *
828 * The minimum set of functions is pushed to SRAM for execution:
829 * - omap3_do_wfi for erratum i581 WA,
830 * - save_secure_ram_context for security extensions.
831 */
829void omap_push_sram_idle(void) 832void omap_push_sram_idle(void)
830{ 833{
831 _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend, 834 omap3_do_wfi_sram = omap_sram_push(omap3_do_wfi, omap3_do_wfi_sz);
832 omap34xx_cpu_suspend_sz); 835
833 if (omap_type() != OMAP2_DEVICE_TYPE_GP) 836 if (omap_type() != OMAP2_DEVICE_TYPE_GP)
834 _omap_save_secure_sram = omap_sram_push(save_secure_ram_context, 837 _omap_save_secure_sram = omap_sram_push(save_secure_ram_context,
835 save_secure_ram_context_sz); 838 save_secure_ram_context_sz);
@@ -894,7 +897,6 @@ static int __init omap3_pm_init(void)
894 per_clkdm = clkdm_lookup("per_clkdm"); 897 per_clkdm = clkdm_lookup("per_clkdm");
895 core_clkdm = clkdm_lookup("core_clkdm"); 898 core_clkdm = clkdm_lookup("core_clkdm");
896 899
897 omap_push_sram_idle();
898#ifdef CONFIG_SUSPEND 900#ifdef CONFIG_SUSPEND
899 suspend_set_ops(&omap_pm_ops); 901 suspend_set_ops(&omap_pm_ops);
900#endif /* CONFIG_SUSPEND */ 902#endif /* CONFIG_SUSPEND */