huang lin | 1115b64 | 2015-11-17 14:20:27 +0800 | [diff] [blame] | 1 | /* |
| 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 |
| 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 | |
| 26 | .globl back_to_bootrom |
| 27 | ENTRY(back_to_bootrom) |
| 28 | ldr r0, =SAVE_SP_ADDR |
| 29 | ldr sp, [r0] |
| 30 | mov r0, #0 |
| 31 | pop {r1-r12, pc} |
| 32 | ENDPROC(back_to_bootrom) |