]> git.sur5r.net Git - u-boot/blobdiff - common/spl/spl.c
spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LEN
[u-boot] / common / spl / spl.c
index 7f3fd925ba1e205d470b7a5c685a9ef0226dcea8..c56cc6f0ec330ba444c604f6e148be2f8922c955 100644 (file)
@@ -220,12 +220,12 @@ static int spl_common_init(bool setup_malloc)
 
        debug("spl_early_init()\n");
 
-#if defined(CONFIG_SYS_MALLOC_F_LEN)
+#if CONFIG_VAL(SYS_MALLOC_F_LEN)
        if (setup_malloc) {
 #ifdef CONFIG_MALLOC_F_ADDR
                gd->malloc_base = CONFIG_MALLOC_F_ADDR;
 #endif
-               gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
+               gd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);
                gd->malloc_ptr = 0;
        }
 #endif
@@ -419,7 +419,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
        default:
                debug("Unsupported OS image.. Jumping nevertheless..\n");
        }
-#if defined(CONFIG_SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
+#if CONFIG_VAL(SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
        debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
              gd->malloc_ptr / 1024);
 #endif
@@ -486,7 +486,7 @@ ulong spl_relocate_stack_gd(void)
        gd_t *new_gd;
        ulong ptr = CONFIG_SPL_STACK_R_ADDR;
 
-#ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE
+#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_SPL_SYS_MALLOC_F_LEN
        if (CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN) {
                ptr -= CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN;
                gd->malloc_base = ptr;