aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Pitre <nico@linaro.org>2012-12-10 00:22:06 -0500
committerPawel Moll <pawel.moll@arm.com>2013-08-07 09:55:54 -0400
commite607b0f985f5277324e3fdce5bb462ef4eac4bc9 (patch)
treee78ab25deb5674e236cc44671676cac199590d76
parent11b277eabe7005f5c6f2c200b1e26a237badb114 (diff)
ARM: vexpress/TC2: implement PM suspend method
Similar to power_down(), except that for a suspend, the firmware mailbox address has to be set prior entering low power mode. The residency argument is not used yet, so the last man always shuts down the cluster for now. Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Pawel Moll <pawel.moll@arm.com>
-rw-r--r--arch/arm/mach-vexpress/tc2_pm.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c
index cdc606816cdd..ddd97dd4e9b7 100644
--- a/arch/arm/mach-vexpress/tc2_pm.c
+++ b/arch/arm/mach-vexpress/tc2_pm.c
@@ -95,7 +95,7 @@ static int tc2_pm_power_up(unsigned int cpu, unsigned int cluster)
95 return 0; 95 return 0;
96} 96}
97 97
98static void tc2_pm_power_down(void) 98static void tc2_pm_down(u64 residency)
99{ 99{
100 unsigned int mpidr, cpu, cluster; 100 unsigned int mpidr, cpu, cluster;
101 bool last_man = false, skip_wfi = false; 101 bool last_man = false, skip_wfi = false;
@@ -209,6 +209,22 @@ static void tc2_pm_power_down(void)
209 /* Not dead at this point? Let our caller cope. */ 209 /* Not dead at this point? Let our caller cope. */
210} 210}
211 211
212static void tc2_pm_power_down(void)
213{
214 tc2_pm_down(0);
215}
216
217static void tc2_pm_suspend(u64 residency)
218{
219 unsigned int mpidr, cpu, cluster;
220
221 mpidr = read_cpuid_mpidr();
222 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
223 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
224 ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point));
225 tc2_pm_down(residency);
226}
227
212static void tc2_pm_powered_up(void) 228static void tc2_pm_powered_up(void)
213{ 229{
214 unsigned int mpidr, cpu, cluster; 230 unsigned int mpidr, cpu, cluster;
@@ -242,6 +258,7 @@ static void tc2_pm_powered_up(void)
242static const struct mcpm_platform_ops tc2_pm_power_ops = { 258static const struct mcpm_platform_ops tc2_pm_power_ops = {
243 .power_up = tc2_pm_power_up, 259 .power_up = tc2_pm_power_up,
244 .power_down = tc2_pm_power_down, 260 .power_down = tc2_pm_power_down,
261 .suspend = tc2_pm_suspend,
245 .powered_up = tc2_pm_powered_up, 262 .powered_up = tc2_pm_powered_up,
246}; 263};
247 264