Commit d3cdfd2a15d87d040a5f553231b979fbc28b98e7

Authored by Jean Pihet
Committed by Kevin Hilman
1 parent cc1b602887

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>

Showing 2 changed files with 6 additions and 53 deletions Side-by-side Diff

arch/arm/mach-omap2/pm.h
... ... @@ -80,7 +80,6 @@
80 80 extern void omap3_save_scratchpad_contents(void);
81 81  
82 82 extern unsigned int omap24xx_idle_loop_suspend_sz;
83   -extern unsigned int omap34xx_suspend_sz;
84 83 extern unsigned int save_secure_ram_context_sz;
85 84 extern unsigned int omap24xx_cpu_suspend_sz;
86 85 extern unsigned int omap34xx_cpu_suspend_sz;
arch/arm/mach-omap2/sleep34xx.S
... ... @@ -35,11 +35,7 @@
35 35  
36 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 38 #define PM_PREPWSTST_CORE_P 0x48306AE8
41   -#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \
42   - OMAP3430_PM_PREPWSTST)
43 39 #define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL
44 40 #define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
45 41 #define CM_IDLEST_CKGEN_V OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST)
46 42  
... ... @@ -62,36 +58,10 @@
62 58 #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
63 59 #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
64 60  
65   - .text
66   -/* Function to acquire the semaphore in scratchpad */
67   -ENTRY(lock_scratchpad_sem)
68   - stmfd sp!, {lr} @ save registers on stack
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 61  
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
  62 +/*
  63 + * API functions
  64 + */
95 65  
96 66 .text
97 67 /* Function call to get the restore pointer for resume from OFF */
... ... @@ -178,8 +148,7 @@
178 148 /* Function to call rom code to save secure ram context */
179 149 ENTRY(save_secure_ram_context)
180 150 stmfd sp!, {r1-r12, lr} @ save registers on stack
181   -save_secure_ram_debug:
182   - /* b save_secure_ram_debug */ @ enable to debug save code
  151 +
183 152 adr r3, api_params @ r3 points to parameters
184 153 str r0, [r3,#0x4] @ r0 has sdram address
185 154 ldr r12, high_mask
... ... @@ -219,8 +188,7 @@
219 188 */
220 189 ENTRY(omap34xx_cpu_suspend)
221 190 stmfd sp!, {r0-r12, lr} @ save registers on stack
222   -loop:
223   - /*b loop*/ @Enable to debug by stepping through code
  191 +
224 192 /* r0 contains restore pointer in sdram */
225 193 /* r1 contains information about saving context */
226 194 ldr r4, sdrc_power @ read the SDRC_POWER register
... ... @@ -252,7 +220,6 @@
252 220  
253 221 ldmfd sp!, {r0-r12, pc} @ restore regs and return
254 222 restore_es3:
255   - /*b restore_es3*/ @ Enable to debug restore code
256 223 ldr r5, pm_prepwstst_core_p
257 224 ldr r4, [r5]
258 225 and r4, r4, #0x3
... ... @@ -272,7 +239,6 @@
272 239 b restore
273 240  
274 241 restore_3630:
275   - /*b restore_es3630*/ @ Enable to debug restore code
276 242 ldr r1, pm_prepwstst_core_p
277 243 ldr r2, [r1]
278 244 and r2, r2, #0x3
... ... @@ -284,7 +250,6 @@
284 250 str r2, [r1]
285 251 /* Fall thru for the remaining logic */
286 252 restore:
287   - /* b restore*/ @ Enable to debug restore code
288 253 /* Check what was the reason for mpu reset and store the reason in r9*/
289 254 /* 1 - Only L1 and logic lost */
290 255 /* 2 - Only L2 lost - In this case, we wont be here */
... ... @@ -493,7 +458,6 @@
493 458  
494 459 ldmfd sp!, {r0-r12, pc} @ restore regs and return
495 460 save_context_wfi:
496   - /*b save_context_wfi*/ @ enable to debug save code
497 461 mov r8, r0 /* Store SDRAM address in r8 */
498 462 mrc p15, 0, r5, c1, c0, 1 @ Read Auxiliary Control Register
499 463 mov r4, #0x1 @ Number of parameters for restore call
500 464  
... ... @@ -673,12 +637,8 @@
673 637 .word SDRC_DLLA_STATUS_V
674 638 sdrc_dlla_ctrl:
675 639 .word SDRC_DLLA_CTRL_V
676   -pm_prepwstst_core:
677   - .word PM_PREPWSTST_CORE_V
678 640 pm_prepwstst_core_p:
679 641 .word PM_PREPWSTST_CORE_P
680   -pm_prepwstst_mpu:
681   - .word PM_PREPWSTST_MPU_V
682 642 pm_pwstctrl_mpu:
683 643 .word PM_PWSTCTRL_MPU_P
684 644 scratchpad_base:
... ... @@ -687,12 +647,6 @@
687 647 .word SRAM_BASE_P + 0x8000
688 648 sdrc_power:
689 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 650 ttbrbit_mask:
697 651 .word 0xFFFFC000
698 652 table_index_mask: