#include <linux/delay.h>
#include <linux/psci.h>
#include <linux/mm.h>
+#include <soc/samsung/exynos-cpupm.h>
#include <uapi/linux/psci.h>
static void cpu_psci_cpu_die(unsigned int cpu)
{
- int ret;
+ u32 state;
+ int ret, affinity_level = 0;
/*
* There are no known implementations of PSCI actually using the
* power state field, pass a sensible default for now.
*/
- u32 state = PSCI_POWER_STATE_TYPE_POWER_DOWN <<
- PSCI_0_2_POWER_STATE_TYPE_SHIFT;
+ if (exynos_cpuhp_last_cpu(cpu))
+ affinity_level = 1;
+
+ state = ((PSCI_POWER_STATE_TYPE_POWER_DOWN
+ << PSCI_0_2_POWER_STATE_TYPE_SHIFT)
+ & PSCI_0_2_POWER_STATE_TYPE_MASK) |
+ ((affinity_level
+ << PSCI_0_2_POWER_STATE_AFFL_SHIFT)
+ & PSCI_0_2_POWER_STATE_AFFL_MASK);
ret = psci_ops.cpu_off(state);