blob: 778ec83c2c8ca51bf714c0be1b479272635099de [file] [log] [blame]
huang lin1115b642015-11-17 14:20:27 +08001/*
2 * (C) Copyright 2015 Google, Inc
3 *
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)