blob: e5b4b0338735a0e6e8ad527595c93bf266c58a2f [file] [log] [blame]
Nariman Poushinc703f902018-03-07 10:29:57 +00001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00007#include <platform_def.h>
8
9#include <common/bl_common.h>
10#include <common/debug.h>
Antonio Nino Diazbd7b7402019-01-25 14:30:04 +000011#include <plat/arm/common/plat_arm.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000012
Nariman Poushinc703f902018-03-07 10:29:57 +000013#include <sgm_variant.h>
14
15/*
16 * Table of regions for different BL stages to map using the MMU.
17 * This doesn't include Trusted RAM as the 'mem_layout' argument passed to
18 * arm_configure_mmu_elx() will give the available subset of that.
19 */
20#if IMAGE_BL1
21const mmap_region_t plat_arm_mmap[] = {
22 ARM_MAP_SHARED_RAM,
23 V2M_MAP_FLASH0_RO,
24 V2M_MAP_IOFPGA,
25 CSS_MAP_DEVICE,
26 CSS_MAP_GIC_DEVICE,
27 SOC_CSS_MAP_DEVICE,
28#if TRUSTED_BOARD_BOOT
29 ARM_MAP_NS_DRAM1,
30#endif
31 {0}
32};
33#endif
34#if IMAGE_BL2
35const mmap_region_t plat_arm_mmap[] = {
36 ARM_MAP_SHARED_RAM,
37 V2M_MAP_FLASH0_RO,
38 V2M_MAP_IOFPGA,
39 CSS_MAP_DEVICE,
40 CSS_MAP_GIC_DEVICE,
41 SOC_CSS_MAP_DEVICE,
42 ARM_MAP_NS_DRAM1,
Antonio Nino Diaz8f32c252018-12-14 01:27:19 +000043#ifdef SPD_tspd
Nariman Poushinc703f902018-03-07 10:29:57 +000044 ARM_MAP_TSP_SEC_MEM,
Antonio Nino Diaz8f32c252018-12-14 01:27:19 +000045#endif
Nariman Poushinc703f902018-03-07 10:29:57 +000046#ifdef SPD_opteed
47 ARM_OPTEE_PAGEABLE_LOAD_MEM,
48#endif
Antonio Nino Diaz9b759862018-09-25 11:38:18 +010049#if TRUSTED_BOARD_BOOT && !BL2_AT_EL3
John Tsichritzisc19949a2018-08-22 12:55:41 +010050 ARM_MAP_BL1_RW,
51#endif
Nariman Poushinc703f902018-03-07 10:29:57 +000052 {0}
53};
54#endif
55#if IMAGE_BL2U
56const mmap_region_t plat_arm_mmap[] = {
57 ARM_MAP_SHARED_RAM,
58 CSS_MAP_DEVICE,
59 CSS_MAP_GIC_DEVICE,
60 SOC_CSS_MAP_DEVICE,
61 {0}
62};
63#endif
64#if IMAGE_BL31
65const mmap_region_t plat_arm_mmap[] = {
66 ARM_MAP_SHARED_RAM,
67 V2M_MAP_IOFPGA,
68 CSS_MAP_DEVICE,
69 CSS_MAP_GIC_DEVICE,
70 SOC_CSS_MAP_DEVICE,
71 {0}
72};
73#endif
74#if IMAGE_BL32
75const mmap_region_t plat_arm_mmap[] = {
76 V2M_MAP_IOFPGA,
77 CSS_MAP_DEVICE,
78 CSS_MAP_GIC_DEVICE,
79 SOC_CSS_MAP_DEVICE,
80 {0}
81};
82#endif
83
84ARM_CASSERT_MMAP
85
86const mmap_region_t *plat_arm_get_mmap(void)
87{
88 return plat_arm_mmap;
89}