From: Alexander Graf Date: Tue, 16 Aug 2016 19:08:47 +0000 (+0200) Subject: arm: Add PSCI shutdown function X-Git-Tag: v2016.11-rc3~84^2~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3ee655ed83ada67912cbbd14b6685bc0c7102553;p=u-boot arm: Add PSCI shutdown function Using PSCI you can not only reset the system, you can also shut it down! This patch exposes a function to do exactly that to whatever code wants to make use of it. Signed-off-by: Alexander Graf Reviewed-by: Simon Glass --- diff --git a/arch/arm/cpu/armv8/fwcall.c b/arch/arm/cpu/armv8/fwcall.c index 6bb68f2ed3..b3ef7c0f73 100644 --- a/arch/arm/cpu/armv8/fwcall.c +++ b/arch/arm/cpu/armv8/fwcall.c @@ -97,3 +97,18 @@ void __noreturn psci_system_reset(void) while (1) ; } + +void __noreturn psci_system_off(void) +{ + struct pt_regs regs; + + regs.regs[0] = ARM_PSCI_0_2_FN_SYSTEM_OFF; + + if (use_smc_for_psci) + smc_call(®s); + else + hvc_call(®s); + + while (1) + ; +} diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 5166c653f3..b928bd8d17 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -116,6 +116,7 @@ void flush_l3_cache(void); void smc_call(struct pt_regs *args); void __noreturn psci_system_reset(void); +void __noreturn psci_system_off(void); #endif /* __ASSEMBLY__ */