aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/sleep34xx.S
diff options
context:
space:
mode:
authorJean Pihet <j-pihet@ti.com>2010-12-18 10:44:44 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2010-12-21 17:45:58 -0500
commit1e81bc015a444e0f908451642b0197199d0c6fa4 (patch)
tree3f67edfef9995b02a5822316396f19f334811ad2 /arch/arm/mach-omap2/sleep34xx.S
parentfe360e1c8693bca175338da4c53078b0be807c52 (diff)
OMAP3: re-organize the ASM sleep code
Organize the code in the following sections: - register access macros, - API functions, - internal functions. 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> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/sleep34xx.S')
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S114
1 files changed, 61 insertions, 53 deletions
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 39b93225f9d7..5b978b8401c4 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -79,6 +79,7 @@ ENTRY(get_restore_pointer)
79 ldmfd sp!, {pc} @ restore regs and return 79 ldmfd sp!, {pc} @ restore regs and return
80ENTRY(get_restore_pointer_sz) 80ENTRY(get_restore_pointer_sz)
81 .word . - get_restore_pointer 81 .word . - get_restore_pointer
82
82 .text 83 .text
83/* Function call to get the restore pointer for 3630 resume from OFF */ 84/* Function call to get the restore pointer for 3630 resume from OFF */
84ENTRY(get_omap3630_restore_pointer) 85ENTRY(get_omap3630_restore_pointer)
@@ -89,9 +90,18 @@ ENTRY(get_omap3630_restore_pointer_sz)
89 .word . - get_omap3630_restore_pointer 90 .word . - get_omap3630_restore_pointer
90 91
91 .text 92 .text
93/* Function call to get the restore pointer for ES3 to resume from OFF */
94ENTRY(get_es3_restore_pointer)
95 stmfd sp!, {lr} @ save registers on stack
96 adr r0, restore_es3
97 ldmfd sp!, {pc} @ restore regs and return
98ENTRY(get_es3_restore_pointer_sz)
99 .word . - get_es3_restore_pointer
100
101 .text
92/* 102/*
93 * L2 cache needs to be toggled for stable OFF mode functionality on 3630. 103 * L2 cache needs to be toggled for stable OFF mode functionality on 3630.
94 * This function sets up a fflag that will allow for this toggling to take 104 * This function sets up a flag that will allow for this toggling to take
95 * place on 3630. Hopefully some version in the future maynot need this 105 * place on 3630. Hopefully some version in the future maynot need this
96 */ 106 */
97ENTRY(enable_omap3630_toggle_l2_on_restore) 107ENTRY(enable_omap3630_toggle_l2_on_restore)
@@ -101,58 +111,6 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
101 str r1, l2dis_3630 111 str r1, l2dis_3630
102 ldmfd sp!, {pc} @ restore regs and return 112 ldmfd sp!, {pc} @ restore regs and return
103 113
104 .text
105/* Function call to get the restore pointer for for ES3 to resume from OFF */
106ENTRY(get_es3_restore_pointer)
107 stmfd sp!, {lr} @ save registers on stack
108 adr r0, restore_es3
109 ldmfd sp!, {pc} @ restore regs and return
110ENTRY(get_es3_restore_pointer_sz)
111 .word . - get_es3_restore_pointer
112
113ENTRY(es3_sdrc_fix)
114 ldr r4, sdrc_syscfg @ get config addr
115 ldr r5, [r4] @ get value
116 tst r5, #0x100 @ is part access blocked
117 it eq
118 biceq r5, r5, #0x100 @ clear bit if set
119 str r5, [r4] @ write back change
120 ldr r4, sdrc_mr_0 @ get config addr
121 ldr r5, [r4] @ get value
122 str r5, [r4] @ write back change
123 ldr r4, sdrc_emr2_0 @ get config addr
124 ldr r5, [r4] @ get value
125 str r5, [r4] @ write back change
126 ldr r4, sdrc_manual_0 @ get config addr
127 mov r5, #0x2 @ autorefresh command
128 str r5, [r4] @ kick off refreshes
129 ldr r4, sdrc_mr_1 @ get config addr
130 ldr r5, [r4] @ get value
131 str r5, [r4] @ write back change
132 ldr r4, sdrc_emr2_1 @ get config addr
133 ldr r5, [r4] @ get value
134 str r5, [r4] @ write back change
135 ldr r4, sdrc_manual_1 @ get config addr
136 mov r5, #0x2 @ autorefresh command
137 str r5, [r4] @ kick off refreshes
138 bx lr
139sdrc_syscfg:
140 .word SDRC_SYSCONFIG_P
141sdrc_mr_0:
142 .word SDRC_MR_0_P
143sdrc_emr2_0:
144 .word SDRC_EMR2_0_P
145sdrc_manual_0:
146 .word SDRC_MANUAL_0_P
147sdrc_mr_1:
148 .word SDRC_MR_1_P
149sdrc_emr2_1:
150 .word SDRC_EMR2_1_P
151sdrc_manual_1:
152 .word SDRC_MANUAL_1_P
153ENTRY(es3_sdrc_fix_sz)
154 .word . - es3_sdrc_fix
155
156/* Function to call rom code to save secure ram context */ 114/* Function to call rom code to save secure ram context */
157ENTRY(save_secure_ram_context) 115ENTRY(save_secure_ram_context)
158 stmfd sp!, {r1-r12, lr} @ save registers on stack 116 stmfd sp!, {r1-r12, lr} @ save registers on stack
@@ -578,6 +536,56 @@ skip_l2_inval:
578 /* restore regs and return */ 536 /* restore regs and return */
579 ldmfd sp!, {r0-r12, pc} 537 ldmfd sp!, {r0-r12, pc}
580 538
539
540/*
541 * Internal functions
542 */
543
544 .text
545ENTRY(es3_sdrc_fix)
546 ldr r4, sdrc_syscfg @ get config addr
547 ldr r5, [r4] @ get value
548 tst r5, #0x100 @ is part access blocked
549 it eq
550 biceq r5, r5, #0x100 @ clear bit if set
551 str r5, [r4] @ write back change
552 ldr r4, sdrc_mr_0 @ get config addr
553 ldr r5, [r4] @ get value
554 str r5, [r4] @ write back change
555 ldr r4, sdrc_emr2_0 @ get config addr
556 ldr r5, [r4] @ get value
557 str r5, [r4] @ write back change
558 ldr r4, sdrc_manual_0 @ get config addr
559 mov r5, #0x2 @ autorefresh command
560 str r5, [r4] @ kick off refreshes
561 ldr r4, sdrc_mr_1 @ get config addr
562 ldr r5, [r4] @ get value
563 str r5, [r4] @ write back change
564 ldr r4, sdrc_emr2_1 @ get config addr
565 ldr r5, [r4] @ get value
566 str r5, [r4] @ write back change
567 ldr r4, sdrc_manual_1 @ get config addr
568 mov r5, #0x2 @ autorefresh command
569 str r5, [r4] @ kick off refreshes
570 bx lr
571
572sdrc_syscfg:
573 .word SDRC_SYSCONFIG_P
574sdrc_mr_0:
575 .word SDRC_MR_0_P
576sdrc_emr2_0:
577 .word SDRC_EMR2_0_P
578sdrc_manual_0:
579 .word SDRC_MANUAL_0_P
580sdrc_mr_1:
581 .word SDRC_MR_1_P
582sdrc_emr2_1:
583 .word SDRC_EMR2_1_P
584sdrc_manual_1:
585 .word SDRC_MANUAL_1_P
586ENTRY(es3_sdrc_fix_sz)
587 .word . - es3_sdrc_fix
588
581/* Make sure SDRC accesses are ok */ 589/* Make sure SDRC accesses are ok */
582wait_sdrc_ok: 590wait_sdrc_ok:
583 591