2 * Based on swsusp_32.S, modified for FSL BookE by
3 * Anton Vorontsov <avorontsov@ru.mvista.com>
4 * Copyright (c) 2009-2010 MontaVista Software, LLC.
7 #include <linux/threads.h>
8 #include <asm/processor.h>
10 #include <asm/cputable.h>
11 #include <asm/thread_info.h>
12 #include <asm/ppc_asm.h>
13 #include <asm/asm-offsets.h>
17 * Structure for storing CPU registers on the save area.
36 #define SL_R12 0x44 /* r12 to r31 */
37 #define SL_SIZE (SL_R12 + 80)
42 _GLOBAL(swsusp_save_area)
49 _GLOBAL(swsusp_arch_suspend)
50 lis r11,swsusp_save_area@h
51 ori r11,r11,swsusp_save_area@l
67 /* Get a stable timebase and save it */
94 /* Call the low level suspend stuff (we should probably have made
99 /* Restore LR from the save area */
100 lis r11,swsusp_save_area@h
101 ori r11,r11,swsusp_save_area@l
107 _GLOBAL(swsusp_arch_resume)
110 /* Load ptr the list of pages to copy in r3 */
111 lis r11,(restore_pblist)@h
112 ori r11,r11,restore_pblist@l
115 /* Copy the pages. This is a very basic implementation, to
116 * be replaced by something more cache efficient */
120 lwz r5,pbe_address(r3) /* source */
121 lwz r6,pbe_orig_address(r3) /* destination */
139 bl flush_instruction_cache
141 lis r11,swsusp_save_area@h
142 ori r11,r11,swsusp_save_area@l
161 /* restore the MSR */
173 /* Restore TCR and clear any pending bits in TSR. */
176 lis r4, (TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS)@h
179 /* Kick decrementer */
183 /* Restore the callee-saved registers and return */