aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2019-10-11 14:44:05 +0100
committerArtsem Artsemenka <artsem.artsemenka@arm.com>2019-12-06 17:42:45 +0000
commit0376e7c4aa2ce9ae94d72555cea27cd7aff8e32a (patch)
treee1e124d22ba67e58daa92a20d101302bb2071c54 /lib
parent87b582ef5b31c5893a470b61c217931fc7602da3 (diff)
downloadplatform_external_arm-trusted-firmware-0376e7c4aa2ce9ae94d72555cea27cd7aff8e32a.tar.gz
platform_external_arm-trusted-firmware-0376e7c4aa2ce9ae94d72555cea27cd7aff8e32a.tar.bz2
platform_external_arm-trusted-firmware-0376e7c4aa2ce9ae94d72555cea27cd7aff8e32a.zip
Add support for enabling S-EL2
This patch adds support for enabling S-EL2 if this EL is specified in the entry point information being used to initialise a secure context. It is the caller's responsibility to check if S-EL2 is available on the system before requesting this EL through the entry point information. Signed-off-by: Achin Gupta <achin.gupta@arm.com> Change-Id: I2752964f078ab528b2e80de71c7d2f35e60569e1
Diffstat (limited to 'lib')
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index d65e02d5e..752a2606e 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -181,6 +181,10 @@ void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep)
scr_el3 |= SCR_HCE_BIT;
}
+ /* Enable S-EL2 if the next EL is EL2 and security state is secure */
+ if ((security_state == SECURE) && (GET_EL(ep->spsr) == MODE_EL2))
+ scr_el3 |= SCR_EEL2_BIT;
+
/*
* Initialise SCTLR_EL1 to the reset value corresponding to the target
* execution state setting all fields rather than relying of the hw.