aboutsummaryrefslogtreecommitdiffstats
path: root/include/lib/utils.h
diff options
context:
space:
mode:
authorRoberto Vargas <roberto.vargas@arm.com>2018-01-05 16:00:05 +0000
committerRoberto Vargas <roberto.vargas@arm.com>2018-05-01 15:25:25 +0100
commit638b034cc34ecdc54b9c790d5192229a027c8156 (patch)
treefc634c377f4eae6f510fe43e558a273358672d9f /include/lib/utils.h
parenta8d9550b527107b85703d7b4e93073e653ae95f7 (diff)
downloadplatform_external_arm-trusted-firmware-638b034cc34ecdc54b9c790d5192229a027c8156.tar.gz
platform_external_arm-trusted-firmware-638b034cc34ecdc54b9c790d5192229a027c8156.tar.bz2
platform_external_arm-trusted-firmware-638b034cc34ecdc54b9c790d5192229a027c8156.zip
ARM platforms: Demonstrate mem_protect from el3_runtime
Previously mem_protect used to be only supported from BL2. This is not helpful in the case when ARM TF-A BL2 is not used. This patch demonstrates mem_protect from el3_runtime firmware on ARM Platforms specifically when RESET_TO_BL31 or RESET_TO_SP_MIN flag is set as BL2 may be absent in these cases. The Non secure DRAM is dynamically mapped into EL3 mmap tables temporarily and then the protected regions are then cleared. This avoids the need to map the non secure DRAM permanently to BL31/sp_min. The stack size is also increased, because DYNAMIC_XLAT_TABLES require a bigger stack. Change-Id: Ia44c594192ed5c5adc596c0cff2c7cc18c001fde Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Diffstat (limited to 'include/lib/utils.h')
-rw-r--r--include/lib/utils.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/lib/utils.h b/include/lib/utils.h
index 3d215c321..f367a1f45 100644
--- a/include/lib/utils.h
+++ b/include/lib/utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -29,6 +29,18 @@ typedef struct mem_region {
*/
void clear_mem_regions(mem_region_t *tbl, size_t nregions);
+/*
+ * zero_normalmem all the regions defined in region. It dynamically
+ * maps chunks of 'chunk_size' in 'va' virtual address and clears them.
+ * For this reason memory regions must be multiple of chunk_size and
+ * must be aligned to it as well. chunk_size and va can be selected
+ * in a way that they minimize the number of entries used in the
+ * translation tables.
+ */
+void clear_map_dyn_mem_regions(mem_region_t *region,
+ size_t nregions,
+ uintptr_t va,
+ size_t chunk_size);
/*
* checks that a region (addr + nbytes-1) of memory is totally covered by