suniv: add new target
[openwrt/staging/wigyori.git] / package / boot / uboot-suniv / patches / 0001-arm-arm926ejs-start.S-port-save_boot_params-support-.patch
1 From 1dcc6c61ee650b26b94da4f4d6030d54706d87fe Mon Sep 17 00:00:00 2001
2 From: Icenowy Zheng <icenowy@aosc.io>
3 Date: Thu, 18 Jan 2018 23:11:20 +0800
4 Subject: [PATCH 01/29] arm: arm926ejs: start.S: port save_boot_params support
5 from armv7 code
6
7 The ARMv7 start code has support for saving some boot params at the
8 entry point, which is used by some SoCs to return to BROM.
9
10 Port this to ARM926EJ-S start code.
11
12 Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
13 ---
14 arch/arm/cpu/arm926ejs/start.S | 19 +++++++++++++++++++
15 1 file changed, 19 insertions(+)
16
17 diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
18 index ff592ba810..9011afed3f 100644
19 --- a/arch/arm/cpu/arm926ejs/start.S
20 +++ b/arch/arm/cpu/arm926ejs/start.S
21 @@ -17,6 +17,7 @@
22 #include <asm-offsets.h>
23 #include <config.h>
24 #include <common.h>
25 +#include <linux/linkage.h>
26
27 /*
28 *************************************************************************
29 @@ -32,8 +33,13 @@
30 */
31
32 .globl reset
33 + .globl save_boot_params_ret
34 + .type save_boot_params_ret,%function
35
36 reset:
37 + /* Allow the board to save important registers */
38 + b save_boot_params
39 +save_boot_params_ret:
40 /*
41 * set the cpu to SVC32 mode
42 */
43 @@ -110,3 +116,16 @@ flush_dcache:
44 #endif
45 mov pc, lr /* back to my caller */
46 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
47 +
48 +/*************************************************************************
49 + *
50 + * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3)
51 + * __attribute__((weak));
52 + *
53 + * Stack pointer is not yet initialized at this moment
54 + * Don't save anything to stack even if compiled with -O0
55 + *
56 + *************************************************************************/
57 +WEAK(save_boot_params)
58 + b save_boot_params_ret /* back to my caller */
59 +ENDPROC(save_boot_params)
60 --
61 2.20.1
62