|
@@ -16,13 +16,10 @@
|
|
|
|
|
|
|
|
#include <asm/machdep.h>
|
|
#include <asm/machdep.h>
|
|
|
#include <asm/firmware.h>
|
|
#include <asm/firmware.h>
|
|
|
|
|
+#include <asm/opal.h>
|
|
|
#include <asm/runlatch.h>
|
|
#include <asm/runlatch.h>
|
|
|
|
|
|
|
|
-/* Flags and constants used in PowerNV platform */
|
|
|
|
|
-
|
|
|
|
|
#define MAX_POWERNV_IDLE_STATES 8
|
|
#define MAX_POWERNV_IDLE_STATES 8
|
|
|
-#define IDLE_USE_INST_NAP 0x00010000 /* Use nap instruction */
|
|
|
|
|
-#define IDLE_USE_INST_SLEEP 0x00020000 /* Use sleep instruction */
|
|
|
|
|
|
|
|
|
|
struct cpuidle_driver powernv_idle_driver = {
|
|
struct cpuidle_driver powernv_idle_driver = {
|
|
|
.name = "powernv_idle",
|
|
.name = "powernv_idle",
|
|
@@ -198,7 +195,7 @@ static int powernv_add_idle_states(void)
|
|
|
* target residency to be 10x exit_latency
|
|
* target residency to be 10x exit_latency
|
|
|
*/
|
|
*/
|
|
|
latency_ns = be32_to_cpu(idle_state_latency[i]);
|
|
latency_ns = be32_to_cpu(idle_state_latency[i]);
|
|
|
- if (flags & IDLE_USE_INST_NAP) {
|
|
|
|
|
|
|
+ if (flags & OPAL_PM_NAP_ENABLED) {
|
|
|
/* Add NAP state */
|
|
/* Add NAP state */
|
|
|
strcpy(powernv_states[nr_idle_states].name, "Nap");
|
|
strcpy(powernv_states[nr_idle_states].name, "Nap");
|
|
|
strcpy(powernv_states[nr_idle_states].desc, "Nap");
|
|
strcpy(powernv_states[nr_idle_states].desc, "Nap");
|
|
@@ -211,7 +208,7 @@ static int powernv_add_idle_states(void)
|
|
|
nr_idle_states++;
|
|
nr_idle_states++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (flags & IDLE_USE_INST_SLEEP) {
|
|
|
|
|
|
|
+ if (flags & OPAL_PM_SLEEP_ENABLED) {
|
|
|
/* Add FASTSLEEP state */
|
|
/* Add FASTSLEEP state */
|
|
|
strcpy(powernv_states[nr_idle_states].name, "FastSleep");
|
|
strcpy(powernv_states[nr_idle_states].name, "FastSleep");
|
|
|
strcpy(powernv_states[nr_idle_states].desc, "FastSleep");
|
|
strcpy(powernv_states[nr_idle_states].desc, "FastSleep");
|