- /* Stack grows down from top of CAR */
- movl $(CONFIG_SYS_CAR_ADDR + CONFIG_SYS_CAR_SIZE), %esp
-
- /* Reserve space on stack for global data */
- subl $GENERATED_GBL_DATA_SIZE, %esp
-
- /* Align global data to 16-byte boundary */
- andl $0xfffffff0, %esp
-
- /* Zero the global data since it won't happen later */
- xorl %eax, %eax
- movl $GENERATED_GBL_DATA_SIZE, %ecx
- movl %esp, %edi
- rep stosb
-
- /* Setup first parameter to setup_gdt */
- movl %esp, %eax
-
- /* Reserve space for global descriptor table */
- subl $X86_GDT_SIZE, %esp
-
- /* Align temporary global descriptor table to 16-byte boundary */
- andl $0xfffffff0, %esp
-
- /* Set second parameter to setup_gdt */
- movl %esp, %edx
-
- /* Setup global descriptor table so gd->xyz works */
- call setup_gdt
+ /*
+ * 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 */
+ movl %esi, GD_TABLE(%edx)
+#endif
+ /* Store BIST */
+ movl %ebp, GD_BIST(%edx)