Skip to contentSkip to conversation

ARM: mach-shmobile: sh7372 A3SM sleep prototype

PATCH New Magnus Damm 1 participant 1 message Jun 15, 2011

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 ARM: mach-shmobile: sh7372 A3SM sleep prototype

From: Magnus Damm <[email protected]>

This prototype adds A3SM sleep mode support for Suspend-to-RAM on the sh7372 SoC and boards such as Mackerel and AP4EVB.

A3SM sleep is similar to ARM Core Standby on sh7372, but instead of only powering down the ARM core including L1 cache A3SM also shuts down the L2 cache. PLLC0 can also be turned off. The down side is the limited amount of wakeup sources available for A3SM.

In theory we can also add limited CPUIdle support, but it is not yet clear how to determine which wakeup sources that are active during normal operation on a running system. Creating a special case is easy, but to support something in a generic way requires more information from various parts of the kernel.

The goal with this prototype is to highlight the need for this extra information. I suspect that we can get this from Runtime PM.

One solution is export information from the SoC specific Runtime PM code so we can determine the current state of each device. We can then use the per-device state together with the interrupt status to determine potential wakeup sources and from that select the most suitable sleep mode.

In other words, in the solution proposal above we assume that devices that are Runtime PM idle (clocked stopped and maybe powered down) will not generate wakeups. Since the device is idle can we treat the associated interrupt as disabled even though it happens to be enabled through request_irq().

Not-yet-Signed-off-by Magnus Damm <[email protected]>

---

 arch/arm/mach-shmobile/include/mach/common.h |    2 
 arch/arm/mach-shmobile/pm-sh7372.c           |  134 +++++++++++++++++++++++++-
 arch/arm/mach-shmobile/sleep-sh7372.S        |   84 ++++++++++++++++
 3 files changed, 218 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/include/mach/common.h +1 -1
@@ -35,7 +35,7 @@ extern void sh7372_add_standard_devices(
 extern void sh7372_clock_init(void);
 extern void sh7372_pinmux_init(void);
 extern void sh7372_pm_init(void);
-extern void sh7372_cpu_suspend(void);
+extern void sh7372_cpu_suspend(int do_a3sm);
 extern void sh7372_cpu_resume(void);
 extern struct clk sh7372_extal1_clk;
 extern struct clk sh7372_extal2_clk;
arch/arm/mach-shmobile/pm-sh7372.c +133 -1

167 lines not on this page · raw message

arch/arm/mach-shmobile/sleep-sh7372.S +84 -0

96 lines not on this page · raw message