diff options
author | Simon Glass <sjg@chromium.org> | 2023-09-26 08:14:24 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-09-26 11:25:25 -0400 |
commit | cf0ed4602df363b14981444ddc26be0c5572f6a0 (patch) | |
tree | 851c20487d9c8171c35e13d38a7a3d92ee0a5f88 | |
parent | 397f5a0a6479950336c1aed353ad2c9d235b9789 (diff) | |
download | u-boot-cf0ed4602df363b14981444ddc26be0c5572f6a0.zip u-boot-cf0ed4602df363b14981444ddc26be0c5572f6a0.tar.gz u-boot-cf0ed4602df363b14981444ddc26be0c5572f6a0.tar.bz2 |
spl: Create proper symbols for enabling the malloc() pool
For U-Boot proper we have CONFIG_SYS_MALLOC_F which indicates that a
malloc() pool is available before relocation.
For SPL we only have CONFIG_SPL_SYS_MALLOC_F_LEN which indicates the
size of the pool.
In various places we use CONFIG_SPL_SYS_MALLOC_F_LEN == 0 to indicate
that there is no pool.
This differing approach is confusing. Add a new CONFIG_SPL_SYS_MALLOC_F
symbol for SPL (and similarly for TPL and VPL). Tidy up the Kconfig
help for clarity.
For now these symbols are not used. That is cleaned up in the following
patches.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | Kconfig | 49 |
1 files changed, 38 insertions, 11 deletions
@@ -295,6 +295,16 @@ config SYS_MALLOC_LEN This defines memory to be allocated for Dynamic allocation TODO: Use for other architectures +config SPL_SYS_MALLOC_F + bool "Enable malloc() pool in SPL" + depends on SPL_FRAMEWORK && SYS_MALLOC_F && SPL + default y + help + In SPL 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 SPL_SYS_MALLOC_F_LEN hex "Size of malloc() pool in SPL" depends on SYS_MALLOC_F && SPL @@ -303,24 +313,32 @@ config SPL_SYS_MALLOC_F_LEN default 0x2000 if IMX8MQ default SYS_MALLOC_F_LEN help - In SPL 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. + Sets the size of the malloc() pool in SPL. This is used for + driver model and other features, which must allocate memory for + data structures. It is possible to enable CFG_SPL_SYS_MALLOC_START to start a new malloc() region in SDRAM once it is inited. -config TPL_SYS_MALLOC_F_LEN - hex "Size of malloc() pool in TPL" +config TPL_SYS_MALLOC_F + bool "Enable malloc() pool in SPL" depends on SYS_MALLOC_F && TPL - default SPL_SYS_MALLOC_F_LEN + default y if SPL_SYS_MALLOC_F help In TPL 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" + depends on SYS_MALLOC_F && TPL + default SPL_SYS_MALLOC_F_LEN + help + Sets the size of the malloc() pool in TPL. This is used for + driver model and other features, which must allocate memory for + data structures. + config VALGRIND bool "Inform valgrind about memory allocations" depends on !RISCV @@ -336,16 +354,25 @@ config VALGRIND it can be handled accurately by Valgrind. If you aren't planning on using valgrind to debug U-Boot, say 'n'. -config VPL_SYS_MALLOC_F_LEN - hex "Size of malloc() pool in VPL before relocation" +config VPL_SYS_MALLOC_F + bool "Enable malloc() pool in VPL" depends on SYS_MALLOC_F && VPL - default SYS_MALLOC_F_LEN + default y if SPL_SYS_MALLOC_F help - Before relocation, memory is very limited on many platforms. Still, + In VPL 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 VPL_SYS_MALLOC_F_LEN + hex "Size of malloc() pool in VPL before relocation" + depends on SYS_MALLOC_F && VPL + default SYS_MALLOC_F_LEN + help + Sets the size of the malloc() pool in VPL. This is used for + driver model and other features, which must allocate memory for + data structures. + menuconfig EXPERT bool "Configure standard U-Boot features (expert users)" default y |