summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish Pandey <manish.pandey2@arm.com>2018-05-30 17:10:38 +0100
committerManish Pandey <manish.pandey2@arm.com>2018-05-30 17:32:31 +0100
commit0af2cccada0156363102174dee6c09ce4b7c6eef (patch)
tree12f883ac2010d453a27b9369c4ceec5c71498ab4
parent5ded27cd0410a7ae7cda295570bf3e5169744829 (diff)
Revert "Boot kernel in hyp mode."
This reverts commit 3018791610e7272f2e35f7e1da61fd9d74cce2ee. Change-Id: Ib2959eb9cbe4a1eee2606cbd87896bdfdc4d923c
-rw-r--r--boot.S25
-rw-r--r--monitor.S19
2 files changed, 6 insertions, 38 deletions
diff --git a/boot.S b/boot.S
index 2426c7b..6ef0c4b 100644
--- a/boot.S
+++ b/boot.S
@@ -9,7 +9,6 @@
.syntax unified
.arch_extension sec
- .arch_extension virt
.text
@@ -63,34 +62,12 @@ start:
orr r0, r0, r1
mcr p15, 0, r0, c1, c1, 2
- @ Leave monitor.S trap in place for the transition...
+ @ Change to NS-mode
mov r0, #0xf0000000
mcr p15, 0, r0, c12, c0, 1 @ Monitor vector base address
-
- @ Set up hvbar so hvc comes back here.
- ldr r0, =vectors
- mov r7, #0xfffffff0
- smc #0 @ Set HVBAR
-
- @ We can't call hvc from secure mode, so drop down first.
mov r7, #0xffffffff
smc #0 @ Change to NS-mode
- @ This is how we enter hyp mode, for booting the next stage.
- hvc #0
-
-/* Once we get rid of monitor.S, use these smc vectors too! */
-vectors:
- .word 0 /* reset */
- .word 0 /* undef */
- .word 0 /* svc */
- .word 0 /* pabt */
- .word 0 /* dabt */
- b into_hyp_mode /* hvc */
- .word 0 /* irq */
- .word 0 /* fiq */
-
-into_hyp_mode:
@ Check CPU nr again
mrc p15, 0, r0, c0, c0, 5 @ MPIDR (ARMv7 only)
bfc r0, #24, #8 @ CPU number, taking multicluster into account
diff --git a/monitor.S b/monitor.S
index dea8551..052ab1e 100644
--- a/monitor.S
+++ b/monitor.S
@@ -25,7 +25,7 @@
@
1:
ldr sp, =_monitor_stack
- push {r10-r12}
+ push {r11, r12}
cmp r7, #0xffffffff
beq _non_sec
@@ -36,20 +36,15 @@
movnes pc, lr
and r12, r7, #0xf
cmp r12, #0x0
- popgt {r10-r12}
+ popgt {r11, r12}
movgts pc, lr
@ Check the VMID is 0
- mrc p15, 0, r10, c1, c1, 0 @ SCR
- orr r11, r10, #1 @ SCR.NS = 1
- mcr p15, 0, r11, c1, c1, 0
- isb
mrrc p15, 6, r12, r11, c2
- mcr p15, 0, r10, c1, c1, 0 @ Restore SCR
lsr r11, r11, #16
and r11, r11, #0xff
cmp r11, #0
- popne {r10-r12}
+ popne {r11, r12}
movnes pc, lr
@ Jump to the right function
@@ -73,19 +68,15 @@ _non_sec:
ldr r11, =0x131
orr r12, r12, r11
mcr p15, 0, r12, c1, c1, 0
- pop {r10-r12}
+ pop {r11, r12}
movs pc, lr
@
@ Read/Write HVBAR
@
_write_hvbar:
- orr r11, r10, #1 @ SCR.NS = 1 (r10 already = SCR)
- mcr p15, 0, r11, c1, c1, 0
- isb
mcr p15, 4, r0, c12, c0, 0
- mcr p15, 0, r10, c1, c1, 0 @ Restore SCR
- pop {r10-r12}
+ pop {r11, r12}
movs pc, lr
.ltorg