1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Copyright (C) 2001 Deep Blue Solutions Ltd.
6 * Copyright (C) 2012 ARM Ltd.
7 * Copyright (C) 2015 Huawei Futurewei Technologies.
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/sysreg.h>
16 .pushsection .idmap.text, "awx"
19 * __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for
22 * @el2_switch: Flag to indicate a switch to EL2 is needed.
23 * @entry: Location to jump to for soft reset.
24 * arg0: First argument passed to @entry. (relocation list)
25 * arg1: Second argument passed to @entry.(physical kernel entry)
26 * arg2: Third argument passed to @entry. (physical dtb address)
28 * Put the CPU into the same state as it would be if it had been reset, and
29 * branch to what would be the reset vector. It must be executed with the
30 * flat identity mapping.
32 SYM_CODE_START(__cpu_soft_restart)
33 /* Clear sctlr_el1 flags. */
35 mov_q x13, SCTLR_ELx_FLAGS
37 pre_disable_mmu_workaround
39 * either disable EL1&0 translation regime or disable EL2&0 translation
40 * regime if HCR_EL2.E2H == 1
45 cbz x0, 1f // el2_switch?
46 mov x0, #HVC_SOFT_RESTART
49 1: mov x8, x1 // entry
54 SYM_CODE_END(__cpu_soft_restart)