Commit ae2cee2e34a9a4b69b7a4dea3dc93c4d93d93b53

Authored by Philipp Tomsich
1 parent 19b68fb280

spl: use TPL_SYS_MALLOC_F_LEN for TPL

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>

Showing 2 changed files with 12 additions and 2 deletions Side-by-side Diff

... ... @@ -96,7 +96,17 @@
96 96 initial serial device and any others that are needed.
97 97  
98 98 config SPL_SYS_MALLOC_F_LEN
99   - hex "Size of malloc() pool in spl before relocation"
  99 + hex "Size of malloc() pool in SPL before relocation"
  100 + depends on SYS_MALLOC_F
  101 + default SYS_MALLOC_F_LEN
  102 + help
  103 + Before relocation, memory is very limited on many platforms. Still,
  104 + we can provide a small malloc() pool if needed. Driver model in
  105 + particular needs this to operate, so that it can allocate the
  106 + initial serial device and any others that are needed.
  107 +
  108 +config TPL_SYS_MALLOC_F_LEN
  109 + hex "Size of malloc() pool in TPL before relocation"
100 110 depends on SYS_MALLOC_F
101 111 default SYS_MALLOC_F_LEN
102 112 help
... ... @@ -486,7 +486,7 @@
486 486 gd_t *new_gd;
487 487 ulong ptr = CONFIG_SPL_STACK_R_ADDR;
488 488  
489   -#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_SPL_SYS_MALLOC_F_LEN
  489 +#if defined(CONFIG_SPL_SYS_MALLOC_SIMPLE) && CONFIG_VAL(SYS_MALLOC_F_LEN)
490 490 if (CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN) {
491 491 ptr -= CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN;
492 492 gd->malloc_base = ptr;