rockchip: rk3188: move spl_board_init() into rk3188.c
authorKever Yang <kever.yang@rock-chips.com>
Mon, 22 Jul 2019 11:59:16 +0000 (19:59 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 29 Jul 2019 02:25:27 +0000 (10:25 +0800)
Clean up the rk3188.c so that we can re-use the common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/rk3188-board-spl.c
arch/arm/mach-rockchip/rk3188/rk3188.c

index 33fa7d0bb78c95948545a63be758639b2202cf01..6370d3837e1a0845ccd88f4a425108c3c7ecf577 100644 (file)
@@ -114,42 +114,6 @@ void board_init_f(ulong dummy)
                debug("DRAM init failed: %d\n", ret);
                return;
        }
-}
-
-static int setup_led(void)
-{
-#ifdef CONFIG_SPL_LED
-       struct udevice *dev;
-       char *led_name;
-       int ret;
-
-       led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
-       if (!led_name)
-               return 0;
-       ret = led_get_by_label(led_name, &dev);
-       if (ret) {
-               debug("%s: get=%d\n", __func__, ret);
-               return ret;
-       }
-       ret = led_set_on(dev, 1);
-       if (ret)
-               return ret;
-#endif
-
-       return 0;
-}
-
-void spl_board_init(void)
-{
-       int ret;
-
-       ret = setup_led();
-       if (ret) {
-               debug("LED ret=%d\n", ret);
-               hang();
-       }
 
        preloader_console_init();
-
-       return;
 }
index f7e12a95b2dace64ce84f14d94c540d54d1b8386..7a0b10a27d6f6e4eee5c2c722db1796d6d8a7602 100644 (file)
@@ -60,3 +60,39 @@ int arch_cpu_init(void)
 #endif
        return 0;
 }
+
+#ifdef CONFIG_SPL_BUILD
+static int setup_led(void)
+{
+#ifdef CONFIG_SPL_LED
+       struct udevice *dev;
+       char *led_name;
+       int ret;
+
+       led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
+       if (!led_name)
+               return 0;
+       ret = led_get_by_label(led_name, &dev);
+       if (ret) {
+               debug("%s: get=%d\n", __func__, ret);
+               return ret;
+       }
+       ret = led_set_on(dev, 1);
+       if (ret)
+               return ret;
+#endif
+
+       return 0;
+}
+
+void spl_board_init(void)
+{
+       int ret;
+
+       ret = setup_led();
+       if (ret) {
+               debug("LED ret=%d\n", ret);
+               hang();
+       }
+}
+#endif