4 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/gxbb.h>
11 #include <asm/armv8/mmu.h>
12 #include <asm/unaligned.h>
14 DECLARE_GLOBAL_DATA_PTR;
22 offset = fdt_path_offset(gd->fdt_blob, "/memory");
26 val = fdt_getprop(gd->fdt_blob, offset, "reg", &len);
27 if (len < sizeof(*val) * 2)
30 /* Use unaligned access since cache is still disabled */
31 gd->ram_size = get_unaligned_be64(&val[1]);
36 void dram_init_banksize(void)
38 /* Reserve first 16 MiB of RAM for firmware */
39 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE + (16 * 1024 * 1024);
40 gd->bd->bi_dram[0].size = gd->ram_size - (16 * 1024 * 1024);
43 void reset_cpu(ulong addr)
45 psci_system_reset(true);
48 static struct mm_region gxbb_mem_map[] = {
52 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
57 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
59 PTE_BLOCK_PXN | PTE_BLOCK_UXN
66 struct mm_region *mem_map = gxbb_mem_map;