summaryrefslogtreecommitdiffstats
path: root/bsps/aarch64/shared
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/aarch64/shared')
-rw-r--r--bsps/aarch64/shared/start/start.S18
1 files changed, 16 insertions, 2 deletions
diff --git a/bsps/aarch64/shared/start/start.S b/bsps/aarch64/shared/start/start.S
index d0d9c2160a..338c51f7d0 100644
--- a/bsps/aarch64/shared/start/start.S
+++ b/bsps/aarch64/shared/start/start.S
@@ -98,7 +98,7 @@ _start:
#endif
msr SCTLR_EL1, x0
-#ifdef BSP_START_IN_MON_SUPPORT
+#ifdef BSP_START_IN_EL3_MONITOR_MODE_SUPPORT
/* Drop from EL3 to EL2 */
/* Initialize HCR_EL2 and SCTLR_EL2 */
@@ -108,21 +108,35 @@ _start:
mrs x0, SCR_EL3
/* Set EL2 to AArch64 */
orr x0, x0, #(1<<10)
+#ifdef AARCH64_IS_NONSECURE
/* Set EL1 to NS */
orr x0, x0, #1
+#endif
msr SCR_EL3, x0
/* set EL2h mode for eret */
+#ifdef AARCH64_IS_NONSECURE
mov x0, #0b01001
+#else
+ mov x0, #0b00101
+#endif
+
msr SPSR_EL3, x0
/* Set EL2 entry point */
+#ifdef AARCH64_IS_NONSECURE
adr x0, _el2_start
+#else
+ adr x0, _el1_start
+#endif
msr ELR_EL3, x0
eret
#endif
-#if defined(BSP_START_IN_HYP_SUPPORT) || defined(BSP_START_IN_MON_SUPPORT)
+#if defined(BSP_START_IN_HYP_SUPPORT) || \
+ ( defined(BSP_START_IN_EL3_MONITOR_MODE_SUPPORT) && \
+ defined(AARCH64_IS_NONSECURE) \
+ )
_el2_start:
/* Drop from EL2 to EL1 */