to give board_init_r() a larger heap then the initial heap in
SRAM which is limited to SYS_MALLOC_F_LEN bytes.
+config SPL_SEPARATE_BSS
+ depends on SPL
+ bool "BSS section is in a different memory region from text"
+ help
+ Some platforms need a large BSS region in SPL and can provide this
+ because RAM is already set up. In this case BSS can be moved to RAM.
+ This option should then be enabled so that the correct device tree
+ location is used. Normally we put the device tree at the end of BSS
+ but with this option enabled, it goes at _image_binary_end.
+
config TPL
bool
depends on SPL && SUPPORT_TPL
extern char __bss_end[];
extern char __image_copy_start[];
extern char __image_copy_end[];
+extern char _image_binary_end[];
extern char __rel_dyn_start[];
extern char __rel_dyn_end[];
gd->fdt_blob = __dtb_dt_begin;
# elif defined CONFIG_OF_SEPARATE
# ifdef CONFIG_SPL_BUILD
- /* FDT is at end of BSS */
- gd->fdt_blob = (ulong *)&__bss_end;
+ /* FDT is at end of BSS unless it is in a different memory region */
+ if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
+ gd->fdt_blob = (ulong *)&_image_binary_end;
+ else
+ gd->fdt_blob = (ulong *)&__bss_end;
# else
/* FDT is at end of image */
gd->fdt_blob = (ulong *)&_end;