aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Deprez <olivier.deprez@arm.com>2019-12-13 16:26:32 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2019-12-13 16:26:32 +0000
commit2bcc672f34cfe30ec9e778de272dd62196b6e91a (patch)
tree286e12047f2c6bdbb6d601139e12cae79b64e70b /lib
parent49c71a36c11ce8693c87b8e6a6cc122be0a6db46 (diff)
parentdb3ae8538b8a2cc89e2211201ec96df72e597ae0 (diff)
downloadplatform_external_arm-trusted-firmware-2bcc672f34cfe30ec9e778de272dd62196b6e91a.tar.gz
platform_external_arm-trusted-firmware-2bcc672f34cfe30ec9e778de272dd62196b6e91a.tar.bz2
platform_external_arm-trusted-firmware-2bcc672f34cfe30ec9e778de272dd62196b6e91a.zip
Merge changes from topic "aa/sel2_support" into integration
* changes: S-EL2 Support: Check for AArch64 Add support for enabling S-EL2
Diffstat (limited to 'lib')
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index d65e02d5e..b7908adec 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -181,6 +181,16 @@ 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)) {
+ if (GET_RW(ep->spsr) != MODE_RW_64) {
+ ERROR("S-EL2 can not be used in AArch32.");
+ panic();
+ }
+
+ 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.