summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSathees Balya <sathees.balya@arm.com>2018-11-15 14:22:30 +0000
committerSathees Balya <sathees.balya@arm.com>2019-01-23 16:01:19 +0000
commit5b8d50e40701ebb6a7ba548ccaa96ba879587fb9 (patch)
treea286d0657cb05879b66a6d35ff91ca160c1fc61f /common
parenta0d894397d5729aa72840dc49120f4d198174e22 (diff)
plat/arm: Save BL2 descriptors to reserved memory.
On ARM platforms, the BL2 memory can be overlaid by BL31/BL32. The memory descriptors describing the list of executable images are created in BL2 R/W memory, which could be possibly corrupted later on by BL31/BL32 due to overlay. This patch creates a reserved location in SRAM for these descriptors and are copied over by BL2 before handing over to next BL image. Also this patch increases the PLAT_ARM_MAX_BL2_SIZE for juno when TBBR is enabled. Fixes ARM-Software/tf-issues#626 Change-Id: I755735706fa702024b4032f51ed4895b3687377f Signed-off-by: Sathees Balya <sathees.balya@arm.com>
Diffstat (limited to 'common')
-rw-r--r--common/desc_image_load.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/common/desc_image_load.c b/common/desc_image_load.c
index ada02f8d..405bb834 100644
--- a/common/desc_image_load.c
+++ b/common/desc_image_load.c
@@ -20,11 +20,28 @@ static bl_params_t next_bl_params;
******************************************************************************/
void flush_bl_params_desc(void)
{
- flush_dcache_range((uintptr_t)bl_mem_params_desc_ptr,
- sizeof(*bl_mem_params_desc_ptr) * bl_mem_params_desc_num);
+ flush_bl_params_desc_args(bl_mem_params_desc_ptr,
+ bl_mem_params_desc_num,
+ &next_bl_params);
+}
+
+/*******************************************************************************
+ * This function flushes the data structures specified as arguments so that they
+ * are visible in memory for the next BL image.
+ ******************************************************************************/
+void flush_bl_params_desc_args(bl_mem_params_node_t *mem_params_desc_ptr,
+ unsigned int mem_params_desc_num,
+ bl_params_t *next_bl_params_ptr)
+{
+ assert(mem_params_desc_ptr != NULL);
+ assert(mem_params_desc_num != 0U);
+ assert(next_bl_params_ptr != NULL);
+
+ flush_dcache_range((uintptr_t)mem_params_desc_ptr,
+ sizeof(*mem_params_desc_ptr) * mem_params_desc_num);
- flush_dcache_range((uintptr_t)&next_bl_params,
- sizeof(next_bl_params));
+ flush_dcache_range((uintptr_t)next_bl_params_ptr,
+ sizeof(*next_bl_params_ptr));
}
/*******************************************************************************