]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/board_f.c
Merge branch 'master' of git://git.denx.de/u-boot-spi
[karo-tx-uboot.git] / common / board_f.c
index 0ada1afe16b220f1080146fa196120d4e7b3e8a3..02965b0df76a36a2218264d82365d087816d831f 100644 (file)
@@ -249,7 +249,11 @@ void dram_init_banksize(void)
 static int init_func_i2c(void)
 {
        puts("I2C:   ");
+#ifdef CONFIG_SYS_I2C
+       i2c_init_all();
+#else
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
        puts("ready\n");
        return 0;
 }
@@ -343,9 +347,10 @@ done:
 #ifdef CONFIG_SANDBOX
 static int setup_ram_buf(void)
 {
-       gd->arch.ram_buf = os_malloc(CONFIG_SYS_SDRAM_SIZE);
-       assert(gd->arch.ram_buf);
-       gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+       struct sandbox_state *state = state_get_current();
+
+       gd->arch.ram_buf = state->ram_buf;
+       gd->ram_size = state->ram_size;
 
        return 0;
 }
@@ -355,7 +360,7 @@ static int setup_fdt(void)
 {
 #ifdef CONFIG_OF_EMBED
        /* Get a pointer to the FDT */
-       gd->fdt_blob = _binary_dt_dtb_start;
+       gd->fdt_blob = __dtb_dt_begin;
 #elif defined CONFIG_OF_SEPARATE
        /* FDT is at end of image */
 # ifdef CONFIG_SYS_SYM_OFFSETS
@@ -458,7 +463,7 @@ static int reserve_round_4k(void)
 static int reserve_mmu(void)
 {
        /* reserve TLB table */
-       gd->arch.tlb_size = 4096 * 4;
+       gd->arch.tlb_size = PGTABLE_SIZE;
        gd->relocaddr -= gd->arch.tlb_size;
 
        /* round down to next 64 kB limit */
@@ -610,7 +615,7 @@ static int reserve_stacks(void)
         * TODO(sjg@chromium.org): Perhaps create arch_reserve_stack()
         * to handle this and put in arch/xxx/lib/stack.c
         */
-# ifdef CONFIG_ARM
+# if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
 #  ifdef CONFIG_USE_IRQ
        gd->start_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ);
        debug("Reserving %zu Bytes for IRQ stack at: %08lx\n",
@@ -768,7 +773,7 @@ static int setup_reloc(void)
 }
 
 /* ARM calls relocate_code from its crt0.S */
-#if !defined(CONFIG_ARM)
+#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX)
 
 static int jump_to_copy(void)
 {
@@ -788,8 +793,6 @@ static int jump_to_copy(void)
         * (CPU cache)
         */
        board_init_f_r_trampoline(gd->start_addr_sp);
-#elif defined(CONFIG_SANDBOX)
-       board_init_r(gd->new_gd, 0);
 #else
        relocate_code(gd->start_addr_sp, gd->new_gd, gd->relocaddr);
 #endif
@@ -807,11 +810,6 @@ static int mark_bootstage(void)
 }
 
 static init_fnc_t init_sequence_f[] = {
-#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \
-               !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \
-               !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86)
-       zero_global_data,
-#endif
 #ifdef CONFIG_SANDBOX
        setup_ram_buf,
 #endif
@@ -889,9 +887,7 @@ static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_PPC
        checkcpu,
 #endif
-#if defined(CONFIG_DISPLAY_CPUINFO)
        print_cpuinfo,          /* display cpu info (and speed) */
-#endif
 #if defined(CONFIG_MPC5xxx)
        prt_mpc5xxx_clks,
 #endif /* CONFIG_MPC5xxx */
@@ -991,7 +987,7 @@ static init_fnc_t init_sequence_f[] = {
        INIT_FUNC_WATCHDOG_RESET
        reloc_fdt,
        setup_reloc,
-#ifndef CONFIG_ARM
+#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX)
        jump_to_copy,
 #endif
        NULL,
@@ -1005,12 +1001,24 @@ void board_init_f(ulong boot_flags)
        gd = &data;
 #endif
 
+       /*
+        * Clear global data before it is accessed at debug print
+        * in initcall_run_list. Otherwise the debug print probably
+        * get the wrong vaule of gd->have_console.
+        */
+#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \
+               !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \
+               !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86)
+       zero_global_data();
+#endif
+
        gd->flags = boot_flags;
+       gd->have_console = 0;
 
        if (initcall_run_list(init_sequence_f))
                hang();
 
-#ifndef CONFIG_ARM
+#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX)
        /* NOTREACHED - jump_to_copy() does not return */
        hang();
 #endif