Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 7 | #include <platform_def.h> |
| 8 | |
| 9 | #include <common/bl_common.h> |
| 10 | #include <common/debug.h> |
| 11 | |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 12 | #include <arm_def.h> |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 13 | #include <plat_arm.h> |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 14 | #include <sgm_variant.h> |
| 15 | |
| 16 | /* |
| 17 | * Table of regions for different BL stages to map using the MMU. |
| 18 | * This doesn't include Trusted RAM as the 'mem_layout' argument passed to |
| 19 | * arm_configure_mmu_elx() will give the available subset of that. |
| 20 | */ |
| 21 | #if IMAGE_BL1 |
| 22 | const mmap_region_t plat_arm_mmap[] = { |
| 23 | ARM_MAP_SHARED_RAM, |
| 24 | V2M_MAP_FLASH0_RO, |
| 25 | V2M_MAP_IOFPGA, |
| 26 | CSS_MAP_DEVICE, |
| 27 | CSS_MAP_GIC_DEVICE, |
| 28 | SOC_CSS_MAP_DEVICE, |
| 29 | #if TRUSTED_BOARD_BOOT |
| 30 | ARM_MAP_NS_DRAM1, |
| 31 | #endif |
| 32 | {0} |
| 33 | }; |
| 34 | #endif |
| 35 | #if IMAGE_BL2 |
| 36 | const mmap_region_t plat_arm_mmap[] = { |
| 37 | ARM_MAP_SHARED_RAM, |
| 38 | V2M_MAP_FLASH0_RO, |
| 39 | V2M_MAP_IOFPGA, |
| 40 | CSS_MAP_DEVICE, |
| 41 | CSS_MAP_GIC_DEVICE, |
| 42 | SOC_CSS_MAP_DEVICE, |
| 43 | ARM_MAP_NS_DRAM1, |
Antonio Nino Diaz | 8f32c25 | 2018-12-14 01:27:19 +0000 | [diff] [blame] | 44 | #ifdef SPD_tspd |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 45 | ARM_MAP_TSP_SEC_MEM, |
Antonio Nino Diaz | 8f32c25 | 2018-12-14 01:27:19 +0000 | [diff] [blame] | 46 | #endif |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 47 | #ifdef SPD_opteed |
| 48 | ARM_OPTEE_PAGEABLE_LOAD_MEM, |
| 49 | #endif |
Antonio Nino Diaz | 9b75986 | 2018-09-25 11:38:18 +0100 | [diff] [blame] | 50 | #if TRUSTED_BOARD_BOOT && !BL2_AT_EL3 |
John Tsichritzis | c19949a | 2018-08-22 12:55:41 +0100 | [diff] [blame] | 51 | ARM_MAP_BL1_RW, |
| 52 | #endif |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 53 | {0} |
| 54 | }; |
| 55 | #endif |
| 56 | #if IMAGE_BL2U |
| 57 | const mmap_region_t plat_arm_mmap[] = { |
| 58 | ARM_MAP_SHARED_RAM, |
| 59 | CSS_MAP_DEVICE, |
| 60 | CSS_MAP_GIC_DEVICE, |
| 61 | SOC_CSS_MAP_DEVICE, |
| 62 | {0} |
| 63 | }; |
| 64 | #endif |
| 65 | #if IMAGE_BL31 |
| 66 | const mmap_region_t plat_arm_mmap[] = { |
| 67 | ARM_MAP_SHARED_RAM, |
| 68 | V2M_MAP_IOFPGA, |
| 69 | CSS_MAP_DEVICE, |
| 70 | CSS_MAP_GIC_DEVICE, |
| 71 | SOC_CSS_MAP_DEVICE, |
| 72 | {0} |
| 73 | }; |
| 74 | #endif |
| 75 | #if IMAGE_BL32 |
| 76 | const mmap_region_t plat_arm_mmap[] = { |
| 77 | V2M_MAP_IOFPGA, |
| 78 | CSS_MAP_DEVICE, |
| 79 | CSS_MAP_GIC_DEVICE, |
| 80 | SOC_CSS_MAP_DEVICE, |
| 81 | {0} |
| 82 | }; |
| 83 | #endif |
| 84 | |
| 85 | ARM_CASSERT_MMAP |
| 86 | |
| 87 | const mmap_region_t *plat_arm_get_mmap(void) |
| 88 | { |
| 89 | return plat_arm_mmap; |
| 90 | } |