1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Based on swsusp_32.S, modified for FSL BookE by
4 * Anton Vorontsov <avorontsov@ru.mvista.com>
5 * Copyright (c) 2009-2010 MontaVista Software, LLC.
8 #include <linux/threads.h>
9 #include <asm/processor.h>
11 #include <asm/cputable.h>
12 #include <asm/thread_info.h>
13 #include <asm/ppc_asm.h>
14 #include <asm/asm-offsets.h>
18 * Structure for storing CPU registers on the save area.
37 #define SL_R12 0x44 /* r12 to r31 */
38 #define SL_SIZE (SL_R12 + 80)
43 _GLOBAL(swsusp_save_area)
50 _GLOBAL(swsusp_arch_suspend)
51 lis r11,swsusp_save_area@h
52 ori r11,r11,swsusp_save_area@l
68 /* Get a stable timebase and save it */
95 /* Call the low level suspend stuff (we should probably have made
100 /* Restore LR from the save area */
101 lis r11,swsusp_save_area@h
102 ori r11,r11,swsusp_save_area@l
108 _GLOBAL(swsusp_arch_resume)
111 /* Load ptr the list of pages to copy in r3 */
112 lis r11,(restore_pblist)@h
113 ori r11,r11,restore_pblist@l
116 /* Copy the pages. This is a very basic implementation, to
117 * be replaced by something more cache efficient */
121 lwz r5,pbe_address(r3) /* source */
122 lwz r6,pbe_orig_address(r3) /* destination */
140 bl flush_instruction_cache
142 lis r11,swsusp_save_area@h
143 ori r11,r11,swsusp_save_area@l
146 * Mappings from virtual addresses to physical addresses may be
147 * different than they were prior to restoring hibernation state.
148 * Invalidate the TLB so that the boot CPU is using the new
170 /* restore the MSR */
182 /* Restore TCR and clear any pending bits in TSR. */
185 lis r4, (TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS)@h
188 /* Kick decrementer */
192 /* Restore the callee-saved registers and return */