diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-22 19:30:21 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 12:24:40 -0700 |
commit | 38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75 (patch) | |
tree | 8270760e4e3f1e29be75d813b921fb65422c98d8 /include/spl.h | |
parent | acfb5308f5e51fd1f4428618d704ad0de2358871 (diff) | |
download | u-boot-38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75.tar.gz u-boot-38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75.tar.bz2 u-boot-38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75.zip |
spl: Drop bd_info in the data section
This uses up space in the SPL binary but it always starts as zero. Also
some boards cannot support data in TPL (e.g. Intel Apollo Lake).
Use malloc() to allocate this structure instead, by moving the init a
little later, after malloc() is inited. Make this function optional since
it pulls in malloc().
This reduces the TPL binary size on coral by about 64 bytes
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/spl.h')
-rw-r--r-- | include/spl.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/spl.h b/include/spl.h index 374a295fa3..a7648787b7 100644 --- a/include/spl.h +++ b/include/spl.h @@ -285,7 +285,15 @@ u32 spl_mmc_boot_mode(const u32 boot_device); * If not overridden, it is weakly defined in common/spl/spl_mmc.c. */ int spl_mmc_boot_partition(const u32 boot_device); -void spl_set_bd(void); + +/** + * spl_alloc_bd() - Allocate space for bd_info + * + * This sets up the gd->bd pointer by allocating memory for it + * + * @return 0 if OK, -ENOMEM if out of memory + */ +int spl_alloc_bd(void); /** * spl_set_header_raw_uboot() - Set up a standard SPL image structure |