]> git.sur5r.net Git - u-boot/blobdiff - common/board_r.c
sdhci: Add sdhci support for spear devices
[u-boot] / common / board_r.c
index c57ae5cace163dcd578e91612d309bf87db2ac7c..f801e411030abad9bf21b2acb1beb8f28ff650f9 100644 (file)
@@ -63,6 +63,9 @@
 #include <asm/mmu.h>
 #endif
 #include <asm/sections.h>
+#ifdef CONFIG_X86
+#include <asm/init_helpers.h>
+#endif
 #include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -133,7 +136,7 @@ static int initr_reloc_global_data(void)
 {
 #ifdef CONFIG_SYS_SYM_OFFSETS
        monitor_flash_len = _end_ofs;
-#else
+#elif !defined(CONFIG_SANDBOX)
        monitor_flash_len = (ulong)&__init_end - gd->dest_addr;
 #endif
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
@@ -261,7 +264,8 @@ static int initr_malloc(void)
 
        /* The malloc area is immediately below the monitor copy in DRAM */
        malloc_start = gd->dest_addr - TOTAL_MALLOC_LEN;
-       mem_malloc_init(malloc_start, TOTAL_MALLOC_LEN);
+       mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN),
+                       TOTAL_MALLOC_LEN);
        return 0;
 }
 
@@ -504,11 +508,13 @@ static int show_model_r(void)
 #endif
 
 /* enable exceptions */
+#ifdef CONFIG_ARM
 static int initr_enable_interrupts(void)
 {
        enable_interrupts();
        return 0;
 }
+#endif
 
 #ifdef CONFIG_CMD_NET
 static int initr_ethaddr(void)
@@ -686,6 +692,9 @@ static int initr_modem(void)
 
 static int run_main_loop(void)
 {
+#ifdef CONFIG_SANDBOX
+       sandbox_main_loop_init();
+#endif
        /* main_loop() can return to retry autoboot, if so just run it again */
        for (;;)
                main_loop();
@@ -764,11 +773,16 @@ init_fnc_t init_sequence_r[] = {
        initr_flash,
 #endif
        INIT_FUNC_WATCHDOG_RESET
-#ifdef CONFIG_PPC
+#if defined(CONFIG_PPC) || defined(CONFIG_X86)
        /* initialize higher level parts of CPU like time base and timers */
        cpu_init_r,
+#endif
+#ifdef CONFIG_PPC
        initr_spi,
 #endif
+#if defined(CONFIG_X86) && defined(CONFIG_SPI)
+       init_func_spi,
+#endif
 #ifdef CONFIG_CMD_NAND
        initr_nand,
 #endif
@@ -821,11 +835,17 @@ init_fnc_t init_sequence_r[] = {
        INIT_FUNC_WATCHDOG_RESET
 #ifdef CONFIG_CMD_KGDB
        initr_kgdb,
+#endif
+#ifdef CONFIG_X86
+       board_early_init_r,
 #endif
        interrupt_init,
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_x86)
        initr_enable_interrupts,
 #endif
+#ifdef CONFIG_X86
+       timer_init,             /* initialize timer */
+#endif
 #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
        initr_status_led,
 #endif
@@ -887,7 +907,9 @@ init_fnc_t init_sequence_r[] = {
 
 void board_init_r(gd_t *new_gd, ulong dest_addr)
 {
+#ifndef CONFIG_X86
        gd = new_gd;
+#endif
        if (initcall_run_list(init_sequence_r))
                hang();