Skip to content

Commit

Permalink
arm: Add PSCI shutdown function
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
agraf committed Oct 18, 2016
1 parent 51bfb5b commit 3ee655e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/arm/cpu/armv8/fwcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&regs);
else
hvc_call(&regs);

while (1)
;
}
1 change: 1 addition & 0 deletions arch/arm/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

Expand Down

0 comments on commit 3ee655e

Please sign in to comment.