2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2017-06-23 09:17:52 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2017 Rockchip Electronics Co., Ltd
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <dm.h>
|
|
|
|
#include <spl.h>
|
|
|
|
#include <asm/io.h>
|
2019-03-28 03:01:23 +00:00
|
|
|
#include <asm/arch-rockchip/hardware.h>
|
2017-06-23 09:17:52 +00:00
|
|
|
|
|
|
|
u32 spl_boot_device(void)
|
|
|
|
{
|
|
|
|
return BOOT_DEVICE_MMC1;
|
|
|
|
}
|
2017-07-27 04:53:59 +00:00
|
|
|
|
2019-04-02 12:41:24 +00:00
|
|
|
u32 spl_boot_mode(const u32 boot_device)
|
|
|
|
{
|
|
|
|
return MMCSD_MODE_RAW;
|
|
|
|
}
|
|
|
|
|
2017-07-27 04:53:59 +00:00
|
|
|
#define SGRF_DDR_CON0 0x10150000
|
2017-06-23 09:17:52 +00:00
|
|
|
void board_init_f(ulong dummy)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = spl_early_init();
|
|
|
|
if (ret) {
|
2019-04-02 12:41:24 +00:00
|
|
|
printf("spl_early_init() failed: %d\n", ret);
|
2017-06-23 09:17:52 +00:00
|
|
|
hang();
|
|
|
|
}
|
2019-04-02 12:41:24 +00:00
|
|
|
preloader_console_init();
|
2017-06-23 09:17:52 +00:00
|
|
|
|
2017-07-27 04:53:59 +00:00
|
|
|
/* Disable the ddr secure region setting to make it non-secure */
|
|
|
|
rk_clrreg(SGRF_DDR_CON0, 0x4000);
|
2017-06-23 09:17:52 +00:00
|
|
|
}
|
2019-04-02 12:41:24 +00:00
|
|
|
|
|
|
|
#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
|