huang lin | be1d5e0 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 1 | /* |
Xu Ziyuan | b47ea79 | 2016-07-12 19:09:49 +0800 | [diff] [blame] | 2 | * (C) Copyright 2016 Rockchip Electronics Co., Ltd |
huang lin | be1d5e0 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <linux/linkage.h> |
| 8 | |
| 9 | .globl SAVE_SP_ADDR |
| 10 | SAVE_SP_ADDR: |
| 11 | .word 0 |
| 12 | |
| 13 | /* |
| 14 | * void save_boot_params |
| 15 | * |
| 16 | * Save sp, lr, r1~r12 |
| 17 | */ |
| 18 | ENTRY(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 |
| 23 | ENDPROC(save_boot_params) |
| 24 | |
| 25 | |
Simon Glass | e1bc64e | 2017-04-15 13:11:31 -0600 | [diff] [blame] | 26 | .globl _back_to_bootrom_s |
| 27 | ENTRY(_back_to_bootrom_s) |
huang lin | be1d5e0 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 28 | ldr r0, =SAVE_SP_ADDR |
| 29 | ldr sp, [r0] |
| 30 | mov r0, #0 |
| 31 | pop {r1-r12, pc} |
Simon Glass | e1bc64e | 2017-04-15 13:11:31 -0600 | [diff] [blame] | 32 | ENDPROC(_back_to_bootrom_s) |