blob: 85b407b4d3bc2d941dde8a2719b51f3d945ace9e [file] [log] [blame]
huang lin1115b642015-11-17 14:20:27 +08001/*
Xu Ziyuan5401eb82016-07-12 19:09:49 +08002 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
huang lin1115b642015-11-17 14:20:27 +08003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <linux/linkage.h>
8
9.globl SAVE_SP_ADDR
10SAVE_SP_ADDR:
11 .word 0
12
13/*
14 * void save_boot_params
15 *
16 * Save sp, lr, r1~r12
17 */
18ENTRY(save_boot_params)
19 push {r1-r12, lr}
20 ldr r0, =SAVE_SP_ADDR
21 str sp, [r0]
22 b save_boot_params_ret @ back to my caller
23ENDPROC(save_boot_params)
24
25
26.globl back_to_bootrom
27ENTRY(back_to_bootrom)
28 ldr r0, =SAVE_SP_ADDR
29 ldr sp, [r0]
30 mov r0, #0
31 pop {r1-r12, pc}
32ENDPROC(back_to_bootrom)