]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
spl: use TPL_SYS_MALLOC_F_LEN for TPL
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Fri, 28 Jul 2017 09:06:03 +0000 (11:06 +0200)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Sun, 13 Aug 2017 15:12:19 +0000 (17:12 +0200)
The (upstream) changes to break up SYS_MALLOC_F_LEN for the full
U-Boot and the SPL stage, break TPL (if simple malloc is enabled in
TPL).

This adds support for a TPL-variant of SYS_MALLOC_F_LEN:
- adds TPL_SYS_MALLOC_F_LEN
- rewrites a test for CONFIG_SPL_SYS_MALLOC_F_LEN to access
  CONFIG_VAL(SYS_MALLOC_F_LEN)

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Kconfig
common/spl/spl.c

diff --git a/Kconfig b/Kconfig
index 286d1c7afcfaf07ef3e99534f480508c84bcf259..14740b49f1ddbd00530292b13f7d0ad027039949 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -96,7 +96,17 @@ config SYS_MALLOC_F_LEN
          initial serial device and any others that are needed.
 
 config SPL_SYS_MALLOC_F_LEN
-        hex "Size of malloc() pool in spl before relocation"
+        hex "Size of malloc() pool in SPL before relocation"
+        depends on SYS_MALLOC_F
+        default SYS_MALLOC_F_LEN
+        help
+          Before relocation, memory is very limited on many platforms. Still,
+          we can provide a small malloc() pool if needed. Driver model in
+          particular needs this to operate, so that it can allocate the
+          initial serial device and any others that are needed.
+
+config TPL_SYS_MALLOC_F_LEN
+        hex "Size of malloc() pool in TPL before relocation"
         depends on SYS_MALLOC_F
         default SYS_MALLOC_F_LEN
         help
index c56cc6f0ec330ba444c604f6e148be2f8922c955..bdb681f4f6d95d8818b962a9558c63632e368d7e 100644 (file)
@@ -486,7 +486,7 @@ ulong spl_relocate_stack_gd(void)
        gd_t *new_gd;
        ulong ptr = CONFIG_SPL_STACK_R_ADDR;
 
-#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_SPL_SYS_MALLOC_F_LEN
+#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_VAL(SYS_MALLOC_F_LEN)
        if (CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN) {
                ptr -= CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN;
                gd->malloc_base = ptr;