mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
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 <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
51bfb5b6f5
commit
3ee655ed83
2 changed files with 16 additions and 0 deletions
|
@ -97,3 +97,18 @@ void __noreturn psci_system_reset(void)
|
||||||
while (1)
|
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)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
|
@ -116,6 +116,7 @@ void flush_l3_cache(void);
|
||||||
void smc_call(struct pt_regs *args);
|
void smc_call(struct pt_regs *args);
|
||||||
|
|
||||||
void __noreturn psci_system_reset(void);
|
void __noreturn psci_system_reset(void);
|
||||||
|
void __noreturn psci_system_off(void);
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue