2 /* linux/arch/arm/mach-omap2/sleep3517.S
4 * AM3505/3517 Sleep Code.
5 * Ranjith Lohithakshan <ranjithl@ti.com>
7 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 #include <linux/linkage.h>
20 #include <asm/assembler.h>
25 #define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
26 #define CM_CLKST_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, OMAP3430_CM_CLKSTST)
27 #define CM_ICLKEN1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_ICLKEN1)
29 #define EMIF_PM_CTR_V OMAP2_L3_IO_ADDRESS(0x6D000038)
30 #define OMAP3517_CONF1_REG_V OMAP2_L4_IO_ADDRESS(0x48002584)
33 * Forces OMAP into idle state
35 * omap34xx_suspend() - This bit of code just executes the WFI
38 * Note: This code get's copied to internal SRAM at boot. When the OMAP
39 * wakes up it continues execution at the point it went to sleep.
41 ENTRY(omap34xx_cpu_suspend)
42 stmfd sp!, {r0-r12, lr} @ save registers on stack
44 /*b loop*/ @Enable to debug by stepping through code
46 /* Put EMIF in self-refresh */
52 /* Disable SDRC and Control Module */
53 ldr r4, cm_iclken1_core
54 ldr r5, clk_core_disable
57 ldr r4, cm_idlest1_core
63 /* Gate DDR Phy clock */
64 ldr r4, omap3517_conf1
68 /* Data memory barrier and Data sync barrier */
70 mcr p15, 0, r1, c7, c10, 4
71 mcr p15, 0, r1, c7, c10, 5
86 /* Enable SDRC and Control Module */
87 ldr r4, cm_iclken1_core
88 ldr r5, iclk_core_enable
91 /* Enable DDR Phy Clock */
92 ldr r4, omap3517_conf1
93 ldr r5, emif_phy_enable
96 /* Take EMIF out of self-refresh */
102 ldmfd sp!, {r0-r12, pc} @ restore regs and return
113 .word CM_IDLEST1_CORE_V
115 .word CM_CLKST_CORE_V
119 .word CM_ICLKEN1_CORE_V
121 .word OMAP3517_CONF1_REG_V
122 ENTRY(omap34xx_cpu_suspend_sz)
123 .word . - omap34xx_cpu_suspend
125 /* Function to call rom code to save secure ram context */
126 ENTRY(save_secure_ram_context)
127 stmfd sp!, {r1-r12, lr} @ save registers on stack
128 save_secure_ram_debug:
129 /* b save_secure_ram_debug */ @ enable to debug save code
130 ldmfd sp!, {r1-r12, pc}
131 ENTRY(save_secure_ram_context_sz)
132 .word . - save_secure_ram_context
134 /* Function call to get the restore pointer for resume from OFF */
135 ENTRY(get_restore_pointer)
136 stmfd sp!, {lr} @ save registers on stack
137 ldmfd sp!, {pc} @ restore regs and return
138 ENTRY(get_restore_pointer_sz)
139 .word . - get_restore_pointer
141 /* Function call to get the restore pointer for resume from OFF */
142 ENTRY(get_es3_restore_pointer)
143 stmfd sp!, {lr} @ save registers on stack
144 ldmfd sp!, {pc} @ restore regs and return
145 ENTRY(get_es3_restore_pointer_sz)
146 .word . - get_es3_restore_pointer