aboutsummaryrefslogtreecommitdiff
path: root/el3/el3.c
diff options
context:
space:
mode:
Diffstat (limited to 'el3/el3.c')
-rw-r--r--el3/el3.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/el3/el3.c b/el3/el3.c
index 78e69d1..f8c9107 100644
--- a/el3/el3.c
+++ b/el3/el3.c
@@ -328,6 +328,18 @@ void el3_start(uintptr_t base, uintptr_t size)
el3_monitor_init();
+ /* Initialize SCR. In particular, we must ensure that SCR_EL3.RW is 1
+ * so that we define EL1 as AArch64; otherwise the exception return
+ * will fail; we also want SCR_EL3.NS to be 0.
+ * Setting SCR_ST and SCR_HCE isn't necessary but this configuration
+ * is essentially "turn off all the trap-to-EL3 possibilities".
+ */
+#ifdef AARCH64
+ WRITE_SCR(SCR_ST | SCR_RW | SCR_HCE);
+#else
+ WRITE_SCR(SCR_HCE);
+#endif
+
/* Set-up our state to return to secure EL1 to start its init on exception
* return.
*/