Skip to contentSkip to conversation

powerpc/85xx: Add suspend/resume support

PATCH Applied Anton Vorontsov 2 participants 3 messages Aug 27, 2009 – Aug 28, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/5 powerpc/85xx: Add suspend/resume support

This patch adds suspend/resume support for MPC8540-compatible and MPC8569 CPUs.

MPC8540-compatible PMCs are trivial: we just write SLP bit into PM control and status register.

MPC8569 is a bit trickier, QE turns off during suspend and so on resume we must reload QE microcode firmware and reset QE.

So far we don't support Deep Sleep mode as found in newer MPC85xx CPUs (i.e. MPC8536). It can be relatively easy implemented though, and for it we reserve 'mem' suspend type.

---
 arch/powerpc/Kconfig                  |    2 +-
 arch/powerpc/platforms/85xx/Makefile  |    1 +
 arch/powerpc/platforms/85xx/suspend.c |  115 +++++++++++++++++++++++++++++++++
 3 files changed, 117 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/platforms/85xx/suspend.c
arch/powerpc/Kconfig +1 -1
index d00131c..46ebfe6 100644
@@ -212,7 +212,7 @@ config ARCH_HIBERNATION_POSSIBLE
 
 config ARCH_SUSPEND_POSSIBLE
 	def_bool y
-	depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx
+	depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx || PPC_85xx
 
 config PPC_DCR_NATIVE
 	bool
arch/powerpc/platforms/85xx/Makefile +1 -0
index 835733f..cd1ad6e 100644
@@ -2,6 +2,7 @@
 # Makefile for the PowerPC 85xx linux kernel.
 #
 obj-$(CONFIG_SMP) += smp.o
+obj-$(CONFIG_SUSPEND) += suspend.o
 
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
arch/powerpc/platforms/85xx/suspend.c new file +115 -0

115 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 13 lines · Anton Vorontsov

This patch adds suspend/resume support for MPC8540-compatible and MPC8569 CPUs.

MPC8540-compatible PMCs are trivial: we just write SLP bit into PM control and status register.

MPC8569 is a bit trickier, QE turns off during suspend and so on resume we must reload QE microcode firmware and reset QE.

So far we don't support Deep Sleep mode as found in newer MPC85xx CPUs (i.e. MPC8536). It can be relatively easy implemented though, and for it we reserve 'mem' suspend type.

Quoted 8 lines

---

arch/powerpc/Kconfig                  |    2 +-
arch/powerpc/platforms/85xx/Makefile  |    1 +
arch/powerpc/platforms/85xx/suspend.c |  115 ++++++++++++++++++++++++ 
+++++++++
3 files changed, 117 insertions(+), 1 deletions(-)

create mode 100644 arch/powerpc/platforms/85xx/suspend.c

How did you test this?

I'd also like to get Scott's Ack on this and the device tree patches before accepting them.

- k

#2 lore raw
Quoted 25 lines · Kumar Gala
Quoted 13 lines · Anton Vorontsov

This patch adds suspend/resume support for MPC8540-compatible and MPC8569 CPUs.

MPC8540-compatible PMCs are trivial: we just write SLP bit into PM control and status register.

MPC8569 is a bit trickier, QE turns off during suspend and so on resume we must reload QE microcode firmware and reset QE.

So far we don't support Deep Sleep mode as found in newer MPC85xx CPUs (i.e. MPC8536). It can be relatively easy implemented though, and for it we reserve 'mem' suspend type.

Quoted 8 lines

---

arch/powerpc/Kconfig                  |    2 +-
arch/powerpc/platforms/85xx/Makefile  |    1 +
arch/powerpc/platforms/85xx/suspend.c |  115
+++++++++++++++++++++++++++++++++
3 files changed, 117 insertions(+), 1 deletions(-)

create mode 100644 arch/powerpc/platforms/85xx/suspend.c

Quoted 1 line

How did you test this?

--- Prerequisites:

1. Following patches should be applied in addition:

rtc: Set wakeup capability for I2C and SPI RTC drivers [5/5] ucc_geth: Implement suspend/resume and Wake-On-LAN support [4/5] ucc_geth: Remove UGETH_MAGIC_PACKET Kconfig symbol and code [3/5] ucc_geth: Factor out MAC initialization steps into a call [2/5] powerpc/qe: Implement qe_alive_during_sleep() helper function [1/5] ucc_geth: Fix NULL pointer dereference in uec_get_ethtool_stats()

2. QE microcode should be placed into /lib/firmware/, i.e.
wget http://opensource.freescale.com/firmware/fsl_qe_ucode_8569_10.zip
unzip fsl_qe_ucode_8569_10.zip
cp fsl_qe_ucode_8569_10.bin /<nfsroot>/lib/firmware/fsl_qe_ucode_8569.bin

--- Wakeup on RTC alarm:

# cd /sys/class/rtc/rtc0/
# echo $(( `cat since_epoch` + 10 )) > wakealarm
# echo standby > /sys/power/state
mpc85xx-pmc e00e0080.power: firmware: requesting fsl_qe_ucode_8569.bin
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.02 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.

The board is now suspended, CPU asserted ASLEEP signal that is reflected by the ASLEEP LED on the board (the LED is near UEC2 port). 10 seconds later the board will wakeup:

qe-firmware: firmware 'MPC8569 QE Microcode Rel_B6900155' for 8569 V1.0
qe-firmware: uploading microcode 'MPC8569 QE Microcode Rel_B69001' version 1.0.0 pci 0000:00:00.0: enabling device (0106 -> 0107)
Restarting tasks ... done.
PHY: mdio@e0082120:07 - Link is Up - 100/Full

--- Wakeup on PHY/link changes (no magic packet support in MPC8569, as
QE turns off during sleep):

# ethtool -s eth0 wol p
# echo standby > /sys/power/state
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.00 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.

To wakeup, trigger the PHY interrupt (e.g. pull out the ethernet cable from eth0):

qe-firmware: firmware 'MPC8569 QE Microcode Rel_B6900155' for 8569 V1.0
qe-firmware: uploading microcode 'MPC8569 QE Microcode Rel_B69001' version 1.0.0 pci 0000:00:00.0: enabling device (0106 -> 0107)
Restarting tasks ... done.

UCC magic packet detection was tested on MPC8360E-MDS boards (ethtool -s eth0 wol g), I'll send power management support patches for 83xx QE boards soon.

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2