[PATCH 1/3] Powerpc/4xx: Add suspend and idle support

Victor Gallardo vgallardo at apm.com
Sat Oct 9 04:30:10 EST 2010


Hi Josh,


On Fri, Oct 8, 2010 at 6:35 AM, Josh Boyer <jwboyer at linux.vnet.ibm.com> wrote:
> On Thu, Oct 07, 2010 at 12:07:16PM -0700, Victor Gallardo wrote:
>>Add suspend/resume support for all 4xx compatible CPUs.
>>See /sys/power/state for available power states configured in.
>>
>>Add two different idle states (idle-wait and idle-doze)
>>controlled via sysfs. Default is idle-wait.
>>       cat /sys/devices/system/cpu/cpu0/idle
>>       [wait] doze
>>
>>To save additional power, use idle-doze.
>>       echo doze > /sys/devices/system/cpu/cpu0/idle
>>       cat /sys/devices/system/cpu/cpu0/idle
>>       wait [doze]
>>
>>Signed-off-by: Victor Gallardo <vgallardo at apm.com>
>>---
>> Documentation/powerpc/dts-bindings/4xx/cpm.txt |   43 +++
>> arch/powerpc/Kconfig                           |   13 +-
>> arch/powerpc/platforms/44x/Makefile            |    5 +-
>> arch/powerpc/sysdev/Makefile                   |    1 +
>> arch/powerpc/sysdev/ppc4xx_cpm.c               |  339 ++++++++++++++++++++++++
>> 5 files changed, 397 insertions(+), 4 deletions(-)
>> create mode 100644 Documentation/powerpc/dts-bindings/4xx/cpm.txt
>> create mode 100644 arch/powerpc/sysdev/ppc4xx_cpm.c
>>
>>diff --git a/Documentation/powerpc/dts-bindings/4xx/cpm.txt b/Documentation/powerpc/dts-bindings/4xx/cpm.txt
>>new file mode 100644
>>index 0000000..9635df8
>>--- /dev/null
>>+++ b/Documentation/powerpc/dts-bindings/4xx/cpm.txt
>>@@ -0,0 +1,43 @@
>>+PPC4xx Clock Power Management (CPM) node
>>+
>>+Required properties:
>>+      - compatible            : compatible list, currently only "ibm,cpm"
>>+      - dcr-access-method     : "native"
>>+      - dcr-reg               : < DCR register range >
>>+
>>+Optional properties:
>>+      - er-offset             : All 4xx SoCs with a CPM controller have
>>+                                one of two different order for the CPM
>>+                                registers. Some have the CPM registers
>>+                                in the following order (ER,FR,SR). The
>>+                                others have them in the following order
>>+                                (SR,ER,FR). For the second case set
>>+                                er-offset = <1>.
>>+      - unused-units          : specifier consist of one cell. For each
>>+                                bit in the cell, the corresponding bit
>>+                                in CPM will be set to turn off unused
>>+                                devices.
>>+      - idle-doze             : specifier consist of one cell. For each
>>+                                bit in the cell, the corresponding bit
>>+                                in CPM will be set to turn off unused
>>+                                devices. This is usually just CPM[CPU].
>>+      - standby               : specifier consist of one cell. For each
>>+                                bit in the cell, the corresponding bit
>>+                                in CPM will be set on standby and
>>+                                restored on resume.
>>+      - suspend               : specifier consist of one cell. For each
>>+                                bit in the cell, the corresponding bit
>>+                                in CPM will be set on suspend (mem) and
>>+                                restored on resume.
>
> So the difference, from what I can tell, between standby and suspend is
> really only what devices are turned off.  I don't see any code to put
> the DRAM into self-refresh mode, etc.  If that is the case, perhaps we
> could add a bit of description as to the different kinds of devices that
> may be disabled in one mode but not the other.

You are correct for this patch. I will introduce putting DDR in
self-refresh in a following patch for specific processors.
>
>>+
>>+Example:
>>+        CPM0: cpm {
>>+                compatible = "ibm,cpm";
>>+                dcr-access-method = "native";
>>+                dcr-reg = <0x160 0x003>;
>>+              er-offset = <0>;
>>+                unused-units = <0x00000100>;
>>+                idle-doze = <0x02000000>;
>>+                standby = <0xfeff0000>;
>>+                standby = <0xfeff791d>;
>
> One of these two should be illustrating suspend.

Yes,  you are correct. I will fix that.

-Victor Gallardo


More information about the Linuxppc-dev mailing list