4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 * Copyright (C) 2012 ARM Ltd.
6 * Copyright (C) 2015 Huawei Futurewei Technologies.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/linkage.h>
14 #include <asm/assembler.h>
15 #include <asm/sysreg.h>
19 .pushsection .idmap.text, "awx"
22 * __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for
25 * @el2_switch: Flag to indicate a switch to EL2 is needed.
26 * @entry: Location to jump to for soft reset.
27 * arg0: First argument passed to @entry. (relocation list)
28 * arg1: Second argument passed to @entry.(physical kernel entry)
29 * arg2: Third argument passed to @entry. (physical dtb address)
31 * Put the CPU into the same state as it would be if it had been reset, and
32 * branch to what would be the reset vector. It must be executed with the
33 * flat identity mapping.
35 ENTRY(__cpu_soft_restart)
36 /* Clear sctlr_el1 flags. */
38 ldr x13, =SCTLR_ELx_FLAGS
40 pre_disable_mmu_workaround
44 cbz x0, 1f // el2_switch?
45 mov x0, #HVC_SOFT_RESTART
48 1: mov x18, x1 // entry
53 ENDPROC(__cpu_soft_restart)