ARM platforms: Map TSP only when TSPD is included
authorSandrine Bailleux <sandrine.bailleux@arm.com>
Wed, 30 Aug 2017 09:59:22 +0000 (10:59 +0100)
committerSandrine Bailleux <sandrine.bailleux@arm.com>
Thu, 31 Aug 2017 15:18:00 +0000 (16:18 +0100)
This patch ensures that the ARM_MAP_TSP_SEC_MEM memory region is mapped
in BL2 only if the TSPD has been included in the build. This saves one
entry in the plat_arm_mmap[] array and avoids to map extra memory when
it's not needed.

Change-Id: I6ae60822ff8f0de198145925b0b0d45355179a94
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@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 106cd747fa2f7b5e57d83bf17e895a574d76e68d..d44e27837d349f907577281ddef449f7f4d7526a 100644 (file)
                                                ARM_NS_DRAM1_SIZE,      \
                                                MT_MEMORY | MT_RW | MT_NS)
 
+#ifdef SPD_tspd
 #define ARM_MAP_TSP_SEC_MEM            MAP_REGION_FLAT(                \
                                                TSP_SEC_MEM_BASE,       \
                                                TSP_SEC_MEM_SIZE,       \
                                                MT_MEMORY | MT_RW | MT_SECURE)
+#endif
 
 #if ARM_BL31_IN_DRAM
 #define ARM_MAP_BL31_SEC_DRAM          MAP_REGION_FLAT(                \
index 139a3af84231c93b33d56b74612322dadeab0190..2495e28fee8bdb133e14841a5f05ee3239ec8ee0 100644 (file)
@@ -33,7 +33,9 @@ const mmap_region_t plat_arm_mmap[] = {
        CSS_MAP_DEVICE,
        SOC_CSS_MAP_DEVICE,
        ARM_MAP_NS_DRAM1,
+#ifdef SPD_tspd
        ARM_MAP_TSP_SEC_MEM,
+#endif
 #ifdef SPD_opteed
        ARM_OPTEE_PAGEABLE_LOAD_MEM,
 #endif
index d97a04920d85e5951857d383adedff09ff84313b..e232745733a23461e95c2d90f52b8ccb427ce522 100644 (file)
@@ -79,7 +79,9 @@ const mmap_region_t plat_arm_mmap[] = {
        MAP_DEVICE0,
        MAP_DEVICE1,
        ARM_MAP_NS_DRAM1,
+#ifdef SPD_tspd
        ARM_MAP_TSP_SEC_MEM,
+#endif
 #if TRUSTED_BOARD_BOOT
        /* To access the Root of Trust Public Key registers. */
        MAP_DEVICE2,