blob: c9b41c62c0853949edfd63020429396ae470b629 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Kever Yang57d4dbf2017-06-23 17:17:52 +08002/*
3 * (C) Copyright 2017 Rockchip Electronics Co., Ltd
Kever Yang57d4dbf2017-06-23 17:17:52 +08004 */
5
6#include <common.h>
Kever Yang57d4dbf2017-06-23 17:17:52 +08007#include <dm.h>
Kever Yang57d4dbf2017-06-23 17:17:52 +08008#include <spl.h>
9#include <asm/io.h>
Kever Yang9fbe17c2019-03-28 11:01:23 +080010#include <asm/arch-rockchip/hardware.h>
Kever Yang57d4dbf2017-06-23 17:17:52 +080011
12u32 spl_boot_device(void)
13{
14 return BOOT_DEVICE_MMC1;
15}
Kever Yanga65d5fa2017-07-27 12:53:59 +080016
Kever Yangaff40c62019-04-02 20:41:24 +080017u32 spl_boot_mode(const u32 boot_device)
18{
19 return MMCSD_MODE_RAW;
20}
21
Kever Yanga65d5fa2017-07-27 12:53:59 +080022#define SGRF_DDR_CON0 0x10150000
Kever Yang57d4dbf2017-06-23 17:17:52 +080023void board_init_f(ulong dummy)
24{
Kever Yang57d4dbf2017-06-23 17:17:52 +080025 int ret;
26
Kever Yang57d4dbf2017-06-23 17:17:52 +080027 ret = spl_early_init();
28 if (ret) {
Kever Yangaff40c62019-04-02 20:41:24 +080029 printf("spl_early_init() failed: %d\n", ret);
Kever Yang57d4dbf2017-06-23 17:17:52 +080030 hang();
31 }
Kever Yangaff40c62019-04-02 20:41:24 +080032 preloader_console_init();
Kever Yang57d4dbf2017-06-23 17:17:52 +080033
Kever Yanga65d5fa2017-07-27 12:53:59 +080034 /* Disable the ddr secure region setting to make it non-secure */
35 rk_clrreg(SGRF_DDR_CON0, 0x4000);
Kever Yangaff40c62019-04-02 20:41:24 +080036}
37
38#ifdef CONFIG_SPL_LOAD_FIT
39int board_fit_config_name_match(const char *name)
40{
41 /* Just empty function now - can't decide what to choose */
42 debug("%s: %s\n", __func__, name);
43
44 return 0;
Kever Yang57d4dbf2017-06-23 17:17:52 +080045}
Kever Yangaff40c62019-04-02 20:41:24 +080046#endif