rockchip: Migrate to use BOOTROM_SUPPORT driver
authorKever Yang <kever.yang@rock-chips.com>
Mon, 22 Jul 2019 11:59:15 +0000 (19:59 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 29 Jul 2019 02:25:27 +0000 (10:25 +0800)
SPL bootrom support is a boot device just like mmc and etc,
use formal boot device instead of jump to bootrom directly.
Enable the Kconfig by default if ROCKCHIP_BACK_TO_BROM is enabled.

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

index ac86532c8829a04f21391fe79db33b7258de6fbf..2b4e3c7ce47b4c407abb17262142c243a8fc9ad4 100644 (file)
@@ -34,8 +34,8 @@ config ROCKCHIP_RK3188
        select SPL_RAM
        select SPL_DRIVERS_MISC_SUPPORT
        select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
+       select SPL_ROCKCHIP_BACK_TO_BROM
        select BOARD_LATE_INIT
-       select ROCKCHIP_BROM_HELPER
        help
          The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9
          including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two
@@ -59,9 +59,7 @@ config ROCKCHIP_RK322X
        select SPL_DRIVERS_MISC_SUPPORT
        imply SPL_SERIAL_SUPPORT
        imply TPL_SERIAL_SUPPORT
-       imply TPL_BOOTROM_SUPPORT
        imply TPL_ROCKCHIP_COMMON_BOARD
-       select ROCKCHIP_BROM_HELPER
        select TPL_LIBCOMMON_SUPPORT
        select TPL_LIBGENERIC_SUPPORT
        help
@@ -77,7 +75,6 @@ config ROCKCHIP_RK3288
        select SUPPORT_SPL
        select SPL
        select SUPPORT_TPL
-       imply TPL_BOOTROM_SUPPORT
        imply TPL_CLK
        imply TPL_DM
        imply TPL_DRIVERS_MISC_SUPPORT
@@ -169,12 +166,10 @@ config ROCKCHIP_RK3399
        select DM_PMIC
        select DM_REGULATOR_FIXED
        select BOARD_LATE_INIT
-       select ROCKCHIP_BROM_HELPER
        imply TPL_SERIAL_SUPPORT
        imply TPL_LIBCOMMON_SUPPORT
        imply TPL_LIBGENERIC_SUPPORT
        imply TPL_SYS_MALLOC_SIMPLE
-       imply TPL_BOOTROM_SUPPORT
        imply TPL_DRIVERS_MISC_SUPPORT
        imply TPL_OF_CONTROL
        imply TPL_DM
@@ -211,6 +206,7 @@ config SPL_ROCKCHIP_BACK_TO_BROM
        bool "SPL returns to bootrom"
        default y if ROCKCHIP_RK3036
        select ROCKCHIP_BROM_HELPER
+       select SPL_BOOTROM_SUPPORT
        depends on SPL
        help
          Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
@@ -221,6 +217,7 @@ config TPL_ROCKCHIP_BACK_TO_BROM
        bool "TPL returns to bootrom"
        default y
        select ROCKCHIP_BROM_HELPER
+       select TPL_BOOTROM_SUPPORT
        depends on TPL
        help
          Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
index 05ae3eca98ebfa6ab027f5ff1283b07470a6b75e..33fa7d0bb78c95948545a63be758639b2202cf01 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void board_return_to_bootrom(void)
+{
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
+}
+
 u32 spl_boot_device(void)
 {
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
@@ -109,10 +114,6 @@ void board_init_f(ulong dummy)
                debug("DRAM init failed: %d\n", ret);
                return;
        }
-
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
 }
 
 static int setup_led(void)
@@ -149,8 +150,6 @@ void spl_board_init(void)
        }
 
        preloader_console_init();
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
+
        return;
 }
index c2e168192c2b3540937e4de29bcc9e45967e0ca9..9efba47affc55c246137e8fe77338e02043ac4f2 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void board_return_to_bootrom(void)
+{
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
+}
+
 u32 spl_boot_device(void)
 {
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
@@ -187,10 +192,6 @@ void board_init_f(ulong dummy)
                return;
        }
 #endif
-
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
 }
 
 static int setup_led(void)
@@ -227,9 +228,7 @@ void spl_board_init(void)
        }
 
        preloader_console_init();
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
+
        return;
 }