aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-22 15:09:22 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-22 15:09:22 +1000
commit5ac6ac391d3c8113705be7e66f6f88d487884d97 (patch)
treedf896a0b02d4cde4d2e217d545cd347a80c35b89 /hw
parenta4202bc19821a024e460592159507a059f993d3b (diff)
downloadskiboot-5ac6ac391d3c8113705be7e66f6f88d487884d97.zip
skiboot-5ac6ac391d3c8113705be7e66f6f88d487884d97.tar.gz
skiboot-5ac6ac391d3c8113705be7e66f6f88d487884d97.tar.bz2
slw: Change bit used to expose sleep support
Due to an errata in P8, we cannot let the OS use the sleep instruction without some extra workarounds in the OS. So let's use a different bit to represent that support so that existing OSes without the workaround don't enable support for sleep mode. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/slw.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/slw.c b/hw/slw.c
index 3522458..cfa5a7e 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -428,8 +428,9 @@ struct cpu_idle_states {
#define IDLE_LOSE_FULL_CONTEXT 0x00000400 /* Restore hypervisor resource
by searching PACA */
#define IDLE_USE_INST_NAP 0x00010000 /* Use nap instruction */
-#define IDLE_USE_INST_SLEEP 0x00020000 /* Use sleep instruction */
+#define IDLE_USE_INST_SLEEP 0x00020000 /* Use sleep instruction (no workaround) */
#define IDLE_USE_INST_WINKLE 0x00040000 /* Use winkle instruction */
+#define IDLE_USE_INST_SLEEP_ER1 0x00080000 /* Use sleep instruction (need workaround)*/
#define IDLE_USE_PMICR 0x00800000 /* Use SPR PMICR instruction */
#define IDLE_FASTSLEEP_PMICR 0x0000002000000000
@@ -472,8 +473,8 @@ static struct cpu_idle_states power8_cpu_idle_states[] = {
| 0*IDLE_USE_PMICR,
.pmicr = 0,
.pmicr_mask = 0 },
- { /* fast sleep */
- .name = "fastsleep",
+ { /* fast sleep (with workaround) */
+ .name = "fastsleep_",
.latency_ns = 100000,
.flags = 1*IDLE_DEC_STOP \
| 1*IDLE_TB_STOP \
@@ -481,7 +482,7 @@ static struct cpu_idle_states power8_cpu_idle_states[] = {
| 0*IDLE_LOSE_HYP_CONTEXT \
| 0*IDLE_LOSE_FULL_CONTEXT \
| 0*IDLE_USE_INST_NAP \
- | 1*IDLE_USE_INST_SLEEP \
+ | 1*IDLE_USE_INST_SLEEP_ER1 \
| 0*IDLE_USE_INST_WINKLE \
| 0*IDLE_USE_PMICR, /* Not enabled until deep
states are available */