Unverified Commit 2f1fbb4f authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by GitHub
Browse files

Merge pull request #1380 from CJKay/mmap-fix

Fix incorrect number of reserved memory map entries for Arm platforms
parents ede13422 053b4f92
...@@ -245,10 +245,16 @@ ...@@ -245,10 +245,16 @@
* The number of regions like RO(code), coherent and data required by * The number of regions like RO(code), coherent and data required by
* different BL stages which need to be mapped in the MMU. * different BL stages which need to be mapped in the MMU.
*/ */
#if USE_COHERENT_MEM #if ENABLE_SPM && defined(IMAGE_BL31)
#define ARM_BL_REGIONS 3 # 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 #else
#define ARM_BL_REGIONS 2 # define ARM_BL_REGIONS 3
#endif #endif
#define MAX_MMAP_REGIONS (PLAT_ARM_MMAP_ENTRIES + \ #define MAX_MMAP_REGIONS (PLAT_ARM_MMAP_ENTRIES + \
......
...@@ -60,7 +60,9 @@ typedef struct arm_tzc_regions_info { ...@@ -60,7 +60,9 @@ typedef struct arm_tzc_regions_info {
#endif #endif
#define ARM_CASSERT_MMAP \ #define ARM_CASSERT_MMAP \
CASSERT((ARRAY_SIZE(plat_arm_mmap) + ARM_BL_REGIONS) \ 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, \ <= MAX_MMAP_REGIONS, \
assert_max_mmap_regions); assert_max_mmap_regions);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment