]> 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 123f58b27f2c3c459924e03f611e36b48ae50ad6..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,7 +152,7 @@ static int configure_emmc(struct udevice *pinctrl)
                debug("gpio value ret=%d\n", ret);
                return ret;
        }
-
+#endif
        return 0;
 }
 #endif
@@ -178,16 +185,16 @@ 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();
        }
 
        rockchip_timer_init();
        configure_l2ctlr();
 
-       ret = uclass_get_device(UCLASS_CLK, 0, &dev);
+       ret = rockchip_get_clk(&dev);
        if (ret) {
                debug("CLK init failed: %d\n", ret);
                return;
@@ -204,6 +211,9 @@ void board_init_f(ulong dummy)
                debug("DRAM init failed: %d\n", ret);
                return;
        }
+#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
+       back_to_bootrom();
+#endif
 }
 
 static int setup_led(void)
@@ -246,19 +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)) {
-               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
 
@@ -270,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);
@@ -277,7 +288,3 @@ err:
        /* No way to report error here */
        hang();
 }
-
-void lowlevel_init(void)
-{
-}