summaryrefslogtreecommitdiff
path: root/include/plat
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-11-27 08:36:02 +0000
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-12-11 13:45:41 +0000
commit680389a65a004d2af007abccf0a0352f2c0eb529 (patch)
tree84d1f5adf7382cb8899978d7106bd49ee690b7da /include/plat
parent26010da11629f27ddf013ba6127198b33edcd574 (diff)
SPM: Load image and RD from SP package
Load SP and RD from package instead of relying on RD being already loaded in memory and the SP being loaded as a BL32 image. Change-Id: I18d4fbf4597656c6a7e878e1d7c01a8a324f3f8a Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'include/plat')
-rw-r--r--include/plat/arm/common/arm_spm_def.h27
-rw-r--r--include/plat/common/platform.h2
2 files changed, 27 insertions, 2 deletions
diff --git a/include/plat/arm/common/arm_spm_def.h b/include/plat/arm/common/arm_spm_def.h
index 6fa5615e..8d17b90d 100644
--- a/include/plat/arm/common/arm_spm_def.h
+++ b/include/plat/arm/common/arm_spm_def.h
@@ -11,6 +11,31 @@
#include <xlat_tables_defs.h>
/*
+ * Reserve 4 MiB for binaries of Secure Partitions and Resource Description
+ * blobs.
+ */
+#define PLAT_SP_PACKAGE_BASE BL32_BASE
+#define PLAT_SP_PACKAGE_SIZE ULL(0x400000)
+
+#define PLAT_MAP_SP_PACKAGE_MEM_RO MAP_REGION_FLAT( \
+ PLAT_SP_PACKAGE_BASE, \
+ PLAT_SP_PACKAGE_SIZE, \
+ MT_MEMORY | MT_RO | MT_SECURE)
+#define PLAT_MAP_SP_PACKAGE_MEM_RW MAP_REGION_FLAT( \
+ PLAT_SP_PACKAGE_BASE, \
+ PLAT_SP_PACKAGE_SIZE, \
+ MT_MEMORY | MT_RW | MT_SECURE)
+
+/*
+ * The rest of the memory reserved for BL32 is free for SPM to use it as memory
+ * pool to allocate memory regions requested in the resource description.
+ */
+#define PLAT_SPM_HEAP_BASE (PLAT_SP_PACKAGE_BASE + PLAT_SP_PACKAGE_SIZE)
+#define PLAT_SPM_HEAP_SIZE (BL32_LIMIT - BL32_BASE - PLAT_SP_PACKAGE_SIZE)
+
+#if SPM_DEPRECATED
+
+/*
* If BL31 is placed in DRAM, place the Secure Partition in DRAM right after the
* region used by BL31. If BL31 it is placed in SRAM, put the Secure Partition
* at the base of DRAM.
@@ -28,8 +53,6 @@
MT_MEMORY | MT_RW | MT_SECURE)
#endif
-#if SPM_DEPRECATED
-
#ifdef IMAGE_BL31
/* SPM Payload memory. Mapped as code in S-EL1 */
#define ARM_SP_IMAGE_MMAP MAP_REGION2( \
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index 79d069ad..04272b1b 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -268,6 +268,8 @@ const struct mmap_region *plat_get_secure_partition_mmap(void *cookie);
const struct secure_partition_boot_info *plat_get_secure_partition_boot_info(
void *cookie);
int plat_spm_sp_rd_load(struct sp_res_desc *rd, const void *ptr, size_t size);
+int plat_spm_sp_get_next_address(void **sp_base, size_t *sp_size,
+ void **rd_base, size_t *rd_size);
/*******************************************************************************
* Mandatory BL image load functions(may be overridden).