aboutsummaryrefslogtreecommitdiff
path: root/plat
diff options
context:
space:
mode:
authorManish Pandey <manish.pandey2@arm.com>2020-07-16 00:38:59 +0100
committerManish Pandey <manish.pandey2@arm.com>2020-07-24 16:46:48 +0100
commitcc9cb29ae79519ecc810e975960f973c80fa6fc0 (patch)
tree317cf1b85224a29e5aafb9b9f228e999b965e564 /plat
parent1056ddce76f81a920345b90e6ce896849a8cc55a (diff)
downloadtrusted-firmware-a-cc9cb29ae79519ecc810e975960f973c80fa6fc0.tar.gz
plat/arm: spm: add support for RESET_TO_BL31
SPM(BL32) and hafnium(BL33) expect their manifest base address in x0 register, which is updated during BL2 stage by parsing fw_config. In case of RESET_TO_BL31 it has to be updated while populating entry point information. Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: I6f4a97f3405029bd6ba25f0935e2d1f74bb95517
Diffstat (limited to 'plat')
-rw-r--r--plat/arm/common/arm_bl31_setup.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/plat/arm/common/arm_bl31_setup.c b/plat/arm/common/arm_bl31_setup.c
index ded8f895eb..58ccf0e511 100644
--- a/plat/arm/common/arm_bl31_setup.c
+++ b/plat/arm/common/arm_bl31_setup.c
@@ -114,6 +114,18 @@ void __init arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_confi
SET_SECURITY_STATE(bl32_image_ep_info.h.attr, SECURE);
bl32_image_ep_info.pc = BL32_BASE;
bl32_image_ep_info.spsr = arm_get_spsr_for_bl32_entry();
+
+#if defined(SPD_spmd)
+ /* SPM (hafnium in secure world) expects SPM Core manifest base address
+ * in x0, which in !RESET_TO_BL31 case loaded after base of non shared
+ * SRAM(after 4KB offset of SRAM). But in RESET_TO_BL31 case all non
+ * shared SRAM is allocated to BL31, so to avoid overwriting of manifest
+ * keep it in the last page.
+ */
+ bl32_image_ep_info.args.arg0 = ARM_TRUSTED_SRAM_BASE +
+ PLAT_ARM_TRUSTED_SRAM_SIZE - PAGE_SIZE;
+#endif
+
# endif /* BL32_BASE */
/* Populate entry point information for BL33 */
@@ -130,6 +142,14 @@ void __init arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_confi
bl33_image_ep_info.spsr = arm_get_spsr_for_bl33_entry();
SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
+#if defined(SPD_spmd) && !(ARM_LINUX_KERNEL_AS_BL33)
+ /*
+ * Hafnium in normal world expects its manifest address in x0, which
+ * is loaded at base of DRAM.
+ */
+ bl33_image_ep_info.args.arg0 = (u_register_t)ARM_DRAM1_BASE;
+#endif
+
# if ARM_LINUX_KERNEL_AS_BL33
/*
* According to the file ``Documentation/arm64/booting.txt`` of the