aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-highbank/highbank.c2
-rw-r--r--drivers/cpuidle/Kconfig.arm2
-rw-r--r--drivers/cpuidle/cpuidle-calxeda.c39
3 files changed, 8 insertions, 35 deletions
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index a78ed62d6542..53d05bc904f9 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -168,7 +168,7 @@ static void __init highbank_init(void)
168 168
169 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 169 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
170 170
171 if (of_machine_is_compatible("calxeda,highbank")) 171 if (psci_ops.cpu_suspend)
172 platform_device_register(&highbank_cpuidle_device); 172 platform_device_register(&highbank_cpuidle_device);
173} 173}
174 174
diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm
index 8e3660322308..d6f57d5d9631 100644
--- a/drivers/cpuidle/Kconfig.arm
+++ b/drivers/cpuidle/Kconfig.arm
@@ -4,7 +4,7 @@
4 4
5config ARM_HIGHBANK_CPUIDLE 5config ARM_HIGHBANK_CPUIDLE
6 bool "CPU Idle Driver for Calxeda processors" 6 bool "CPU Idle Driver for Calxeda processors"
7 depends on ARCH_HIGHBANK 7 depends on ARM_PSCI
8 select ARM_CPU_SUSPEND 8 select ARM_CPU_SUSPEND
9 help 9 help
10 Select this to enable cpuidle on Calxeda processors. 10 Select this to enable cpuidle on Calxeda processors.
diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
index 6d49527d4a0c..36795639df0d 100644
--- a/drivers/cpuidle/cpuidle-calxeda.c
+++ b/drivers/cpuidle/cpuidle-calxeda.c
@@ -23,44 +23,18 @@
23#include <linux/cpuidle.h> 23#include <linux/cpuidle.h>
24#include <linux/cpu_pm.h> 24#include <linux/cpu_pm.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/io.h> 26#include <linux/mm.h>
27#include <linux/time.h>
28#include <linux/delay.h>
29#include <linux/suspend.h>
30#include <linux/platform_device.h> 27#include <linux/platform_device.h>
31#include <asm/cpuidle.h> 28#include <asm/cpuidle.h>
32#include <asm/proc-fns.h>
33#include <asm/smp_scu.h>
34#include <asm/suspend.h> 29#include <asm/suspend.h>
35#include <asm/cacheflush.h> 30#include <asm/psci.h>
36#include <asm/cp15.h>
37
38extern void highbank_set_cpu_jump(int cpu, void *jump_addr);
39extern void __iomem *scu_base_addr;
40
41static noinline void calxeda_idle_restore(void)
42{
43 set_cr(get_cr() | CR_C);
44 set_auxcr(get_auxcr() | 0x40);
45 scu_power_mode(scu_base_addr, SCU_PM_NORMAL);
46}
47 31
48static int calxeda_idle_finish(unsigned long val) 32static int calxeda_idle_finish(unsigned long val)
49{ 33{
50 /* Already flushed cache, but do it again as the outer cache functions 34 const struct psci_power_state ps = {
51 * dirty the cache with spinlocks */ 35 .type = PSCI_POWER_STATE_TYPE_POWER_DOWN,
52 flush_cache_all(); 36 };
53 37 return psci_ops.cpu_suspend(ps, __pa(cpu_resume));
54 set_auxcr(get_auxcr() & ~0x40);
55 set_cr(get_cr() & ~CR_C);
56
57 scu_power_mode(scu_base_addr, SCU_PM_DORMANT);
58
59 cpu_do_idle();
60
61 /* Restore things if we didn't enter power-gating */
62 calxeda_idle_restore();
63 return 1;
64} 38}
65 39
66static int calxeda_pwrdown_idle(struct cpuidle_device *dev, 40static int calxeda_pwrdown_idle(struct cpuidle_device *dev,
@@ -68,7 +42,6 @@ static int calxeda_pwrdown_idle(struct cpuidle_device *dev,
68 int index) 42 int index)
69{ 43{
70 cpu_pm_enter(); 44 cpu_pm_enter();
71 highbank_set_cpu_jump(smp_processor_id(), cpu_resume);
72 cpu_suspend(0, calxeda_idle_finish); 45 cpu_suspend(0, calxeda_idle_finish);
73 cpu_pm_exit(); 46 cpu_pm_exit();
74 47