]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/board_f.c
x86: Add DSDT table for supporting ACPI on QEMU
[karo-tx-uboot.git] / common / board_f.c
index dbbfbed39775c2628b3370bb9b4c38802baf5fdf..c0451bd9ea588197010563385a335c25f4dbab1f 100644 (file)
@@ -206,7 +206,8 @@ static int show_dram_config(void)
        debug("\nRAM Configuration:\n");
        for (i = size = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
                size += gd->bd->bi_dram[i].size;
-               debug("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
+               debug("Bank #%d: %llx ", i,
+                     (unsigned long long)(gd->bd->bi_dram[i].start));
 #ifdef DEBUG
                print_size(gd->bd->bi_dram[i].size, "\n");
 #endif
@@ -721,6 +722,7 @@ static int jump_to_copy(void)
         * with the stack in SDRAM and Global Data in temporary memory
         * (CPU cache)
         */
+       arch_setup_gd(gd->new_gd);
        board_init_f_r_trampoline(gd->start_addr_sp);
 #else
        relocate_code(gd->start_addr_sp, gd->new_gd, gd->relocaddr);
@@ -770,9 +772,6 @@ static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_OF_CONTROL
        fdtdec_setup,
 #endif
-#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
-       x86_fsp_init,
-#endif
 #ifdef CONFIG_TRACE
        trace_early_init,
 #endif
@@ -780,6 +779,9 @@ static init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
        /* TODO: can this go into arch_cpu_init()? */
        probecpu,
+#endif
+#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
+       x86_fsp_init,
 #endif
        arch_cpu_init,          /* basic arch cpu dependent setup */
        mark_bootstage,
@@ -1033,16 +1035,26 @@ void board_init_f_r(void)
 }
 #endif /* CONFIG_X86 */
 
+/* Unfortunately x86 can't compile this code as gd cannot be assigned */
 #ifndef CONFIG_X86
+__weak void arch_setup_gd(struct global_data *gd_ptr)
+{
+       gd = gd_ptr;
+}
+#endif /* !CONFIG_X86 */
+
 ulong board_init_f_mem(ulong top)
 {
+       struct global_data *gd_ptr;
+
        /* Leave space for the stack we are running with now */
        top -= 0x40;
 
        top -= sizeof(struct global_data);
        top = ALIGN(top, 16);
-       gd = (struct global_data *)top;
-       memset((void *)gd, '\0', sizeof(*gd));
+       gd_ptr = (struct global_data *)top;
+       memset(gd_ptr, '\0', sizeof(*gd));
+       arch_setup_gd(gd_ptr);
 
 #ifdef CONFIG_SYS_MALLOC_F_LEN
        top -= CONFIG_SYS_MALLOC_F_LEN;
@@ -1051,4 +1063,3 @@ ulong board_init_f_mem(ulong top)
 
        return top;
 }
-#endif /* !CONFIG_X86 */