aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2018-05-15 18:40:19 +0100
committerGitHub <noreply@github.com>2018-05-15 18:40:19 +0100
commit2f1fbb4f66a351bd5994f883f01e40cd144f48cf (patch)
treed5235943f52b1966ac9abc6116c4ca68cca69e45
parentede13422f7b6e1664b4791c4c773e96b94b98c78 (diff)
parent053b4f92cbfa627418441daf5f9b1b89739c2fd1 (diff)
downloadplatform_external_arm-trusted-firmware-2f1fbb4f66a351bd5994f883f01e40cd144f48cf.tar.gz
platform_external_arm-trusted-firmware-2f1fbb4f66a351bd5994f883f01e40cd144f48cf.tar.bz2
platform_external_arm-trusted-firmware-2f1fbb4f66a351bd5994f883f01e40cd144f48cf.zip
Merge pull request #1380 from CJKay/mmap-fix
Fix incorrect number of reserved memory map entries for Arm platforms
-rw-r--r--include/plat/arm/common/arm_def.h12
-rw-r--r--include/plat/arm/common/plat_arm.h8
2 files changed, 14 insertions, 6 deletions
diff --git a/include/plat/arm/common/arm_def.h b/include/plat/arm/common/arm_def.h
index d10afaeb7..4473b5355 100644
--- a/include/plat/arm/common/arm_def.h
+++ b/include/plat/arm/common/arm_def.h
@@ -245,10 +245,16 @@
* The number of regions like RO(code), coherent and data required by
* different BL stages which need to be mapped in the MMU.
*/
-#if USE_COHERENT_MEM
-#define ARM_BL_REGIONS 3
+#if ENABLE_SPM && defined(IMAGE_BL31)
+# if USE_COHERENT_MEM
+# define ARM_BL_REGIONS 5
+# else
+# define ARM_BL_REGIONS 4
+# endif
+#elif USE_COHERENT_MEM
+# define ARM_BL_REGIONS 4
#else
-#define ARM_BL_REGIONS 2
+# define ARM_BL_REGIONS 3
#endif
#define MAX_MMAP_REGIONS (PLAT_ARM_MMAP_ENTRIES + \
diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h
index 612a63a8c..fc3f4ec3a 100644
--- a/include/plat/arm/common/plat_arm.h
+++ b/include/plat/arm/common/plat_arm.h
@@ -59,9 +59,11 @@ typedef struct arm_tzc_regions_info {
PLAT_ARM_TZC_NS_DEV_ACCESS}
#endif
-#define ARM_CASSERT_MMAP \
- CASSERT((ARRAY_SIZE(plat_arm_mmap) + ARM_BL_REGIONS) \
- <= MAX_MMAP_REGIONS, \
+#define ARM_CASSERT_MMAP \
+ CASSERT((ARRAY_SIZE(plat_arm_mmap) - 1) <= PLAT_ARM_MMAP_ENTRIES, \
+ assert_plat_arm_mmap_mismatch); \
+ CASSERT((PLAT_ARM_MMAP_ENTRIES + ARM_BL_REGIONS) \
+ <= MAX_MMAP_REGIONS, \
assert_max_mmap_regions);
/*