/* SPDX-License-Identifier: GPL-2.0-only */1/*2* CPU reset routines3*4* Copyright (C) 2001 Deep Blue Solutions Ltd.5* Copyright (C) 2012 ARM Ltd.6* Copyright (C) 2015 Huawei Futurewei Technologies.7*/89#include <linux/linkage.h>10#include <linux/cfi_types.h>11#include <asm/assembler.h>12#include <asm/sysreg.h>13#include <asm/virt.h>1415.text16.pushsection .idmap.text, "a"1718/*19* cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2)20*21* @el2_switch: Flag to indicate a switch to EL2 is needed.22* @entry: Location to jump to for soft reset.23* arg0: First argument passed to @entry. (relocation list)24* arg1: Second argument passed to @entry.(physical kernel entry)25* arg2: Third argument passed to @entry. (physical dtb address)26*27* Put the CPU into the same state as it would be if it had been reset, and28* branch to what would be the reset vector. It must be executed with the29* flat identity mapping.30*/31SYM_TYPED_FUNC_START(cpu_soft_restart)32mov_q x12, INIT_SCTLR_EL1_MMU_OFF33pre_disable_mmu_workaround34/*35* either disable EL1&0 translation regime or disable EL2&0 translation36* regime if HCR_EL2.E2H == 137*/38msr sctlr_el1, x1239isb4041cbz x0, 1f // el2_switch?42mov x0, #HVC_SOFT_RESTART43hvc #0 // no return44451: mov x8, x1 // entry46mov x0, x2 // arg047mov x1, x3 // arg148mov x2, x4 // arg249br x850SYM_FUNC_END(cpu_soft_restart)5152.popsection535455