Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Jon Mason | 274bced | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 Broadcom Ltd. |
Jon Mason | 274bced | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 4 | */ |
| 5 | #include <common.h> |
| 6 | #include <asm/system.h> |
| 7 | #include <asm/armv8/mmu.h> |
| 8 | |
| 9 | static 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 | |
| 29 | struct mm_region *mem_map = ns2_mem_map; |
| 30 | |
| 31 | DECLARE_GLOBAL_DATA_PTR; |
| 32 | |
| 33 | int board_init(void) |
| 34 | { |
| 35 | return 0; |
| 36 | } |
| 37 | |
| 38 | int 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 Glass | 76b00ac | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 45 | int dram_init_banksize(void) |
Jon Mason | 274bced | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 46 | { |
| 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 Glass | 76b00ac | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 52 | |
| 53 | return 0; |
Jon Mason | 274bced | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | void reset_cpu(ulong addr) |
| 57 | { |
| 58 | psci_system_reset(); |
| 59 | } |