Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Jon Mason | d59b586 | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 Broadcom Ltd. |
Jon Mason | d59b586 | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 4 | */ |
| 5 | #include <common.h> |
Simon Glass | afb0215 | 2019-12-28 10:45:01 -0700 | [diff] [blame] | 6 | #include <cpu_func.h> |
Simon Glass | 8e16b1e | 2019-12-28 10:45:05 -0700 | [diff] [blame] | 7 | #include <init.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 8 | #include <asm/cache.h> |
Jon Mason | d59b586 | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 9 | #include <asm/system.h> |
| 10 | #include <asm/armv8/mmu.h> |
| 11 | |
| 12 | static struct mm_region ns2_mem_map[] = { |
| 13 | { |
| 14 | .virt = 0x0UL, |
| 15 | .phys = 0x0UL, |
| 16 | .size = 0x80000000UL, |
| 17 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| 18 | PTE_BLOCK_NON_SHARE | |
| 19 | PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| 20 | }, { |
| 21 | .virt = 0x80000000UL, |
| 22 | .phys = 0x80000000UL, |
| 23 | .size = 0xff80000000UL, |
| 24 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | |
| 25 | PTE_BLOCK_INNER_SHARE |
| 26 | }, { |
| 27 | /* List terminator */ |
| 28 | 0, |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | struct mm_region *mem_map = ns2_mem_map; |
| 33 | |
| 34 | DECLARE_GLOBAL_DATA_PTR; |
| 35 | |
| 36 | int board_init(void) |
| 37 | { |
| 38 | return 0; |
| 39 | } |
| 40 | |
| 41 | int dram_init(void) |
| 42 | { |
| 43 | gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, |
| 44 | PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE); |
| 45 | return 0; |
| 46 | } |
| 47 | |
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 48 | int dram_init_banksize(void) |
Jon Mason | d59b586 | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 49 | { |
| 50 | gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; |
| 51 | gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; |
| 52 | |
| 53 | gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE + PHYS_SDRAM_1_SIZE; |
| 54 | gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; |
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 55 | |
| 56 | return 0; |
Jon Mason | d59b586 | 2017-03-17 12:12:14 -0400 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | void reset_cpu(ulong addr) |
| 60 | { |
| 61 | psci_system_reset(); |
| 62 | } |