blob: 222a8d36d38de7aaf94e91827eac14d40b57332c [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Kever Yangec02b3c2017-02-23 15:37:51 +08002/*
3 * Copyright (c) 2016 Rockchip Electronics Co., Ltd
Kever Yangec02b3c2017-02-23 15:37:51 +08004 */
5
6#include <common.h>
Kever Yangb04029e2019-07-22 19:59:33 +08007#include <asm/arch-rockchip/bootrom.h>
Kever Yang9fbe17c2019-03-28 11:01:23 +08008#include <asm/arch-rockchip/hardware.h>
Kever Yangec02b3c2017-02-23 15:37:51 +08009#include <asm/armv8/mmu.h>
10#include <asm/io.h>
11
Kever Yangc2053262017-06-23 16:11:11 +080012DECLARE_GLOBAL_DATA_PTR;
13
Kever Yangb04029e2019-07-22 19:59:33 +080014const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
15 [BROM_BOOTSOURCE_EMMC] = "rksdmmc@ff520000",
16 [BROM_BOOTSOURCE_SD] = "rksdmmc@ff500000",
17};
18
Kever Yangec02b3c2017-02-23 15:37:51 +080019static struct mm_region rk3328_mem_map[] = {
20 {
21 .virt = 0x0UL,
22 .phys = 0x0UL,
Kever Yang6cd0cab2017-06-13 21:00:12 +080023 .size = 0xff000000UL,
Kever Yangec02b3c2017-02-23 15:37:51 +080024 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
25 PTE_BLOCK_INNER_SHARE
26 }, {
Kever Yang6cd0cab2017-06-13 21:00:12 +080027 .virt = 0xff000000UL,
28 .phys = 0xff000000UL,
29 .size = 0x1000000UL,
Kever Yangec02b3c2017-02-23 15:37:51 +080030 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
31 PTE_BLOCK_NON_SHARE |
32 PTE_BLOCK_PXN | PTE_BLOCK_UXN
33 }, {
34 /* List terminator */
35 0,
36 }
37};
38
39struct mm_region *mem_map = rk3328_mem_map;
40
Kever Yangc2053262017-06-23 16:11:11 +080041int dram_init_banksize(void)
42{
43 size_t max_size = min((unsigned long)gd->ram_size, gd->ram_top);
44
45 /* Reserve 0x200000 for ATF bl31 */
46 gd->bd->bi_dram[0].start = 0x200000;
47 gd->bd->bi_dram[0].size = max_size - gd->bd->bi_dram[0].start;
48
49 return 0;
50}
51
Kever Yangec02b3c2017-02-23 15:37:51 +080052int arch_cpu_init(void)
53{
54 /* We do some SoC one time setting here. */
55
56 return 0;
57}