Merge tag 'rockchip-for-v2019.07-rc5-2' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / mach-rockchip / rk322x-board-spl.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2017 Rockchip Electronics Co., Ltd
4  */
5
6 #include <common.h>
7 #include <dm.h>
8 #include <spl.h>
9 #include <asm/io.h>
10 #include <asm/arch-rockchip/hardware.h>
11
12 u32 spl_boot_device(void)
13 {
14         return BOOT_DEVICE_MMC1;
15 }
16
17 u32 spl_boot_mode(const u32 boot_device)
18 {
19         return MMCSD_MODE_RAW;
20 }
21
22 #define SGRF_DDR_CON0 0x10150000
23 void board_init_f(ulong dummy)
24 {
25         int ret;
26
27         ret = spl_early_init();
28         if (ret) {
29                 printf("spl_early_init() failed: %d\n", ret);
30                 hang();
31         }
32         preloader_console_init();
33
34         /* Disable the ddr secure region setting to make it non-secure */
35         rk_clrreg(SGRF_DDR_CON0, 0x4000);
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;
45 }
46 #endif