Peng Fan | eae4de2 | 2018-01-10 13:20:37 +0800 | [diff] [blame^] | 1 | /* |
2 | * Copyright 2017 NXP | ||||
3 | * | ||||
4 | * SPDX-License-Identifier: GPL-2.0+ | ||||
5 | */ | ||||
6 | |||||
7 | #include <config.h> | ||||
8 | |||||
9 | .align 8 | ||||
10 | .global rom_pointer | ||||
11 | rom_pointer: | ||||
12 | .space 256 | ||||
13 | |||||
14 | /* | ||||
15 | * Routine: save_boot_params (called after reset from start.S) | ||||
16 | */ | ||||
17 | |||||
18 | .global save_boot_params | ||||
19 | save_boot_params: | ||||
20 | /* The firmware provided ATAG/FDT address can be found in r2/x0 */ | ||||
21 | adr x0, rom_pointer | ||||
22 | stp x1, x2, [x0], #16 | ||||
23 | stp x3, x4, [x0], #16 | ||||
24 | stp x5, x6, [x0], #16 | ||||
25 | stp x7, x8, [x0], #16 | ||||
26 | stp x9, x10, [x0], #16 | ||||
27 | stp x11, x12, [x0], #16 | ||||
28 | stp x13, x14, [x0], #16 | ||||
29 | stp x15, x16, [x0], #16 | ||||
30 | stp x17, x18, [x0], #16 | ||||
31 | stp x19, x20, [x0], #16 | ||||
32 | stp x21, x22, [x0], #16 | ||||
33 | stp x23, x24, [x0], #16 | ||||
34 | stp x25, x26, [x0], #16 | ||||
35 | stp x27, x28, [x0], #16 | ||||
36 | stp x29, x30, [x0], #16 | ||||
37 | mov x30, sp | ||||
38 | str x30, [x0], #8 | ||||
39 | |||||
40 | /* Returns */ | ||||
41 | b save_boot_params_ret | ||||
42 | |||||
43 | .global restore_boot_params | ||||
44 | restore_boot_params: | ||||
45 | adr x0, rom_pointer | ||||
46 | ldp x1, x2, [x0], #16 | ||||
47 | ldp x3, x4, [x0], #16 | ||||
48 | ldp x5, x6, [x0], #16 | ||||
49 | ldp x7, x8, [x0], #16 | ||||
50 | ldp x9, x10, [x0], #16 | ||||
51 | ldp x11, x12, [x0], #16 | ||||
52 | ldp x13, x14, [x0], #16 | ||||
53 | ldp x15, x16, [x0], #16 | ||||
54 | ldp x17, x18, [x0], #16 | ||||
55 | ldp x19, x20, [x0], #16 | ||||
56 | ldp x21, x22, [x0], #16 | ||||
57 | ldp x23, x24, [x0], #16 | ||||
58 | ldp x25, x26, [x0], #16 | ||||
59 | ldp x27, x28, [x0], #16 | ||||
60 | ldp x29, x30, [x0], #16 | ||||
61 | ldr x0, [x0] | ||||
62 | mov sp, x0 | ||||
63 | ret |