mips: add a option to support not reserving malloc space on initial stack
[platform/kernel/u-boot.git] / arch / mips / cpu / start.S
index dd93df9..6de9a2f 100644 (file)
@@ -59,7 +59,8 @@
                sp, sp, GD_SIZE         # reserve space for gd
        and     sp, sp, t0              # force 16 byte alignment
        move    k0, sp                  # save gd pointer
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_VAL(SYS_MALLOC_F_LEN) && \
+    !CONFIG_IS_ENABLED(INIT_STACK_WITHOUT_MALLOC_F)
        li      t2, CONFIG_VAL(SYS_MALLOC_F_LEN)
        PTR_SUBU \
                sp, sp, t2              # reserve space for early malloc
@@ -75,7 +76,8 @@
        blt     t0, t1, 1b
         nop
 
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_VAL(SYS_MALLOC_F_LEN) && \
+    !CONFIG_IS_ENABLED(INIT_STACK_WITHOUT_MALLOC_F)
        PTR_S   sp, GD_MALLOC_BASE(k0)  # gd->malloc_base offset
 #endif
        .endm