[U-Boot] [PATCH] ARM: HYP/non-sec: Propagate stack pointer to hyp mode

Ian Campbell ijc at hellion.org.uk
Sun Dec 29 20:07:56 CET 2013


Some users of the u-boot API (specifically grub) use the initial SP as a hint
regarding where to look for the u-boot API signature.

Signed-off-by: Ian Campbell <ijc at hellion.org.uk>
Cc: Marc Zyngier <marc.zyngier at arm.com>
---
This applies on top of Marc's "ARMv7: add PSCI support to u-boot" and allows me
to chainload grub on a cubieboard2. (I don't think that has been applied
anywhere yet?)
---
 arch/arm/cpu/armv7/nonsec_virt.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/cpu/armv7/nonsec_virt.S b/arch/arm/cpu/armv7/nonsec_virt.S
index 6130a37..2c9e097 100644
--- a/arch/arm/cpu/armv7/nonsec_virt.S
+++ b/arch/arm/cpu/armv7/nonsec_virt.S
@@ -60,6 +60,10 @@ _secure_monitor:
 #ifdef CONFIG_ARMV7_VIRT
 	orreq	r5, r5, #0x100			@ allow HVC instruction
 	moveq	r6, #HYP_MODE			@ Enter the kernel as HYP
+
+	mrseq 	r4, sp_svc			@ Propagate SP to HYP mode
+	msreq	sp_hyp, r4			@ it serves as a "hint" to
+						@ find the u-boot API root.
 #endif
 
 	mcr	p15, 0, r5, c1, c1, 0		@ write SCR (with NS bit set)
-- 
1.8.4.rc3



More information about the U-Boot mailing list