]> git.sur5r.net Git - u-boot/blob - arch/arm/cpu/armv8/transition.S
armv8: Support loading 32-bit OS in AArch32 execution state
[u-boot] / arch / arm / cpu / armv8 / transition.S
1 /*
2  * (C) Copyright 2013
3  * David Feng <fenghua@phytium.com.cn>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <asm-offsets.h>
9 #include <config.h>
10 #include <linux/linkage.h>
11 #include <asm/macro.h>
12
13 ENTRY(armv8_switch_to_el2)
14         switch_el x5, 1f, 0f, 0f
15 0:
16         /*
17          * x3 is kernel entry point or switch_to_el1
18          * if CONFIG_ARMV8_SWITCH_TO_EL1 is defined.
19          * When running in EL2 now, jump to the
20          * address saved in x3.
21          */
22         br x3
23 1:      armv8_switch_to_el2_m x3, x4, x5
24 ENDPROC(armv8_switch_to_el2)
25
26 ENTRY(armv8_switch_to_el1)
27         switch_el x5, 0f, 1f, 0f
28 0:
29         /* x3 is kernel entry point. When running in EL1
30          * now, jump to the address saved in x3.
31          */
32         br x3
33 1:      armv8_switch_to_el1_m x3, x4, x5
34 ENDPROC(armv8_switch_to_el1)