Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80986
b: refs/heads/master
c: 8b32bc0
h: refs/heads/master
v: v3
  • Loading branch information
Olof Johansson committed Dec 1, 2007
1 parent 29acaa0 commit eaa2533
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d08a84770cb03aea24268e515342d44df8ea588
refs/heads/master: 8b32bc03256c82a6a4fcb3c2520b54469b74ec82
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/platforms/pasemi/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/time.h>
#include <asm/smp.h>

#define SDCASR_REG 0x0100
#define SDCASR_REG_STRIDE 0x1000
Expand Down Expand Up @@ -124,6 +125,11 @@ static void set_astate(int cpu, unsigned int astate)
local_irq_restore(flags);
}

int check_astate(void)
{
return get_cur_astate(hard_smp_processor_id());
}

void restore_astate(int cpu)
{
set_astate(cpu, current_astate);
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/platforms/pasemi/pasemi.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ extern void idle_doze(void);

/* Restore astate to last set */
#ifdef CONFIG_PPC_PASEMI_CPUFREQ
extern int check_astate(void);
extern void restore_astate(int cpu);
#else
static inline int check_astate(void)
{
/* Always return >0 so we never power save */
return 1;
}
static inline void restore_astate(int cpu)
{
}
Expand Down
11 changes: 10 additions & 1 deletion trunk/arch/powerpc/platforms/pasemi/powersave.S
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ sleep_common:
mflr r0
std r0, 16(r1)
stdu r1,-64(r1)
#ifdef CONFIG_PPC_PASEMI_CPUFREQ
std r3, 48(r1)

/* Only do power savings when in astate 0 */
bl .check_astate
cmpwi r3,0
bne 1f

ld r3, 48(r1)
#endif
LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE)
mfmsr r4
andc r5,r4,r6
Expand All @@ -73,7 +82,7 @@ sleep_common:

mtmsrd r4,0

addi r1,r1,64
1: addi r1,r1,64
ld r0,16(r1)
mtlr r0
blr
Expand Down

0 comments on commit eaa2533

Please sign in to comment.