]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-rockchip/rk3288-board-spl.c
rockchip: rk3288: move evb board to rockchip folder
[u-boot] / arch / arm / mach-rockchip / rk3288-board-spl.c
index d8c9ca71cfcc7b5bb80ef6bebf3cef973f3b3302..1b74173430842e7b0060a98457602f605bc98636 100644 (file)
@@ -29,6 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 u32 spl_boot_device(void)
 {
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
        const void *blob = gd->fdt_blob;
        struct udevice *dev;
        const char *bootdev;
@@ -63,6 +64,7 @@ u32 spl_boot_device(void)
        }
 
 fallback:
+#endif
        return BOOT_DEVICE_MMC1;
 }
 
@@ -114,6 +116,9 @@ static void configure_l2ctlr(void)
 #ifdef CONFIG_SPL_MMC_SUPPORT
 static int configure_emmc(struct udevice *pinctrl)
 {
+#if !defined(CONFIG_TARGET_ROCK2) && !defined(CONFIG_TARGET_FIREFLY_RK3288) && \
+       !defined(CONFIG_TARGET_EVB_RK3288)
+
        struct gpio_desc desc;
        int ret;
 
@@ -143,11 +148,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;
@@ -185,7 +190,7 @@ void board_init_f(ulong dummy)
        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;
@@ -202,6 +207,9 @@ void board_init_f(ulong dummy)
                debug("DRAM init failed: %d\n", ret);
                return;
        }
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+       back_to_bootrom();
+#endif
 }
 
 static int setup_led(void)
@@ -244,19 +252,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