aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-highbank/pm.c
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-09-26 21:02:51 -0400
committerRob Herring <rob.herring@calxeda.com>2013-10-01 17:34:16 -0400
commitdd68eb02e4598d81e9e42400ccbd2cc42f012bfa (patch)
tree4d66a3da8725f9216feb945821c42fa99bce1d83 /arch/arm/mach-highbank/pm.c
parent97fc4de3d93fea934b0ec8332465b9f1899a9adb (diff)
ARM: highbank: adapt to use ARM PSCI calls
This adapts highbank to use psci for smp_ops and the cpu_suspend function for suspend/resume. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'arch/arm/mach-highbank/pm.c')
-rw-r--r--arch/arm/mach-highbank/pm.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c
index 04eddb4f4380..7f2bd85eb935 100644
--- a/arch/arm/mach-highbank/pm.c
+++ b/arch/arm/mach-highbank/pm.c
@@ -16,27 +16,19 @@
16 16
17#include <linux/cpu_pm.h> 17#include <linux/cpu_pm.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h>
20#include <linux/suspend.h> 19#include <linux/suspend.h>
21 20
22#include <asm/cacheflush.h>
23#include <asm/proc-fns.h>
24#include <asm/suspend.h> 21#include <asm/suspend.h>
25 22#include <asm/psci.h>
26#include "core.h"
27#include "sysregs.h"
28 23
29static int highbank_suspend_finish(unsigned long val) 24static int highbank_suspend_finish(unsigned long val)
30{ 25{
31 outer_flush_all(); 26 const struct psci_power_state ps = {
32 outer_disable(); 27 .type = PSCI_POWER_STATE_TYPE_POWER_DOWN,
33 28 .affinity_level = 1,
34 highbank_set_pwr_suspend(); 29 };
35
36 cpu_do_idle();
37 30
38 highbank_clear_pwr_request(); 31 return psci_ops.cpu_suspend(ps, __pa(cpu_resume));
39 return 0;
40} 32}
41 33
42static int highbank_pm_enter(suspend_state_t state) 34static int highbank_pm_enter(suspend_state_t state)
@@ -44,15 +36,11 @@ static int highbank_pm_enter(suspend_state_t state)
44 cpu_pm_enter(); 36 cpu_pm_enter();
45 cpu_cluster_pm_enter(); 37 cpu_cluster_pm_enter();
46 38
47 highbank_set_cpu_jump(0, cpu_resume);
48 cpu_suspend(0, highbank_suspend_finish); 39 cpu_suspend(0, highbank_suspend_finish);
49 40
50 cpu_cluster_pm_exit(); 41 cpu_cluster_pm_exit();
51 cpu_pm_exit(); 42 cpu_pm_exit();
52 43
53 highbank_smc1(0x102, 0x1);
54 if (scu_base_addr)
55 scu_enable(scu_base_addr);
56 return 0; 44 return 0;
57} 45}
58 46
@@ -63,5 +51,8 @@ static const struct platform_suspend_ops highbank_pm_ops = {
63 51
64void __init highbank_pm_init(void) 52void __init highbank_pm_init(void)
65{ 53{
54 if (!psci_ops.cpu_suspend)
55 return;
56
66 suspend_set_ops(&highbank_pm_ops); 57 suspend_set_ops(&highbank_pm_ops);
67} 58}