blob: 1068edca59cb000539197a3a69a2a9c740ae6ad2 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jon Mason274bced2017-03-17 12:12:14 -04002/*
3 * (C) Copyright 2016 Broadcom Ltd.
Jon Mason274bced2017-03-17 12:12:14 -04004 */
5#include <common.h>
6#include <asm/system.h>
7#include <asm/armv8/mmu.h>
8
9static struct mm_region ns2_mem_map[] = {
10 {
11 .virt = 0x0UL,
12 .phys = 0x0UL,
13 .size = 0x80000000UL,
14 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
15 PTE_BLOCK_NON_SHARE |
16 PTE_BLOCK_PXN | PTE_BLOCK_UXN
17 }, {
18 .virt = 0x80000000UL,
19 .phys = 0x80000000UL,
20 .size = 0xff80000000UL,
21 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
22 PTE_BLOCK_INNER_SHARE
23 }, {
24 /* List terminator */
25 0,
26 }
27};
28
29struct mm_region *mem_map = ns2_mem_map;
30
31DECLARE_GLOBAL_DATA_PTR;
32
33int board_init(void)
34{
35 return 0;
36}
37
38int dram_init(void)
39{
40 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
41 PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE);
42 return 0;
43}
44
Simon Glass76b00ac2017-03-31 08:40:32 -060045int dram_init_banksize(void)
Jon Mason274bced2017-03-17 12:12:14 -040046{
47 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
48 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
49
50 gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE + PHYS_SDRAM_1_SIZE;
51 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
Simon Glass76b00ac2017-03-31 08:40:32 -060052
53 return 0;
Jon Mason274bced2017-03-17 12:12:14 -040054}
55
56void reset_cpu(ulong addr)
57{
58 psci_system_reset();
59}