uboot-lantiq: reduce stack size
[openwrt/staging/dedeckeh.git] / package / boot / uboot-lantiq / patches / 0033-MIPS-lantiq-reduce-stack-size.patch
1 From ad739ffebf689abdbcddbe4e1b0bf847d7931a92 Mon Sep 17 00:00:00 2001
2 From: Mathias Kresin <dev@kresin.me>
3 Date: Fri, 20 Jan 2017 13:59:53 +0100
4 Subject: [PATCH] MIPS: lantiq: reduce stack size
5
6 On lantiq a lot of stuff expects to be loaded to and executed at
7 0x80002000, including our own second stage bootloader.
8
9 For all build u-boots, the initial stack pointer is at 0x80008000. After
10 loading data to 0x80002000, every further stack operation corrupts the
11 loaded code.
12
13 Set the initial stack pointer to 0x80002000, to not overwrite code
14 loaded in memory. A stack of 0x2000 bytes has been proven as enough in
15 all done tests.
16
17 Signed-off-by: Mathias Kresin <dev@kresin.me>
18 ---
19 arch/mips/include/asm/arch-arx100/config.h | 2 +-
20 arch/mips/include/asm/arch-danube/config.h | 2 +-
21 arch/mips/include/asm/arch-vrx200/config.h | 2 +-
22 3 files changed, 3 insertions(+), 3 deletions(-)
23
24 --- a/arch/mips/include/asm/arch-arx100/config.h
25 +++ b/arch/mips/include/asm/arch-arx100/config.h
26 @@ -66,7 +66,7 @@
27 #define CONFIG_SYS_MEMTEST_END 0x82000000
28 #define CONFIG_SYS_LOAD_ADDR 0x81000000
29 #define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
30 -#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024)
31 +#define CONFIG_SYS_INIT_SP_OFFSET 0x2000
32
33 /* SRAM */
34 #define CONFIG_SYS_SRAM_BASE 0xBE1A0000
35 --- a/arch/mips/include/asm/arch-danube/config.h
36 +++ b/arch/mips/include/asm/arch-danube/config.h
37 @@ -57,7 +57,7 @@
38 #define CONFIG_SYS_MEMTEST_END 0x82000000
39 #define CONFIG_SYS_LOAD_ADDR 0x81000000
40 #define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
41 -#define CONFIG_SYS_INIT_SP_OFFSET 0x4000
42 +#define CONFIG_SYS_INIT_SP_OFFSET 0x2000
43
44 /* SRAM */
45 #define CONFIG_SYS_SRAM_BASE 0xBE1A0000
46 --- a/arch/mips/include/asm/arch-vrx200/config.h
47 +++ b/arch/mips/include/asm/arch-vrx200/config.h
48 @@ -69,7 +69,7 @@
49 #define CONFIG_SYS_MEMTEST_END 0x82000000
50 #define CONFIG_SYS_LOAD_ADDR 0x81000000
51 #define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
52 -#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024)
53 +#define CONFIG_SYS_INIT_SP_OFFSET 0x2000
54
55 /* SRAM */
56 #define CONFIG_SYS_SRAM_BASE 0xBE220000