diff options
author | Beniamino Galvani <b.galvani@gmail.com> | 2016-05-08 08:30:14 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-05-27 15:39:46 -0400 |
commit | 5a07abb3705f561221e7ae351beba746b6ae6eb7 (patch) | |
tree | 5db3657b26c6c19f06d0b2929edb9872e12666bf /arch/arm/cpu/armv8 | |
parent | 20898ea9340a4fd1631a4057b8de011b9f166255 (diff) | |
download | u-boot-imx-5a07abb3705f561221e7ae351beba746b6ae6eb7.zip u-boot-imx-5a07abb3705f561221e7ae351beba746b6ae6eb7.tar.gz u-boot-imx-5a07abb3705f561221e7ae351beba746b6ae6eb7.tar.bz2 |
arm: implement generic PSCI reset call for armv8
Add a psci_system_reset() which calls the SYSTEM_RESET function of
PSCI 0.2 and can be used by boards that support it to implement
reset_cpu().
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/cpu/armv8')
-rw-r--r-- | arch/arm/cpu/armv8/fwcall.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/fwcall.c b/arch/arm/cpu/armv8/fwcall.c index 9efcc5a..079e250 100644 --- a/arch/arm/cpu/armv8/fwcall.c +++ b/arch/arm/cpu/armv8/fwcall.c @@ -8,6 +8,7 @@ #include <config.h> #include <version.h> #include <asm/macro.h> +#include <asm/psci.h> #include <asm/system.h> /* @@ -73,3 +74,18 @@ void smc_call(struct pt_regs *args) "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17"); } + +void __noreturn psci_system_reset(bool conduit_smc) +{ + struct pt_regs regs; + + regs.regs[0] = ARM_PSCI_0_2_FN_SYSTEM_RESET; + + if (conduit_smc) + smc_call(®s); + else + hvc_call(®s); + + while (1) + ; +} |