Commit 09024aa6 authored by Geoff Levand's avatar Geoff Levand Committed by Catalin Marinas

arm64: Fix the soft_restart routine

Change the soft_restart() routine to call cpu_reset() at its identity mapped
physical address.

The cpu_reset() routine must be called at its identity mapped physical address
so that when the MMU is turned off the instruction pointer will be at the correct
location in physical memory.

Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent ea8c2e11
...@@ -72,8 +72,17 @@ static void setup_restart(void) ...@@ -72,8 +72,17 @@ static void setup_restart(void)
void soft_restart(unsigned long addr) void soft_restart(unsigned long addr)
{ {
typedef void (*phys_reset_t)(unsigned long);
phys_reset_t phys_reset;
setup_restart(); setup_restart();
cpu_reset(addr);
/* Switch to the identity mapping */
phys_reset = (phys_reset_t)virt_to_phys(cpu_reset);
phys_reset(addr);
/* Should never get here */
BUG();
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment