Fix BL2 memory map when OP-TEE is the Secure Payload
authorSoby Mathew <soby.mathew@arm.com>
Fri, 1 Sep 2017 12:43:50 +0000 (13:43 +0100)
committerSoby Mathew <soby.mathew@arm.com>
Tue, 5 Sep 2017 14:03:16 +0000 (15:03 +0100)
The commit 3eb2d67 optimizes the memory map for BL2 when TSP
is not present. But this also broke OP-TEE as it was reusing
the TSP mapping. This patch fixes this problem by adding a
separate mapping for OP-TEE in the BL2 memory map table.

Change-Id: I130a2ea552b7b62d8478081feb1f4ddf5292a118
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
include/plat/arm/common/arm_def.h
plat/arm/board/common/board_css_common.c
plat/arm/board/fvp/fvp_common.c

index d44e27837d349f907577281ddef449f7f4d7526a..2b0d894e1dee17f16d515985d5db2aa913686fe2 100644 (file)
                                        ARM_OPTEE_PAGEABLE_LOAD_BASE,   \
                                        ARM_OPTEE_PAGEABLE_LOAD_SIZE,   \
                                        MT_MEMORY | MT_RW | MT_SECURE)
+
+/*
+ * Map the memory for the OP-TEE core (also known as OP-TEE pager when paging
+ * support is enabled).
+ */
+#define ARM_MAP_OPTEE_CORE_MEM         MAP_REGION_FLAT(                \
+                                               BL32_BASE,              \
+                                               BL32_LIMIT - BL32_BASE, \
+                                               MT_MEMORY | MT_RW | MT_SECURE)
 #endif /* SPD_opteed */
 
 #define ARM_NS_DRAM1_BASE              ARM_DRAM1_BASE
index 2495e28fee8bdb133e14841a5f05ee3239ec8ee0..68f70a7812baa41b6829f289b5c79ff5f1bbe675 100644 (file)
@@ -37,6 +37,7 @@ const mmap_region_t plat_arm_mmap[] = {
        ARM_MAP_TSP_SEC_MEM,
 #endif
 #ifdef SPD_opteed
+       ARM_MAP_OPTEE_CORE_MEM,
        ARM_OPTEE_PAGEABLE_LOAD_MEM,
 #endif
        {0}
index e232745733a23461e95c2d90f52b8ccb427ce522..e869f5b22e4ffe2beb91e285d28d16bac24df63e 100644 (file)
@@ -90,6 +90,7 @@ const mmap_region_t plat_arm_mmap[] = {
        ARM_MAP_BL31_SEC_DRAM,
 #endif
 #ifdef SPD_opteed
+       ARM_MAP_OPTEE_CORE_MEM,
        ARM_OPTEE_PAGEABLE_LOAD_MEM,
 #endif
        {0}