]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3399: Migrate to use common spl board file
authorKever Yang <kever.yang@rock-chips.com>
Mon, 22 Jul 2019 11:59:42 +0000 (19:59 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 29 Jul 2019 02:25:27 +0000 (10:25 +0800)
rk3399 has similar boot flow in SPL with other Rockchip SoCs,
migrate to use common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/Kconfig
arch/arm/mach-rockchip/Makefile
arch/arm/mach-rockchip/rk3399-board-spl.c [deleted file]

index 25214bca9c9e06d13e713c3b94e02cde9a8a800c..81dee9e5c7355cb26ef8e3b656a44ae2e78ea827 100644 (file)
@@ -170,6 +170,7 @@ config ROCKCHIP_RK3399
        select DM_PMIC
        select DM_REGULATOR_FIXED
        select BOARD_LATE_INIT
+       imply SPL_ROCKCHIP_COMMON_BOARD
        imply TPL_SERIAL_SUPPORT
        imply TPL_LIBCOMMON_SUPPORT
        imply TPL_LIBGENERIC_SUPPORT
index c7ab72c13be83db48e3c2f2aa5f4d5b7e99a2ddc..5cb2c6dcc974da69a1580480b2e030f50bfe38ff 100644 (file)
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
-obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o
 
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
 
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
deleted file mode 100644 (file)
index cb481c5..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
- * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
- */
-
-#include <common.h>
-#include <debug_uart.h>
-#include <dm.h>
-#include <ram.h>
-#include <spl.h>
-#include <spl_gpio.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
-#include <asm/arch-rockchip/bootrom.h>
-#include <asm/arch-rockchip/cru_rk3399.h>
-#include <asm/arch-rockchip/hardware.h>
-#include <asm/arch-rockchip/periph.h>
-#include <asm/arch-rockchip/sys_proto.h>
-
-void board_return_to_bootrom(void)
-{
-       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-}
-
-__weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {};
-
-const char *board_spl_was_booted_from(void)
-{
-       u32  bootdevice_brom_id = readl(BROM_BOOTSOURCE_ID_ADDR);
-       const char *bootdevice_ofpath = NULL;
-
-       if (bootdevice_brom_id < ARRAY_SIZE(boot_devices))
-               bootdevice_ofpath = boot_devices[bootdevice_brom_id];
-
-       if (bootdevice_ofpath)
-               debug("%s: brom_bootdevice_id %x maps to '%s'\n",
-                     __func__, bootdevice_brom_id, bootdevice_ofpath);
-       else
-               debug("%s: failed to resolve brom_bootdevice_id %x\n",
-                     __func__, bootdevice_brom_id);
-
-       return bootdevice_ofpath;
-}
-
-u32 spl_boot_device(void)
-{
-       u32 boot_device = BOOT_DEVICE_MMC1;
-
-       if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM))
-               return BOOT_DEVICE_BOOTROM;
-
-       return boot_device;
-}
-
-__weak void rockchip_stimer_init(void)
-{
-}
-
-__weak int board_early_init_f(void)
-{
-       return 0;
-}
-
-__weak int arch_cpu_init(void)
-{
-       return 0;
-}
-
-void board_init_f(ulong dummy)
-{
-       struct udevice *dev;
-       int ret;
-
-#ifdef CONFIG_DEBUG_UART
-       debug_uart_init();
-
-       /*
-        * Debug UART can be used from here if required:
-        *
-        * debug_uart_init();
-        * printch('a');
-        * printhex8(0x1234);
-        * printascii("string");
-        */
-       debug("U-Boot SPL board init\n");
-#endif
-
-       board_early_init_f();
-       arch_cpu_init();
-
-       ret = spl_early_init();
-       if (ret) {
-               debug("spl_early_init() failed: %d\n", ret);
-               hang();
-       }
-
-       rockchip_stimer_init();
-
-       ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-       if (ret) {
-               pr_err("DRAM init failed: %d\n", ret);
-               return;
-       }
-
-       preloader_console_init();
-}
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int board_fit_config_name_match(const char *name)
-{
-       /* Just empty function now - can't decide what to choose */
-       debug("%s: %s\n", __func__, name);
-
-       return 0;
-}
-#endif