summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/pm-sh7372.c
AgeCommit message (Collapse)Author
2011-11-11ARM: mach-shmobile: cpuidle single/global and last_state fixesMagnus Damm
The following commits break cpuidle on SH-Mobile ARM: 46bcfad cpuidle: Single/Global registration of idle states e978aa7 cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state This patch remedies these issues by up-porting the SH-Mobile code to fit with the above introduced framework changes. It is worth noting that the new code becomes significantly cleaner, so these framework changes are very welcome. At the same time this breakage could probably have been avoided by grepping for "last_state" and "cpuidle_register_driver". Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-10-22ARM: mach-shmobile: sh7372 A4R support (v4)Magnus Damm
This change adds support for the sh7372 A4R power domain. The sh7372 A4R hardware power domain contains the SH CPU Core and a set of I/O devices including multimedia accelerators and I2C controllers. One special case about A4R is the INTCS interrupt controller that needs to be saved and restored to keep working as expected. Also the LCDC hardware blocks are in a different hardware power domain but have their IRQs routed only through INTCS. So as long as LCDCs are active we cannot power down INTCS because that would risk losing interrupts. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-10-22ARM: mach-shmobile: sh7372 A3SP support (v4)Magnus Damm
This change adds support for the sh7372 A3SP power domain. The sh7372 A3SP hardware power domain contains a wide range of I/O devices. The list of I/O devices include SCIF serial ports, DMA Engine hardware, SD and MMC controller hardware, USB controllers and I2C master controllers. This patch adds the A3SP low level code which powers the hardware power domain on and off. It also ties in platform devices to the pm domain support code. It is worth noting that the serial console is hooked up to SCIFA0 on most sh7372 boards, and the SCIFA0 port is included in the A3SP hardware power domain. For this reason we cannot output debug messages from the low level power control code in the case of A3SP. QoS support is needed in drivers before we can enable the A3SP power control on the fly. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-09-25ARM: mach-shmobile: sh7372 sleep warning fixesMagnus Damm
Update the sh7372 sleep code to build parts of the code only when SUSPEND and/or CPU_IDLE are set. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-09-25ARM: mach-shmobile: sh7372 A3SM supportMagnus Damm
This patch adds sh7372 A3SM power domain support. The sh7372 A3SM hardware power domain contains the ARM Cortex-A8 CPU Core including L2 cache. This sleep mode can be seen as a one step deeper sleep mode from the already existing Core Standby mode. To wake up from A3SM sleep only a few wakeup sources are supported - so the regular INTC controller will not be able to help us unfortunately. The code in this patch will enter A3SM sleep via the regular Suspend-to-RAM interface in the case of only wakeups supported by A3SM are enabled. If unsupported wakeups are enabled then Core Standby will be used instead. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-09-25ARM: mach-shmobile: sh7372 generic suspend/resume supportMagnus Damm
Convert the sh7372 Core Standby code to make use of the new generic ARM cpu suspend/resume code. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25PM / Domains: Preliminary support for devices with power.irq_safe setRafael J. Wysocki
The generic PM domains framework currently doesn't work with devices whose power.irq_safe flag is set, because runtime PM callbacks for such devices are run with interrupts disabled and the callbacks provided by the generic PM domains framework use domain mutexes and may sleep. However, such devices very well may belong to power domains on some systems, so the generic PM domains framework should take them into account. For this reason, modify the generic PM domains framework so that the domain .power_off() and .power_on() callbacks are never executed for a domain containing devices with power.irq_safe set, although the .stop_device() and .start_device() callbacks are still run for them. Additionally, introduce a flag allowing the creator of a struct generic_pm_domain object to indicate that its .stop_device() and .start_device() callbacks may be run in interrupt context (might_sleep_if() triggers if that flag is not set and one of those callbacks is run in interrupt context). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25PM: Move clock-related definitions and headers to separate fileRafael J. Wysocki
Since the PM clock management code in drivers/base/power/clock_ops.c is used for both runtime PM and system suspend/hibernation, the definitions of data structures and headers related to it should not be located in include/linux/pm_rumtime.h. Move them to a separate header file. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25PM / Domains: Use power.sybsys_data to reduce overheadRafael J. Wysocki
Currently pm_genpd_runtime_resume() has to walk the list of devices from the device's PM domain to find the corresponding device list object containing the need_restore field to check if the driver's .runtime_resume() callback should be executed for the device. This is suboptimal and can be simplified by using power.sybsys_data to store device information used by the generic PM domains code. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25PM: Introduce struct pm_subsys_dataRafael J. Wysocki
Introduce struct pm_subsys_data that may be subclassed by subsystems to store subsystem-specific information related to the device. Move the clock management fields accessed through the power.subsys_data pointer in struct device to the new strucutre. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25ARM / shmobile: Make A3RV be a subdomain of A4LC on SH7372Rafael J. Wysocki
Instead of coding the undocumented dependencies between power domains A3RV and A4LC on SH7372 directly into the low-level power up/down routines, make A3RV be a subdomain of A4LC, which will cause the same dependecies to hold. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
2011-07-14ARM / shmobile: Return -EBUSY from A4LC power off if A3RV is activeRafael J. Wysocki
Since the A4LC should only be powered off if the A3RV is off, make the A4LC's power down routine return -EBUSY if A3RV is not off to indicate to the core that it doesn't want to power off the domain in that case. This will cause the core to regard A4LC as active, so the pm_genpd_poweron() in pd_power_down_a3rv() is not necessary any more. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
2011-07-14ARM / shmobile: Use genpd_queue_power_off_work()Rafael J. Wysocki
Make pd_power_down_a3rv() use genpd_queue_power_off_work() to queue up the powering off of the A4LC domain to avoid queuing it up when it is pending. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
2011-07-13ARM / shmobile: Use pm_genpd_poweroff_unused()Rafael J. Wysocki
Make shmobile use pm_genpd_poweroff_unused() instead of the open-coded powering off PM domains without devices in use. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
2011-07-10ARM: mach-shmobile: sh7372 A3RV requires A4LCMagnus Damm
Add a power domain workaround for the VPU and A3RV on sh7372. The sh7372 data sheet mentions that the VPU is located in the A3RV power domain. The A3RV power domain is not related to A4LC in any way, but testing shows that unless A3RV _and_ A4LC are powered on the VPU test program will bomb out. This issue may be caused by a more or less undocumented dependency on the MERAM block that happens to be located in A4LC. So now we know that the out-of-reset requirement of the VPU is that the MERAM is powered on. This patch adds a workaround for A3RV to make sure A4LC is powered on - this so we can use the VPU even though the LCDCs are in blanking state and A4LC is supposed to be off. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-07-10ARM: mach-shmobile: sh7372 late pm domain offMagnus Damm
Add sh7372 specific code to power down unused pm domains. This should really be replaced by some generic PM core code IMO, but until that happens this patch makes sure we don't waste power by leaving unused power domains on. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-07-10ARM: mach-shmobile: sh7372 D4 supportMagnus Damm
Add support for the sh7372 D4 power domain. This power domain contains the Coresight-ETM hardware block. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-07-10ARM: mach-shmobile: sh7372 A4MP supportKuninori Morimoto
Add support for the sh7372 A4MP power domain and hook up the FSI/SPU2 device. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-07-02ARM: mach-shmobile: sh7372 A3SG supportMagnus Damm
Add support for the sh7372 A3SG power domain. This domain contains the SGX hardware block, but there is no open source driver available. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-07-02ARM: mach-shmobile: sh7372 A3RI supportMagnus Damm
Add support for the sh7372 A3RI power domain. This domain contains the ISP hardware block, but there is no driver available. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-07-02ARM: mach-shmobile: sh7372 A3RV supportMagnus Damm
Add support for the sh7372 A3RV power domain and hook up the VPU device. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-07-02ARM / shmobile: Support for I/O power domains for SH7372 (v9)Rafael J. Wysocki
Use the generic power domains support introduced by the previous patch to implement support for power domains on SH7372. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Paul Mundt <lethal@linux-sh.org>
2011-05-25ARM: mach-shmobile: Tidy up after SH7372 pm changes.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-25ARM: mach-shmobile: sh7372 Core Standby CPUIdleMagnus Damm
This patch ties in the previously added sh7372 sleep mode known as Core Standby together with the shared SH-Mobile ARM CPUIdle implementation. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-25ARM: mach-shmobile: sh7372 Core Standby Suspend-to-RAMMagnus Damm
Add sh7372 Core Standby sleep mode support and tie it in with the shared SH-Mobile ARM suspend code. The Core Standby mode is the lightest sh7372-specific sleep mode, cutting power to the ARM core excluding the L2 cache. Any interrupt source can be used for wakeups. The low level portion of this code is based on the TI OMAP sleep code in sleep34xx.S, thanks to them. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>