summaryrefslogtreecommitdiffstats
path: root/arch/mips/cpu/mips64
diff options
context:
space:
mode:
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2015-01-18 22:18:39 +0100
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2015-01-21 14:07:23 +0100
commite520023882c7187a7cbaecfea0726ea158440aef (patch)
tree7ba50ce088bccb2abacf79a2e3b710c32ff9c6ec /arch/mips/cpu/mips64
parentdd82128ef5e9fc660862a0a60423aa01a03de5d4 (diff)
downloadtalos-obmc-uboot-e520023882c7187a7cbaecfea0726ea158440aef.tar.gz
talos-obmc-uboot-e520023882c7187a7cbaecfea0726ea158440aef.zip
MIPS: add support for pre-relocation malloc
Implement MIPS specific setup of the gd_t structure to support pre-relocation malloc. If CONFIG_SYS_MALLOC_F_LEN is specified, a memory area will be reserved after the initial stack area and the gd->malloc_base pointer will be initialized. After this patch the new driver model can be used on MIPS. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'arch/mips/cpu/mips64')
-rw-r--r--arch/mips/cpu/mips64/start.S24
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/mips/cpu/mips64/start.S b/arch/mips/cpu/mips64/start.S
index 81df923bc3..471bc1eb66 100644
--- a/arch/mips/cpu/mips64/start.S
+++ b/arch/mips/cpu/mips64/start.S
@@ -134,9 +134,31 @@ reset:
#endif
/* Set up temporary stack */
- dli sp, CONFIG_SYS_INIT_SP_ADDR
+ dli t0, -16
+ dli t1, CONFIG_SYS_INIT_SP_ADDR
+ and sp, t1, t0 # force 16 byte alignment
+ dsub sp, sp, GD_SIZE # reserve space for gd
+ and sp, sp, t0 # force 16 byte alignment
+ move k0, sp # save gd pointer
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+ dli t2, CONFIG_SYS_MALLOC_F_LEN
+ dsub sp, sp, t2 # reserve space for early malloc
+ and sp, sp, t0 # force 16 byte alignment
+#endif
move fp, sp
+ /* Clear gd */
+ move t0, k0
+1:
+ sw zero, 0(t0)
+ blt t0, t1, 1b
+ daddi t0, 4
+
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+ daddu t0, k0, GD_MALLOC_BASE # gd->malloc_base offset
+ sw sp, 0(t0)
+#endif
+
dla t9, board_init_f
jr t9
move ra, zero
OpenPOWER on IntegriCloud