blob: 494e457ff65b7971532c78939b370eaeb8e5bc4e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jon Masond59b5862017-03-17 12:12:14 -04002/*
3 * (C) Copyright 2016 Broadcom Ltd.
Jon Masond59b5862017-03-17 12:12:14 -04004 */
5#include <common.h>
Simon Glassafb02152019-12-28 10:45:01 -07006#include <cpu_func.h>
Simon Glass8e16b1e2019-12-28 10:45:05 -07007#include <init.h>
Simon Glass274e0b02020-05-10 11:39:56 -06008#include <asm/cache.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06009#include <asm/global_data.h>
Jon Masond59b5862017-03-17 12:12:14 -040010#include <asm/system.h>
11#include <asm/armv8/mmu.h>
12
13static struct mm_region ns2_mem_map[] = {
14 {
15 .virt = 0x0UL,
16 .phys = 0x0UL,
17 .size = 0x80000000UL,
18 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
19 PTE_BLOCK_NON_SHARE |
20 PTE_BLOCK_PXN | PTE_BLOCK_UXN
21 }, {
22 .virt = 0x80000000UL,
23 .phys = 0x80000000UL,
24 .size = 0xff80000000UL,
25 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
26 PTE_BLOCK_INNER_SHARE
27 }, {
28 /* List terminator */
29 0,
30 }
31};
32
33struct mm_region *mem_map = ns2_mem_map;
34
35DECLARE_GLOBAL_DATA_PTR;
36
37int board_init(void)
38{
39 return 0;
40}
41
42int dram_init(void)
43{
44 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
45 PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE);
46 return 0;
47}
48
Simon Glass2f949c32017-03-31 08:40:32 -060049int dram_init_banksize(void)
Jon Masond59b5862017-03-17 12:12:14 -040050{
51 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
52 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
53
54 gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE + PHYS_SDRAM_1_SIZE;
55 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
Simon Glass2f949c32017-03-31 08:40:32 -060056
57 return 0;
Jon Masond59b5862017-03-17 12:12:14 -040058}
59
60void reset_cpu(ulong addr)
61{
62 psci_system_reset();
63}