]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-rockchip/rk3288-board-spl.c
Merge git://git.denx.de/u-boot-dm
[u-boot] / arch / arm / mach-rockchip / rk3288-board-spl.c
index ed14023021d5694a9c8a4ef512d1da0c9a96c5ac..74f337919457637453fe90d474b83a358976a32b 100644 (file)
@@ -14,6 +14,7 @@
 #include <spl.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <asm/arch/bootrom.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
@@ -64,6 +65,10 @@ u32 spl_boot_device(void)
        }
 
 fallback:
+#elif defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \
+               defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \
+               defined(CONFIG_TARGET_CHROMEBOOK_MINNIE)
+       return BOOT_DEVICE_SPI;
 #endif
        return BOOT_DEVICE_MMC1;
 }
@@ -116,6 +121,8 @@ static void configure_l2ctlr(void)
 #ifdef CONFIG_SPL_MMC_SUPPORT
 static int configure_emmc(struct udevice *pinctrl)
 {
+#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY)
+
        struct gpio_desc desc;
        int ret;
 
@@ -145,11 +152,11 @@ static int configure_emmc(struct udevice *pinctrl)
                debug("gpio value ret=%d\n", ret);
                return ret;
        }
-
+#endif
        return 0;
 }
 #endif
-extern void back_to_bootrom(void);
+
 void board_init_f(ulong dummy)
 {
        struct udevice *pinctrl;
@@ -178,9 +185,9 @@ void board_init_f(ulong dummy)
        debug_uart_init();
 #endif
 
-       ret = spl_init();
+       ret = spl_early_init();
        if (ret) {
-               debug("spl_init() failed: %d\n", ret);
+               debug("spl_early_init() failed: %d\n", ret);
                hang();
        }
 
@@ -204,7 +211,7 @@ void board_init_f(ulong dummy)
                debug("DRAM init failed: %d\n", ret);
                return;
        }
-#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
        back_to_bootrom();
 #endif
 }
@@ -249,20 +256,17 @@ void spl_board_init(void)
                debug("%s: Cannot find pinctrl device\n", __func__);
                goto err;
        }
+
 #ifdef CONFIG_SPL_MMC_SUPPORT
-       if (!IS_ENABLED(CONFIG_TARGET_ROCK2) &&
-           !IS_ENABLED(CONFIG_TARGET_FIREFLY_RK3288) &&
-           !IS_ENABLED(CONFIG_TARGET_EVB_RK3288)) {
-               ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
-               if (ret) {
-                       debug("%s: Failed to set up SD card\n", __func__);
-                       goto err;
-               }
-               ret = configure_emmc(pinctrl);
-               if (ret) {
-                       debug("%s: Failed to set up eMMC\n", __func__);
-                       goto err;
-               }
+       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
+       if (ret) {
+               debug("%s: Failed to set up SD card\n", __func__);
+               goto err;
+       }
+       ret = configure_emmc(pinctrl);
+       if (ret) {
+               debug("%s: Failed to set up eMMC\n", __func__);
+               goto err;
        }
 #endif
 
@@ -274,6 +278,9 @@ void spl_board_init(void)
        }
 
        preloader_console_init();
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+       back_to_bootrom();
+#endif
        return;
 err:
        printf("spl_board_init: Error %d\n", ret);
@@ -281,7 +288,3 @@ err:
        /* No way to report error here */
        hang();
 }
-
-void lowlevel_init(void)
-{
-}