Skip to content

Commit

Permalink
ARM: sunxi: Use SCPI to send suspend message to SCP on A83T
Browse files Browse the repository at this point in the history
We use undefined value of 3, to mean SUSPEND_SYSTEM. SCP should:

- kill CPU0
- kill cluster 0
- shutdown power to both clusters (Linux MCPM doesn't do that)
...
- reverse all of the above on interrupt

Signed-off-by: Ondrej Jirman <megi@xff.cz>
  • Loading branch information
Ondřej Jirman committed Mar 15, 2024
1 parent 450182a commit c00a753
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions arch/arm/mach-sunxi/sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/reset/sunxi.h>
#include <linux/scpi_protocol.h>
#include <linux/suspend.h>

#include <asm/mach/arch.h>
Expand Down Expand Up @@ -97,8 +98,18 @@ static int sun8i_a83t_pm_valid(suspend_state_t state)

static int sun8i_a83t_suspend_finish(unsigned long val)
{
// don't do much
cpu_do_idle();
struct scpi_ops *scpi;

scpi = get_scpi_ops();
if (scpi && scpi->sys_set_power_state) {
//HACK: use invalid state to mean: suspend last CPU and the system
scpi->sys_set_power_state(3);
cpu_do_idle();
} else {
// don't do much if scpi is not available
cpu_do_idle();
}

return 0;
}

Expand Down

0 comments on commit c00a753

Please sign in to comment.