diff options
-rw-r--r-- | arch/powerpc/platforms/pasemi/cpufreq.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/pasemi.h | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/powersave.S | 11 |
3 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c index 8caa1667cf34..58556b028a4c 100644 --- a/arch/powerpc/platforms/pasemi/cpufreq.c +++ b/arch/powerpc/platforms/pasemi/cpufreq.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/io.h> | 32 | #include <asm/io.h> |
33 | #include <asm/prom.h> | 33 | #include <asm/prom.h> |
34 | #include <asm/time.h> | 34 | #include <asm/time.h> |
35 | #include <asm/smp.h> | ||
35 | 36 | ||
36 | #define SDCASR_REG 0x0100 | 37 | #define SDCASR_REG 0x0100 |
37 | #define SDCASR_REG_STRIDE 0x1000 | 38 | #define SDCASR_REG_STRIDE 0x1000 |
@@ -124,6 +125,11 @@ static void set_astate(int cpu, unsigned int astate) | |||
124 | local_irq_restore(flags); | 125 | local_irq_restore(flags); |
125 | } | 126 | } |
126 | 127 | ||
128 | int check_astate(void) | ||
129 | { | ||
130 | return get_cur_astate(hard_smp_processor_id()); | ||
131 | } | ||
132 | |||
127 | void restore_astate(int cpu) | 133 | void restore_astate(int cpu) |
128 | { | 134 | { |
129 | set_astate(cpu, current_astate); | 135 | set_astate(cpu, current_astate); |
diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h index 516acabb4e96..c96127b029b6 100644 --- a/arch/powerpc/platforms/pasemi/pasemi.h +++ b/arch/powerpc/platforms/pasemi/pasemi.h | |||
@@ -16,8 +16,14 @@ extern void idle_doze(void); | |||
16 | 16 | ||
17 | /* Restore astate to last set */ | 17 | /* Restore astate to last set */ |
18 | #ifdef CONFIG_PPC_PASEMI_CPUFREQ | 18 | #ifdef CONFIG_PPC_PASEMI_CPUFREQ |
19 | extern int check_astate(void); | ||
19 | extern void restore_astate(int cpu); | 20 | extern void restore_astate(int cpu); |
20 | #else | 21 | #else |
22 | static inline int check_astate(void) | ||
23 | { | ||
24 | /* Always return >0 so we never power save */ | ||
25 | return 1; | ||
26 | } | ||
21 | static inline void restore_astate(int cpu) | 27 | static inline void restore_astate(int cpu) |
22 | { | 28 | { |
23 | } | 29 | } |
diff --git a/arch/powerpc/platforms/pasemi/powersave.S b/arch/powerpc/platforms/pasemi/powersave.S index 6d0fba6aab17..56f45adcd089 100644 --- a/arch/powerpc/platforms/pasemi/powersave.S +++ b/arch/powerpc/platforms/pasemi/powersave.S | |||
@@ -62,7 +62,16 @@ sleep_common: | |||
62 | mflr r0 | 62 | mflr r0 |
63 | std r0, 16(r1) | 63 | std r0, 16(r1) |
64 | stdu r1,-64(r1) | 64 | stdu r1,-64(r1) |
65 | #ifdef CONFIG_PPC_PASEMI_CPUFREQ | ||
66 | std r3, 48(r1) | ||
65 | 67 | ||
68 | /* Only do power savings when in astate 0 */ | ||
69 | bl .check_astate | ||
70 | cmpwi r3,0 | ||
71 | bne 1f | ||
72 | |||
73 | ld r3, 48(r1) | ||
74 | #endif | ||
66 | LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE) | 75 | LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE) |
67 | mfmsr r4 | 76 | mfmsr r4 |
68 | andc r5,r4,r6 | 77 | andc r5,r4,r6 |
@@ -73,7 +82,7 @@ sleep_common: | |||
73 | 82 | ||
74 | mtmsrd r4,0 | 83 | mtmsrd r4,0 |
75 | 84 | ||
76 | addi r1,r1,64 | 85 | 1: addi r1,r1,64 |
77 | ld r0,16(r1) | 86 | ld r0,16(r1) |
78 | mtlr r0 | 87 | mtlr r0 |
79 | blr | 88 | blr |