After fsp_init() returns, the stack has already been switched to a
place within system memory as defined by CONFIG_FSP_TEMP_RAM_ADDR.
Enlarge the size of malloc() pool before relocation since we have
plenty of memory now.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Stack top address which is used in FspInit after DRAM is ready and
CAR is disabled.
Stack top address which is used in FspInit after DRAM is ready and
CAR is disabled.
+config FSP_SYS_MALLOC_F_LEN
+ hex
+ depends on HAVE_FSP
+ default 0x100000
+ help
+ Additional size of malloc() pool before relocation.
+
config SMP
bool "Enable Symmetric Multiprocessing"
default n
config SMP
bool "Enable Symmetric Multiprocessing"
default n
jz skip_hob
movl %esi, GD_HOB_LIST(%edx)
jz skip_hob
movl %esi, GD_HOB_LIST(%edx)
+ /*
+ * After fsp_init() returns, the stack has already been switched to a
+ * place within system memory as defined by CONFIG_FSP_TEMP_RAM_ADDR.
+ * Enlarge the size of malloc() pool before relocation since we have
+ * plenty of memory now.
+ */
+ subl $CONFIG_FSP_SYS_MALLOC_F_LEN, %esp
+ movl %esp, GD_MALLOC_BASE(%edx)
skip_hob:
#else
/* Store table pointer */
skip_hob:
#else
/* Store table pointer */
- if (!gd->arch.hob_list)
+ if (!gd->arch.hob_list) {
+ /*
+ * The first time we enter here, call fsp_init().
+ * Note the execution does not return to this function,
+ * instead it jumps to fsp_continue().
+ */
fsp_init(CONFIG_FSP_TEMP_RAM_ADDR, BOOT_FULL_CONFIG, NULL);
fsp_init(CONFIG_FSP_TEMP_RAM_ADDR, BOOT_FULL_CONFIG, NULL);
+ } else {
+ /*
+ * The second time we enter here, adjust the size of malloc()
+ * pool before relocation. Given gd->malloc_base was adjusted
+ * after the call to board_init_f_mem() in arch/x86/cpu/start.S,
+ * we should fix up gd->malloc_limit here.
+ */
+ gd->malloc_limit += CONFIG_FSP_SYS_MALLOC_F_LEN;
+ }