arm64: psci: Add affinity_lv for hotplug
authorYoungtae Lee <yt0729.lee@samsung.com>
Fri, 4 May 2018 06:48:10 +0000 (15:48 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:14 +0000 (14:59 +0900)
To indecating hotplug with cluster power down,
pass affinity_level EL3 by PSCI.

Change-Id: I4687c828e26150485e6ff426a815562322587ee9
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
arch/arm64/kernel/psci.c

index e8edbf13302aad06875703c5b680dd3513c4bb91..df9ce98fb08e61ce1bac8449e64fa456ff81fcee 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/delay.h>
 #include <linux/psci.h>
 #include <linux/mm.h>
+#include <soc/samsung/exynos-cpupm.h>
 
 #include <uapi/linux/psci.h>
 
@@ -69,13 +70,21 @@ static int cpu_psci_cpu_disable(unsigned int cpu)
 
 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);