diff options
author | Jean Pihet <j-pihet@ti.com> | 2010-12-18 10:44:41 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-12-21 17:45:54 -0500 |
commit | d3cdfd2a15d87d040a5f553231b979fbc28b98e7 (patch) | |
tree | 1c1208e8e15a782768170766b23d9276c6141699 /arch/arm | |
parent | cc1b6028878646a2419b27e5f590b5e9fe01dc3d (diff) |
OMAP3: remove unused code from the ASM sleep code
Remove unused code:
- macros,
- variables,
- unused semaphore locking API. This API shall be added back
when needed,
- infinite loops for debug.
Tested on N900 and Beagleboard with full RET and OFF modes,
using cpuidle and suspend.
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon<nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/pm.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sleep34xx.S | 58 |
2 files changed, 6 insertions, 53 deletions
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index b4e66f9e1945..c04f7b50e26f 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -80,7 +80,6 @@ extern void save_secure_ram_context(u32 *addr); | |||
80 | extern void omap3_save_scratchpad_contents(void); | 80 | extern void omap3_save_scratchpad_contents(void); |
81 | 81 | ||
82 | extern unsigned int omap24xx_idle_loop_suspend_sz; | 82 | extern unsigned int omap24xx_idle_loop_suspend_sz; |
83 | extern unsigned int omap34xx_suspend_sz; | ||
84 | extern unsigned int save_secure_ram_context_sz; | 83 | extern unsigned int save_secure_ram_context_sz; |
85 | extern unsigned int omap24xx_cpu_suspend_sz; | 84 | extern unsigned int omap24xx_cpu_suspend_sz; |
86 | extern unsigned int omap34xx_cpu_suspend_sz; | 85 | extern unsigned int omap34xx_cpu_suspend_sz; |
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 50887c75a3b8..8fa9dfe813ed 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -35,11 +35,7 @@ | |||
35 | 35 | ||
36 | #define SDRC_SCRATCHPAD_SEM_V 0xfa00291c | 36 | #define SDRC_SCRATCHPAD_SEM_V 0xfa00291c |
37 | 37 | ||
38 | #define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \ | ||
39 | OMAP3430_PM_PREPWSTST) | ||
40 | #define PM_PREPWSTST_CORE_P 0x48306AE8 | 38 | #define PM_PREPWSTST_CORE_P 0x48306AE8 |
41 | #define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ | ||
42 | OMAP3430_PM_PREPWSTST) | ||
43 | #define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL | 39 | #define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL |
44 | #define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1) | 40 | #define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1) |
45 | #define CM_IDLEST_CKGEN_V OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST) | 41 | #define CM_IDLEST_CKGEN_V OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST) |
@@ -62,36 +58,10 @@ | |||
62 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) | 58 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) |
63 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) | 59 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) |
64 | 60 | ||
65 | .text | 61 | |
66 | /* Function to acquire the semaphore in scratchpad */ | 62 | /* |
67 | ENTRY(lock_scratchpad_sem) | 63 | * API functions |
68 | stmfd sp!, {lr} @ save registers on stack | 64 | */ |
69 | wait_sem: | ||
70 | mov r0,#1 | ||
71 | ldr r1, sdrc_scratchpad_sem | ||
72 | wait_loop: | ||
73 | ldr r2, [r1] @ load the lock value | ||
74 | cmp r2, r0 @ is the lock free ? | ||
75 | beq wait_loop @ not free... | ||
76 | swp r2, r0, [r1] @ semaphore free so lock it and proceed | ||
77 | cmp r2, r0 @ did we succeed ? | ||
78 | beq wait_sem @ no - try again | ||
79 | ldmfd sp!, {pc} @ restore regs and return | ||
80 | sdrc_scratchpad_sem: | ||
81 | .word SDRC_SCRATCHPAD_SEM_V | ||
82 | ENTRY(lock_scratchpad_sem_sz) | ||
83 | .word . - lock_scratchpad_sem | ||
84 | |||
85 | .text | ||
86 | /* Function to release the scratchpad semaphore */ | ||
87 | ENTRY(unlock_scratchpad_sem) | ||
88 | stmfd sp!, {lr} @ save registers on stack | ||
89 | ldr r3, sdrc_scratchpad_sem | ||
90 | mov r2,#0 | ||
91 | str r2,[r3] | ||
92 | ldmfd sp!, {pc} @ restore regs and return | ||
93 | ENTRY(unlock_scratchpad_sem_sz) | ||
94 | .word . - unlock_scratchpad_sem | ||
95 | 65 | ||
96 | .text | 66 | .text |
97 | /* Function call to get the restore pointer for resume from OFF */ | 67 | /* Function call to get the restore pointer for resume from OFF */ |
@@ -178,8 +148,7 @@ ENTRY(es3_sdrc_fix_sz) | |||
178 | /* Function to call rom code to save secure ram context */ | 148 | /* Function to call rom code to save secure ram context */ |
179 | ENTRY(save_secure_ram_context) | 149 | ENTRY(save_secure_ram_context) |
180 | stmfd sp!, {r1-r12, lr} @ save registers on stack | 150 | stmfd sp!, {r1-r12, lr} @ save registers on stack |
181 | save_secure_ram_debug: | 151 | |
182 | /* b save_secure_ram_debug */ @ enable to debug save code | ||
183 | adr r3, api_params @ r3 points to parameters | 152 | adr r3, api_params @ r3 points to parameters |
184 | str r0, [r3,#0x4] @ r0 has sdram address | 153 | str r0, [r3,#0x4] @ r0 has sdram address |
185 | ldr r12, high_mask | 154 | ldr r12, high_mask |
@@ -219,8 +188,7 @@ ENTRY(save_secure_ram_context_sz) | |||
219 | */ | 188 | */ |
220 | ENTRY(omap34xx_cpu_suspend) | 189 | ENTRY(omap34xx_cpu_suspend) |
221 | stmfd sp!, {r0-r12, lr} @ save registers on stack | 190 | stmfd sp!, {r0-r12, lr} @ save registers on stack |
222 | loop: | 191 | |
223 | /*b loop*/ @Enable to debug by stepping through code | ||
224 | /* r0 contains restore pointer in sdram */ | 192 | /* r0 contains restore pointer in sdram */ |
225 | /* r1 contains information about saving context */ | 193 | /* r1 contains information about saving context */ |
226 | ldr r4, sdrc_power @ read the SDRC_POWER register | 194 | ldr r4, sdrc_power @ read the SDRC_POWER register |
@@ -252,7 +220,6 @@ loop: | |||
252 | 220 | ||
253 | ldmfd sp!, {r0-r12, pc} @ restore regs and return | 221 | ldmfd sp!, {r0-r12, pc} @ restore regs and return |
254 | restore_es3: | 222 | restore_es3: |
255 | /*b restore_es3*/ @ Enable to debug restore code | ||
256 | ldr r5, pm_prepwstst_core_p | 223 | ldr r5, pm_prepwstst_core_p |
257 | ldr r4, [r5] | 224 | ldr r4, [r5] |
258 | and r4, r4, #0x3 | 225 | and r4, r4, #0x3 |
@@ -272,7 +239,6 @@ copy_to_sram: | |||
272 | b restore | 239 | b restore |
273 | 240 | ||
274 | restore_3630: | 241 | restore_3630: |
275 | /*b restore_es3630*/ @ Enable to debug restore code | ||
276 | ldr r1, pm_prepwstst_core_p | 242 | ldr r1, pm_prepwstst_core_p |
277 | ldr r2, [r1] | 243 | ldr r2, [r1] |
278 | and r2, r2, #0x3 | 244 | and r2, r2, #0x3 |
@@ -284,7 +250,6 @@ restore_3630: | |||
284 | str r2, [r1] | 250 | str r2, [r1] |
285 | /* Fall thru for the remaining logic */ | 251 | /* Fall thru for the remaining logic */ |
286 | restore: | 252 | restore: |
287 | /* b restore*/ @ Enable to debug restore code | ||
288 | /* Check what was the reason for mpu reset and store the reason in r9*/ | 253 | /* Check what was the reason for mpu reset and store the reason in r9*/ |
289 | /* 1 - Only L1 and logic lost */ | 254 | /* 1 - Only L1 and logic lost */ |
290 | /* 2 - Only L2 lost - In this case, we wont be here */ | 255 | /* 2 - Only L2 lost - In this case, we wont be here */ |
@@ -493,7 +458,6 @@ usettbr0: | |||
493 | 458 | ||
494 | ldmfd sp!, {r0-r12, pc} @ restore regs and return | 459 | ldmfd sp!, {r0-r12, pc} @ restore regs and return |
495 | save_context_wfi: | 460 | save_context_wfi: |
496 | /*b save_context_wfi*/ @ enable to debug save code | ||
497 | mov r8, r0 /* Store SDRAM address in r8 */ | 461 | mov r8, r0 /* Store SDRAM address in r8 */ |
498 | mrc p15, 0, r5, c1, c0, 1 @ Read Auxiliary Control Register | 462 | mrc p15, 0, r5, c1, c0, 1 @ Read Auxiliary Control Register |
499 | mov r4, #0x1 @ Number of parameters for restore call | 463 | mov r4, #0x1 @ Number of parameters for restore call |
@@ -673,12 +637,8 @@ sdrc_dlla_status: | |||
673 | .word SDRC_DLLA_STATUS_V | 637 | .word SDRC_DLLA_STATUS_V |
674 | sdrc_dlla_ctrl: | 638 | sdrc_dlla_ctrl: |
675 | .word SDRC_DLLA_CTRL_V | 639 | .word SDRC_DLLA_CTRL_V |
676 | pm_prepwstst_core: | ||
677 | .word PM_PREPWSTST_CORE_V | ||
678 | pm_prepwstst_core_p: | 640 | pm_prepwstst_core_p: |
679 | .word PM_PREPWSTST_CORE_P | 641 | .word PM_PREPWSTST_CORE_P |
680 | pm_prepwstst_mpu: | ||
681 | .word PM_PREPWSTST_MPU_V | ||
682 | pm_pwstctrl_mpu: | 642 | pm_pwstctrl_mpu: |
683 | .word PM_PWSTCTRL_MPU_P | 643 | .word PM_PWSTCTRL_MPU_P |
684 | scratchpad_base: | 644 | scratchpad_base: |
@@ -687,12 +647,6 @@ sram_base: | |||
687 | .word SRAM_BASE_P + 0x8000 | 647 | .word SRAM_BASE_P + 0x8000 |
688 | sdrc_power: | 648 | sdrc_power: |
689 | .word SDRC_POWER_V | 649 | .word SDRC_POWER_V |
690 | clk_stabilize_delay: | ||
691 | .word 0x000001FF | ||
692 | assoc_mask: | ||
693 | .word 0x3ff | ||
694 | numset_mask: | ||
695 | .word 0x7fff | ||
696 | ttbrbit_mask: | 650 | ttbrbit_mask: |
697 | .word 0xFFFFC000 | 651 | .word 0xFFFFC000 |
698 | table_index_mask: | 652 | table_index_mask: |