aboutsummaryrefslogtreecommitdiff
path: root/hw/slw.c
AgeCommit message (Collapse)AuthorFilesLines
2014-10-08slw: Remove log flooding from fast sleep codeBenjamin Herrenschmidt1-4/+0
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-09-01core: Setup the OPAL DT node before platform probeBenjamin Herrenschmidt1-1/+3
The platform probe code might want to add things to it. While at it, make add_cpu_idle_state_properties() local to slw.c and call it from slw_init() instead of from add_opal_node(). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-18slw: Parse DT from host-boot for fast-sleep stringVaidyanathan Srinivasan1-1/+1
Match the fast-sleep name between OPAL and HB Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
2014-08-01slw: Extend opal_slw_set_reg to all supported sprsShreyas B. Prabhu1-17/+26
Commit 95932150: "slw: patch hsprg0 for wakeup from winkle" added OPAL call for HSPRG0 to be patched via slw. Extend it to all the sprs supported in libpore. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01idle: Make idle flags endian safePreeti U Murthy1-3/+4
The idle flag IDLE_LOSE_HYP_CONTEXT can be wrongly interpreted for IDLE_USE_INST_SLEEP if the kernel has endian bug, which would incorrectly enable fastsleep even though the device tree does not advertise it. Unfortunately, some kernels currently do have such a bug. Additionally, current fastsleep wakeup path makes opal calls to sync timebase which is not endian safe. This can lead to checkstops. Hence for now change the bits used in IDLE_LOSE_HYP_CONTEXT to avoid misinterpretation with IDLE_USE_INST_SLEEP in LE kernels. Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31slw: Don't enable fast sleep on Venice DD1.x even if HB says it's thereBenjamin Herrenschmidt1-3/+4
It's broken on all DD1.x chips. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30slw: Fix indication of whether sleep is supportedBenjamin Herrenschmidt1-4/+9
Don't enable it if HB doesn't allow it and fix backward logic in the code that was supposed to disable it. Also print out more diagnostic info. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30slw: Small cleanup of state definitionsBenjamin Herrenschmidt1-6/+1
Don't bother writing 0*constant for the non-relevant instruction bits in the various states and keep the "normal" sleep case in add_cpu_idle_state_properties() so we don't have to add it back later when we have a CPU that doesn't require the workaround. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30slw: patch hsprg0 for wakeup from winkleVaidyanathan Srinivasan1-0/+33
Entering winkle results in hypervisor state loss. We can use PORE to restore hypervisor registers. This opal call adds support for that. This patch adds support for restoring HSPRG0. It can be extended to restore other SPRs. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30slw: Add winkle to cpuidle states in device treeShreyas B. Prabhu1-39/+101
Clean up current implementation of adding idle states to device tree, to make it more generic. Add winkle to list of cpu-idle states if slw image is intact. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30slw: Enable fast sleep and deep winkle while initializing coreShreyas B. Prabhu1-6/+10
Power8 hardware supports deep idle states like sleep and winkle. Both sleep and winkle have fast/deep modes. Behaviour of each mode - Fast sleep Stop clocks to Core and L2 cache. Drop Core & L2 voltage to retention. Leave shared L3 cache running Deep sleep Power OFF the core and private L2 cache. Leave shared L3 cache running. Fast winkle Stop clocks to entire chiplet. Drop chiplet voltage to retention. Deep winkle Power OFF the entire chiplet. Requires restore/re-init to wakeup. PM GP1 register allows us to select fast/deep modes for sleep and winkle. Currently we are setting PM GP1 register to use fast sleep and fast winkle. Change it such that, sleep will use fast mode and winkle will use deep mode. With deep winkle enabled, hotplug framework in kernel can send cores to winkle when cpus are offlined. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30sleep: Add workarounds for fast sleepVaidyanathan Srinivasan1-1/+88
Add OPAL calls to setup xscom before and after sleep V1:https://w3-01.ibm.com/stg/linux/ltc/mailinglists/pipermail/sapphire/2014-July/003170.html Changes in V2: 1.Store L2 Fir Action register contents in primary thread's pointer 2.Enable secondary threads also to call opal, now that the synchronization across threads of a core will be taken care of by the kernel. We can hence safely call fastsleep in smt on mode. Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-22slw: Change bit used to expose sleep supportBenjamin Herrenschmidt1-4/+5
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>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt1-0/+875
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>