1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2017 Andes Technology Corporation */
4 #include <asm/memory.h>
17 #if defined(CONFIG_HWZOL)
39 #if defined(CONFIG_FPU)
40 jal store_fpu_for_suspend
45 // transfer $sp from va to pa
46 sethi $r0, hi20(PAGE_OFFSET)
47 ori $r0, $r0, lo12(PAGE_OFFSET)
52 // store pa($sp) to sp_tmp
53 sethi $r1, hi20(sp_tmp)
54 swi $r2, [$r1 + lo12(sp_tmp)]
58 #ifdef CONFIG_CACHE_L2
59 jal dcache_wb_all_level
66 // get wake_mask and loop in standby
75 // set ipc to resume address
81 // reset psw, turn off the address translation
88 // translate the address of sp_tmp variable to pa
90 sethi $r0, hi20(PAGE_OFFSET)
91 ori $r0, $r0, lo12(PAGE_OFFSET)
96 // access the sp_tmp to get stack pointer
100 #if defined(CONFIG_HWZOL)
111 // set original psw to ipsw