summaryrefslogtreecommitdiff
path: root/plat/common
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-05-14 15:45:31 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-06-12 14:08:48 +0100
commitf13cb561f06f492bdccd1a5c8397e5ff6aba3c85 (patch)
tree58a43631680f43801fb213ef207bafa81ca25b09 /plat/common
parent42be6fc57e4f543a6a5a79f3a3d13192fb346fe2 (diff)
LOAD_IMAGE_V1: Align BL2 memory layout struct to 8 bytes
In LOAD_IMAGE_V1 (i.e when LOAD_IMAGE_V2=0) the bl2_tzram_layout is, by default, assigned to the bl1_tzram_layout->free_base which is dynamically calculated based on the images loaded in memory. There is a chance that the bl2_tzram_layout will be assigned a value not aligned to 8 bytes. This patch rounds up the free_base value for the required alignment. This doesn't happen in LOAD_IMAGE_V2 because the bl2_tzram_layout is assigned by default to the bl1_tzram_layout->total_base, which is aligned. Change-Id: Idc583e7dad993d02ac6791797406118c96f83fa1 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'plat/common')
-rw-r--r--plat/common/plat_bl1_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plat/common/plat_bl1_common.c b/plat/common/plat_bl1_common.c
index 4b1f2334..c5bbe743 100644
--- a/plat/common/plat_bl1_common.c
+++ b/plat/common/plat_bl1_common.c
@@ -107,7 +107,8 @@ int bl1_plat_handle_post_image_load(unsigned int image_id)
#if LOAD_IMAGE_V2
bl2_tzram_layout = (meminfo_t *) bl1_tzram_layout->total_base;
#else
- bl2_tzram_layout = (meminfo_t *) bl1_tzram_layout->free_base;
+ bl2_tzram_layout = (meminfo_t *) round_up(bl1_tzram_layout->free_base,
+ sizeof(uint64_t));
#endif /* LOAD_IMAGE_V2 */
#if !ERROR_DEPRECATED