diff mbox series

[01/13] imx: lowlevel: implement armv8_el2_to_aarch32

Message ID 20210114072810.11873-1-peng.fan@oss.nxp.com
State New
Headers show
Series [01/13] imx: lowlevel: implement armv8_el2_to_aarch32 | expand

Commit Message

Peng Fan (OSS) Jan. 14, 2021, 7:27 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>


Implement armv8_el2_to_aarch32 for aarch64 U-Boot booting aarch32 SMP
linux. It will trap to ATF to let ATF handle the mode switching.

Signed-off-by: Peng Fan <peng.fan@nxp.com>

---
 arch/arm/mach-imx/lowlevel.S | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

-- 
2.28.0
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-imx/lowlevel.S
index 158fdb7d87..c500aa8123 100644
--- a/arch/arm/mach-imx/lowlevel.S
+++ b/arch/arm/mach-imx/lowlevel.S
@@ -20,3 +20,26 @@  ENTRY(lowlevel_init)
 	isb
 	ret
 ENDPROC(lowlevel_init)
+
+/*
+ * Switch from AArch64 EL2 to AArch32 EL2
+ * @param inputs:
+ * x0: argument, zero
+ * x1: machine nr
+ * x2: fdt address
+ * x3: input argument
+ * x4: kernel entry point
+ * @param outputs for secure firmware:
+ * x0: function id
+ * x1: kernel entry point
+ * x2: machine nr
+ * x3: fdt address
+*/
+.global armv8_el2_to_aarch32
+armv8_el2_to_aarch32:
+	mov     x3, x2
+	mov     x2, x1
+	mov     x1, x4
+	ldr     x0, =0xc20000fd
+	smc     #0
+	ret