Commit e11c6c279d823dc0d2f470c5c2e3c0a9854a640f
arm: Allow lr to be saved by board code
The link register value can be required on some boards (e.g. FEL mode on sunxi) so use a branch instruction to jump to save_boot_params() instead of a branch link. This requires a branch back to save_boot_params_ret so adjust the users to deal with this. For exynos just drop the function since it doesn't do anything. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Showing 6 changed files with 24 additions and 6 deletions Side-by-side Diff
... | ... | @@ -31,9 +31,12 @@ |
31 | 31 | *************************************************************************/ |
32 | 32 | |
33 | 33 | .globl reset |
34 | + .globl save_boot_params_ret | |
34 | 35 | |
35 | 36 | reset: |
36 | - bl save_boot_params | |
37 | + /* Allow the board to save important registers */ | |
38 | + b save_boot_params | |
39 | +save_boot_params_ret: | |
37 | 40 | /* |
38 | 41 | * disable interrupts (FIQ and IRQ), also set the cpu to SVC32 mode, |
39 | 42 | * except if in HYP mode already |
... | ... | @@ -96,7 +99,7 @@ |
96 | 99 | * |
97 | 100 | *************************************************************************/ |
98 | 101 | ENTRY(save_boot_params) |
99 | - bx lr @ back to my caller | |
102 | + b save_boot_params_ret @ back to my caller | |
100 | 103 | ENDPROC(save_boot_params) |
101 | 104 | .weak save_boot_params |
102 | 105 |
... | ... | @@ -142,6 +142,21 @@ |
142 | 142 | |
143 | 143 | #ifndef __ASSEMBLY__ |
144 | 144 | |
145 | +/** | |
146 | + * save_boot_params() - Save boot parameters before starting reset sequence | |
147 | + * | |
148 | + * If you provide this function it will be called immediately U-Boot starts, | |
149 | + * both for SPL and U-Boot proper. | |
150 | + * | |
151 | + * All registers are unchanged from U-Boot entry. No registers need be | |
152 | + * preserved. | |
153 | + * | |
154 | + * This is not a normal C function. There is no stack. Return by branching to | |
155 | + * save_boot_params_ret. | |
156 | + * | |
157 | + * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3); | |
158 | + */ | |
159 | + | |
145 | 160 | #define isb() __asm__ __volatile__ ("" : : : "memory") |
146 | 161 | |
147 | 162 | #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); |
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 4adb46
-
mentioned in commit 4adb46
-
mentioned in commit 4adb46
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167
-
mentioned in commit 4adb46
-
mentioned in commit 64d167