diff options
-rw-r--r-- | src/arch/arm64/stage_entry.S | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/arch/arm64/stage_entry.S b/src/arch/arm64/stage_entry.S index 56eca77aae..8e57706354 100644 --- a/src/arch/arm64/stage_entry.S +++ b/src/arch/arm64/stage_entry.S @@ -21,9 +21,17 @@ #include <arch/asm.h> ENTRY(arm64_el3_startup) - mov x0, xzr + /* Set all bits in SCTLR_EL3 to 0 except RES1 and RES0 */ + mrs x0, SCTLR_EL3 + ldr x1, .SCTLR_MASK + and x0, x0, x1 msr SCTLR_EL3, x0 - msr SCR_EL3, x0 + /* Set all bits in SCR_EL3 to 0 except RES1 and RES0 */ + mrs x0, SCR_EL3 + ldr x1, .SCR_MASK + and x0, x0, x1 + msr SCR_EL3, x0 + /* Have stack pointer use SP_EL0. */ msr SPSel, #0 isb @@ -39,6 +47,12 @@ ENTRY(arm64_el3_startup) br x1 .align 4 + .SCTLR_MASK: + .quad 0x0FFFFEFF0 + + .SCR_MASK: + .quad 0x0FFFFC070 + .align 4 /* * By default branch to main() and initialize the stack according * to the Kconfig option for cpu0. However, this code can be relocated |