1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Rockchip Electronics Co., Ltd
7 #include <asm/armv8/mmu.h>
9 #include <asm/arch/hardware.h>
11 DECLARE_GLOBAL_DATA_PTR;
13 #define GRF_EMMCCORE_CON11 0xff77f02c
15 static struct mm_region rk3399_mem_map[] = {
20 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
26 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
28 PTE_BLOCK_PXN | PTE_BLOCK_UXN
35 struct mm_region *mem_map = rk3399_mem_map;
37 int dram_init_banksize(void)
39 size_t max_size = min((unsigned long)gd->ram_size, gd->ram_top);
41 /* Reserve 0x200000 for ATF bl31 */
42 gd->bd->bi_dram[0].start = 0x200000;
43 gd->bd->bi_dram[0].size = max_size - gd->bd->bi_dram[0].start;
48 int arch_cpu_init(void)
50 /* We do some SoC one time setting here. */
52 /* Emmc clock generator: disable the clock multipilier */
53 rk_clrreg(GRF_EMMCCORE_CON11, 0x0ff);