summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-08-21 10:19:09 -0600
committerTom Rini <[email protected]>2024-08-26 14:05:38 -0600
commit6abd992ada96cd7aa4757eeca44dae8942d7ba63 (patch)
tree216eb2a1a61a511c9a01ee3b4e9bd9dbebe61874 /common
parent52cd51c02fe0fcc4f86554de84e95607d62bdc21 (diff)
board_f: Add a new struct to hold pre-relocation info
Quite a few of the members of struct global_data are only used before reloction, or have little meaning afterwards, yet they hang around in struct global_data for the lifetime of U-Boot. This uses up precious pre-relocation SRAM on many boards. To help with this, start a new struct which exists only before relocation. Move new_fdt into this new struct. Drop the display of it in the 'bdinfo' command as it is probably not very useful. Note that the field does not exist in SPL builds. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/board_f.c b/common/board_f.c
index a1f8641ae26..8f7c56e812f 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -578,7 +578,7 @@ static int reserve_fdt(void)
gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob), 32);
gd->start_addr_sp = reserve_stack_aligned(gd->fdt_size);
- gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size);
+ gd->boardf->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size);
debug("Reserving %lu Bytes for FDT at: %08lx\n",
gd->fdt_size, gd->start_addr_sp);
}
@@ -668,10 +668,10 @@ static int init_post(void)
static int reloc_fdt(void)
{
if (!IS_ENABLED(CONFIG_OF_EMBED)) {
- if (gd->new_fdt) {
- memcpy(gd->new_fdt, gd->fdt_blob,
+ if (gd->boardf->new_fdt) {
+ memcpy(gd->boardf->new_fdt, gd->fdt_blob,
fdt_totalsize(gd->fdt_blob));
- gd->fdt_blob = gd->new_fdt;
+ gd->fdt_blob = gd->boardf->new_fdt;
}
}
@@ -1021,8 +1021,11 @@ static const init_fnc_t init_sequence_f[] = {
void board_init_f(ulong boot_flags)
{
+ struct board_f boardf;
+
gd->flags = boot_flags;
gd->flags &= ~GD_FLG_HAVE_CONSOLE;
+ gd->boardf = &boardf;
if (initcall_run_list(init_sequence_f))
hang();