|
@@ -72,18 +72,12 @@ void scu_enable(void __iomem *scu_base)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-/*
|
|
|
- * Set the executing CPUs power mode as defined. This will be in
|
|
|
- * preparation for it executing a WFI instruction.
|
|
|
- *
|
|
|
- * This function must be called with preemption disabled, and as it
|
|
|
- * has the side effect of disabling coherency, caches must have been
|
|
|
- * flushed. Interrupts must also have been disabled.
|
|
|
- */
|
|
|
-int scu_power_mode(void __iomem *scu_base, unsigned int mode)
|
|
|
+static int scu_set_power_mode_internal(void __iomem *scu_base,
|
|
|
+ unsigned int logical_cpu,
|
|
|
+ unsigned int mode)
|
|
|
{
|
|
|
unsigned int val;
|
|
|
- int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0);
|
|
|
+ int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(logical_cpu), 0);
|
|
|
|
|
|
if (mode > 3 || mode == 1 || cpu > 3)
|
|
|
return -EINVAL;
|
|
@@ -94,3 +88,24 @@ int scu_power_mode(void __iomem *scu_base, unsigned int mode)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+/*
|
|
|
+ * Set the executing CPUs power mode as defined. This will be in
|
|
|
+ * preparation for it executing a WFI instruction.
|
|
|
+ *
|
|
|
+ * This function must be called with preemption disabled, and as it
|
|
|
+ * has the side effect of disabling coherency, caches must have been
|
|
|
+ * flushed. Interrupts must also have been disabled.
|
|
|
+ */
|
|
|
+int scu_power_mode(void __iomem *scu_base, unsigned int mode)
|
|
|
+{
|
|
|
+ return scu_set_power_mode_internal(scu_base, smp_processor_id(), mode);
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * Set the given (logical) CPU's power mode to SCU_PM_NORMAL.
|
|
|
+ */
|
|
|
+int scu_cpu_power_enable(void __iomem *scu_base, unsigned int cpu)
|
|
|
+{
|
|
|
+ return scu_set_power_mode_internal(scu_base, cpu, SCU_PM_NORMAL);
|
|
|
+}
|