summaryrefslogtreecommitdiff
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-23 05:30:21 +0300
committerSimon Glass <sjg@chromium.org>2021-01-05 22:24:40 +0300
commit38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75 (patch)
tree8270760e4e3f1e29be75d813b921fb65422c98d8 /arch/arm/cpu
parentacfb5308f5e51fd1f4428618d704ad0de2358871 (diff)
downloadu-boot-38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75.tar.xz
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 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/spl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 77724336d6..215ed9759e 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -38,6 +38,9 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_BUILD
+/* Define board data structure */
+static struct bd_info bdata __attribute__ ((section(".data")));
+
void spl_board_init(void)
{
#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_LSCH2)
@@ -74,7 +77,7 @@ void board_init_f(ulong dummy)
get_clocks();
preloader_console_init();
- spl_set_bd();
+ gd->bd = &bdata;
#ifdef CONFIG_SYS_I2C
#ifdef CONFIG_SPL_I2C_SUPPORT