- /* Initialise the Global Data Pointer */
- movl $CONFIG_SYS_INIT_GD_ADDR, %eax
- movl %eax, %edx
- addl $GENERATED_GBL_DATA_SIZE, %edx
- call init_gd;
+ /*
+ * Debug UART is available here although it may not be plumbed out
+ * to pins depending on the board. To use it:
+ *
+ * call debug_uart_init
+ * mov $'a', %eax
+ * call printch
+ */
+
+ /* Get address of global_data */
+ mov %fs:0, %edx
+#ifdef CONFIG_HAVE_FSP
+ /* Store the HOB list if we have one */
+ test %esi, %esi
+ 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 */
+ movl %esi, GD_TABLE(%edx)
+#endif
+ /* Store BIST */
+ movl %ebp, GD_BIST(%edx)