blob: a4df9ab19afa20342fb047a3ad555631d7226f5e [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>
11
Nariman Poushinc703f902018-03-07 10:29:57 +000012#include <arm_def.h>
Nariman Poushinc703f902018-03-07 10:29:57 +000013#include <plat_arm.h>
Nariman Poushinc703f902018-03-07 10:29:57 +000014#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
22const 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
36const 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 Diaz8f32c252018-12-14 01:27:19 +000044#ifdef SPD_tspd
Nariman Poushinc703f902018-03-07 10:29:57 +000045 ARM_MAP_TSP_SEC_MEM,
Antonio Nino Diaz8f32c252018-12-14 01:27:19 +000046#endif
Nariman Poushinc703f902018-03-07 10:29:57 +000047#ifdef SPD_opteed
48 ARM_OPTEE_PAGEABLE_LOAD_MEM,
49#endif
Antonio Nino Diaz9b759862018-09-25 11:38:18 +010050#if TRUSTED_BOARD_BOOT && !BL2_AT_EL3
John Tsichritzisc19949a2018-08-22 12:55:41 +010051 ARM_MAP_BL1_RW,
52#endif
Nariman Poushinc703f902018-03-07 10:29:57 +000053 {0}
54};
55#endif
56#if IMAGE_BL2U
57const 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
66const 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
76const 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
85ARM_CASSERT_MMAP
86
87const mmap_region_t *plat_arm_get_mmap(void)
88{
89 return plat_arm_mmap;
90}