aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2010-12-20 15:05:06 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2010-12-21 17:45:50 -0500
commit458e999eb14a301d4176783c8fcb277f5d009b4e (patch)
tree7300efdef971f91e4d7601f9bc1174fe9716f313 /arch
parent8cdfd83473d9b408b924b5d32777ac3fddd251ff (diff)
OMAP3630: PM: Erratum i608: disable RTA
Erratum id: i608 RTA (Retention Till Access) feature is not supported and leads to device stability issues when enabled. This impacts modules with embedded memories on OMAP3630 Workaround is to disable RTA on boot and coming out of core off. For disabling RTA coming out of off mode, we do this by overriding the restore pointer for 3630 as the first point of entry before caches are touched and is common for GP and HS devices. To disable earlier than this could be possible by modifying the PPA for HS devices, but not for GP devices. Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Tony Lindgren <tony@atomide.com> Acked-by: Jean Pihet <j-pihet@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> [ambresh@ti.com: co-developer] Signed-off-by: Ambresh K <ambresh@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/control.c13
-rw-r--r--arch/arm/mach-omap2/control.h7
-rw-r--r--arch/arm/mach-omap2/pm.h2
-rw-r--r--arch/arm/mach-omap2/pm34xx.c10
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S26
5 files changed, 56 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 1fa3294b6048..27ed558fdf54 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -241,7 +241,10 @@ void omap3_save_scratchpad_contents(void)
241 241
242 /* Populate the Scratchpad contents */ 242 /* Populate the Scratchpad contents */
243 scratchpad_contents.boot_config_ptr = 0x0; 243 scratchpad_contents.boot_config_ptr = 0x0;
244 if (omap_rev() != OMAP3430_REV_ES3_0 && 244 if (cpu_is_omap3630())
245 scratchpad_contents.public_restore_ptr =
246 virt_to_phys(get_omap3630_restore_pointer());
247 else if (omap_rev() != OMAP3430_REV_ES3_0 &&
245 omap_rev() != OMAP3430_REV_ES3_1) 248 omap_rev() != OMAP3430_REV_ES3_1)
246 scratchpad_contents.public_restore_ptr = 249 scratchpad_contents.public_restore_ptr =
247 virt_to_phys(get_restore_pointer()); 250 virt_to_phys(get_restore_pointer());
@@ -474,4 +477,12 @@ void omap3_control_restore_context(void)
474 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI); 477 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI);
475 return; 478 return;
476} 479}
480
481void omap3630_ctrl_disable_rta(void)
482{
483 if (!cpu_is_omap3630())
484 return;
485 omap_ctrl_writel(OMAP36XX_RTA_DISABLE, OMAP36XX_CONTROL_MEM_RTA_CTRL);
486}
487
477#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ 488#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index b6c6b7c450b3..ec98dd716217 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -204,6 +204,10 @@
204#define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014) 204#define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014)
205#define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018) 205#define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018)
206 206
207/* 36xx-only RTA - Retention till Accesss control registers and bits */
208#define OMAP36XX_CONTROL_MEM_RTA_CTRL 0x40C
209#define OMAP36XX_RTA_DISABLE 0x0
210
207/* 34xx D2D idle-related pins, handled by PM core */ 211/* 34xx D2D idle-related pins, handled by PM core */
208#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 212#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
209#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 213#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
@@ -347,10 +351,11 @@ extern void omap3_save_scratchpad_contents(void);
347extern void omap3_clear_scratchpad_contents(void); 351extern void omap3_clear_scratchpad_contents(void);
348extern u32 *get_restore_pointer(void); 352extern u32 *get_restore_pointer(void);
349extern u32 *get_es3_restore_pointer(void); 353extern u32 *get_es3_restore_pointer(void);
354extern u32 *get_omap3630_restore_pointer(void);
350extern u32 omap3_arm_context[128]; 355extern u32 omap3_arm_context[128];
351extern void omap3_control_save_context(void); 356extern void omap3_control_save_context(void);
352extern void omap3_control_restore_context(void); 357extern void omap3_control_restore_context(void);
353 358extern void omap3630_ctrl_disable_rta(void);
354#else 359#else
355#define omap_ctrl_base_get() 0 360#define omap_ctrl_base_get() 0
356#define omap_ctrl_readb(x) 0 361#define omap_ctrl_readb(x) 0
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 0348fd717f61..8d9aa3e0f635 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -85,6 +85,8 @@ extern unsigned int save_secure_ram_context_sz;
85extern unsigned int omap24xx_cpu_suspend_sz; 85extern unsigned int omap24xx_cpu_suspend_sz;
86extern unsigned int omap34xx_cpu_suspend_sz; 86extern unsigned int omap34xx_cpu_suspend_sz;
87 87
88#define PM_RTA_ERRATUM_i608 (1 << 0)
89
88#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) 90#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
89extern u16 pm34xx_errata; 91extern u16 pm34xx_errata;
90#define IS_PM34XX_ERRATUM(id) (pm34xx_errata & (id)) 92#define IS_PM34XX_ERRATUM(id) (pm34xx_errata & (id))
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 288bee32e2b2..7dbc00005464 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -996,6 +996,8 @@ void omap_push_sram_idle(void)
996 996
997static void __init pm_errata_configure(void) 997static void __init pm_errata_configure(void)
998{ 998{
999 if (cpu_is_omap3630())
1000 pm34xx_errata |= PM_RTA_ERRATUM_i608;
999} 1001}
1000 1002
1001static int __init omap3_pm_init(void) 1003static int __init omap3_pm_init(void)
@@ -1056,6 +1058,14 @@ static int __init omap3_pm_init(void)
1056 pm_idle = omap3_pm_idle; 1058 pm_idle = omap3_pm_idle;
1057 omap3_idle_init(); 1059 omap3_idle_init();
1058 1060
1061 /*
1062 * RTA is disabled during initialization as per erratum i608
1063 * it is safer to disable RTA by the bootloader, but we would like
1064 * to be doubly sure here and prevent any mishaps.
1065 */
1066 if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608))
1067 omap3630_ctrl_disable_rta();
1068
1059 clkdm_add_wkdep(neon_clkdm, mpu_clkdm); 1069 clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
1060 if (omap_type() != OMAP2_DEVICE_TYPE_GP) { 1070 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
1061 omap3_secure_ram_storage = 1071 omap3_secure_ram_storage =
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 24ecb0a5cce1..4abf447fddfc 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -45,6 +45,8 @@
45#define CM_IDLEST_CKGEN_V OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST) 45#define CM_IDLEST_CKGEN_V OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST)
46#define SRAM_BASE_P 0x40200000 46#define SRAM_BASE_P 0x40200000
47#define CONTROL_STAT 0x480022F0 47#define CONTROL_STAT 0x480022F0
48#define CONTROL_MEM_RTA_CTRL (OMAP343X_CTRL_BASE\
49 + OMAP36XX_CONTROL_MEM_RTA_CTRL)
48#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is 50#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is
49 * available */ 51 * available */
50#define SCRATCHPAD_BASE_P (OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\ 52#define SCRATCHPAD_BASE_P (OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\
@@ -99,6 +101,14 @@ ENTRY(get_restore_pointer)
99 ldmfd sp!, {pc} @ restore regs and return 101 ldmfd sp!, {pc} @ restore regs and return
100ENTRY(get_restore_pointer_sz) 102ENTRY(get_restore_pointer_sz)
101 .word . - get_restore_pointer 103 .word . - get_restore_pointer
104 .text
105/* Function call to get the restore pointer for 3630 resume from OFF */
106ENTRY(get_omap3630_restore_pointer)
107 stmfd sp!, {lr} @ save registers on stack
108 adr r0, restore_3630
109 ldmfd sp!, {pc} @ restore regs and return
110ENTRY(get_omap3630_restore_pointer_sz)
111 .word . - get_omap3630_restore_pointer
102 112
103 .text 113 .text
104/* Function call to get the restore pointer for for ES3 to resume from OFF */ 114/* Function call to get the restore pointer for for ES3 to resume from OFF */
@@ -246,6 +256,20 @@ copy_to_sram:
246 bne copy_to_sram 256 bne copy_to_sram
247 ldr r1, sram_base 257 ldr r1, sram_base
248 blx r1 258 blx r1
259 b restore
260
261restore_3630:
262 /*b restore_es3630*/ @ Enable to debug restore code
263 ldr r1, pm_prepwstst_core_p
264 ldr r2, [r1]
265 and r2, r2, #0x3
266 cmp r2, #0x0 @ Check if previous power state of CORE is OFF
267 bne restore
268 /* Disable RTA before giving control */
269 ldr r1, control_mem_rta
270 mov r2, #OMAP36XX_RTA_DISABLE
271 str r2, [r1]
272 /* Fall thru for the remaining logic */
249restore: 273restore:
250 /* b restore*/ @ Enable to debug restore code 274 /* b restore*/ @ Enable to debug restore code
251 /* Check what was the reason for mpu reset and store the reason in r9*/ 275 /* Check what was the reason for mpu reset and store the reason in r9*/
@@ -651,6 +675,8 @@ cache_pred_disable_mask:
651 .word 0xFFFFE7FB 675 .word 0xFFFFE7FB
652control_stat: 676control_stat:
653 .word CONTROL_STAT 677 .word CONTROL_STAT
678control_mem_rta:
679 .word CONTROL_MEM_RTA_CTRL
654kernel_flush: 680kernel_flush:
655 .word v7_flush_dcache_all 681 .word v7_flush_dcache_all
656 /* 682 /*