rockchip: rk3399: Migrate to use common spl board file
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>
This commit is contained in:
parent
faa98c7c5a
commit
b7abef2ecb
@ -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
|
||||
|
@ -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),)
|
||||
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user