blob: bbccf2b3958d09a1c0c9c99b4548805421805355 [file] [log] [blame]
David Feng85fd5f12013-12-14 11:47:35 +08001/*
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>
David Feng85fd5f12013-12-14 11:47:35 +080010#include <linux/linkage.h>
11#include <asm/macro.h>
12
13ENTRY(armv8_switch_to_el2)
Alison Wang73818d52016-11-10 10:49:03 +080014 switch_el x5, 1f, 0f, 0f
150:
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
231: armv8_switch_to_el2_m x3, x4, x5
David Feng85fd5f12013-12-14 11:47:35 +080024ENDPROC(armv8_switch_to_el2)
25
26ENTRY(armv8_switch_to_el1)
Alison Wang73818d52016-11-10 10:49:03 +080027 switch_el x5, 0f, 1f, 0f
280:
29 /* x3 is kernel entry point. When running in EL1
30 * now, jump to the address saved in x3.
31 */
32 br x3
331: armv8_switch_to_el1_m x3, x4, x5
David Feng85fd5f12013-12-14 11:47:35 +080034ENDPROC(armv8_switch_to_el1)