Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 2 | /* |
3 | * (C) Copyright 2017 Rockchip Electronics Co., Ltd | ||||
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 4 | */ |
5 | |||||
6 | #include <common.h> | ||||
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 7 | #include <dm.h> |
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 8 | #include <spl.h> |
9 | #include <asm/io.h> | ||||
Kever Yang | 9fbe17c | 2019-03-28 11:01:23 +0800 | [diff] [blame] | 10 | #include <asm/arch-rockchip/hardware.h> |
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 11 | |
12 | u32 spl_boot_device(void) | ||||
13 | { | ||||
14 | return BOOT_DEVICE_MMC1; | ||||
15 | } | ||||
Kever Yang | a65d5fa | 2017-07-27 12:53:59 +0800 | [diff] [blame] | 16 | |
Kever Yang | aff40c6 | 2019-04-02 20:41:24 +0800 | [diff] [blame] | 17 | u32 spl_boot_mode(const u32 boot_device) |
18 | { | ||||
19 | return MMCSD_MODE_RAW; | ||||
20 | } | ||||
21 | |||||
Kever Yang | a65d5fa | 2017-07-27 12:53:59 +0800 | [diff] [blame] | 22 | #define SGRF_DDR_CON0 0x10150000 |
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 23 | void board_init_f(ulong dummy) |
24 | { | ||||
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 25 | int ret; |
26 | |||||
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 27 | ret = spl_early_init(); |
28 | if (ret) { | ||||
Kever Yang | aff40c6 | 2019-04-02 20:41:24 +0800 | [diff] [blame] | 29 | printf("spl_early_init() failed: %d\n", ret); |
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 30 | hang(); |
31 | } | ||||
Kever Yang | aff40c6 | 2019-04-02 20:41:24 +0800 | [diff] [blame] | 32 | preloader_console_init(); |
Kever Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 33 | |
Kever Yang | a65d5fa | 2017-07-27 12:53:59 +0800 | [diff] [blame] | 34 | /* Disable the ddr secure region setting to make it non-secure */ |
35 | rk_clrreg(SGRF_DDR_CON0, 0x4000); | ||||
Kever Yang | aff40c6 | 2019-04-02 20:41:24 +0800 | [diff] [blame] | 36 | } |
37 | |||||
38 | #ifdef CONFIG_SPL_LOAD_FIT | ||||
39 | int 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 Yang | 57d4dbf | 2017-06-23 17:17:52 +0800 | [diff] [blame] | 45 | } |
Kever Yang | aff40c6 | 2019-04-02 20:41:24 +0800 | [diff] [blame] | 46 | #endif |