diff options
author | Olof Johansson <olof@lixom.net> | 2007-02-04 17:36:51 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-02-06 22:03:22 -0500 |
commit | 1199919b69ff9559a3d3444fb5eb45b7cc48264d (patch) | |
tree | 40313402be457e274e777b385703b25fa359f9b2 /arch/powerpc/kernel | |
parent | bfed9d32d968b2054a036d419537e9e9909bb343 (diff) |
[POWERPC] pasemi: Idle loops
Powersave support on PA6T. Right now it only uses 'doze' mode, and
will default to no savings (spin).
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_pa6t.S | 44 | ||||
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 4 |
3 files changed, 49 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index d2ded19e4064..8120d428ebfd 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -17,6 +17,7 @@ obj-y += vdso32/ | |||
17 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ | 17 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ |
18 | signal_64.o ptrace32.o \ | 18 | signal_64.o ptrace32.o \ |
19 | paca.o cpu_setup_ppc970.o \ | 19 | paca.o cpu_setup_ppc970.o \ |
20 | cpu_setup_pa6t.o \ | ||
20 | firmware.o sysfs.o nvram_64.o | 21 | firmware.o sysfs.o nvram_64.o |
21 | obj-$(CONFIG_PPC64) += vdso64/ | 22 | obj-$(CONFIG_PPC64) += vdso64/ |
22 | obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o | 23 | obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o |
diff --git a/arch/powerpc/kernel/cpu_setup_pa6t.S b/arch/powerpc/kernel/cpu_setup_pa6t.S new file mode 100644 index 000000000000..4047be25c4d2 --- /dev/null +++ b/arch/powerpc/kernel/cpu_setup_pa6t.S | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006-2007 PA Semi, Inc | ||
3 | * | ||
4 | * Maintained by: Olof Johansson <olof@lixom.net> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #include <asm/processor.h> | ||
22 | #include <asm/page.h> | ||
23 | #include <asm/cputable.h> | ||
24 | #include <asm/ppc_asm.h> | ||
25 | #include <asm/asm-offsets.h> | ||
26 | #include <asm/cache.h> | ||
27 | |||
28 | /* Right now, restore and setup are the same thing */ | ||
29 | _GLOBAL(__restore_cpu_pa6t) | ||
30 | _GLOBAL(__setup_cpu_pa6t) | ||
31 | /* Do nothing if not running in HV mode */ | ||
32 | mfmsr r0 | ||
33 | rldicl. r0,r0,4,63 | ||
34 | beqlr | ||
35 | |||
36 | mfspr r0,SPRN_HID5 | ||
37 | ori r0,r0,0x30 | ||
38 | mtspr SPRN_HID5,r0 | ||
39 | |||
40 | mfspr r0,SPRN_LPCR | ||
41 | ori r0,r0,0x7000 | ||
42 | mtspr SPRN_LPCR,r0 | ||
43 | |||
44 | blr | ||
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 4939b3d56dfb..dd17dffbf058 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -43,6 +43,8 @@ extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec); | |||
43 | #ifdef CONFIG_PPC64 | 43 | #ifdef CONFIG_PPC64 |
44 | extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec); | 44 | extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec); |
45 | extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec); | 45 | extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec); |
46 | extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec); | ||
47 | extern void __restore_cpu_pa6t(unsigned long offset, struct cpu_spec* spec); | ||
46 | extern void __restore_cpu_ppc970(void); | 48 | extern void __restore_cpu_ppc970(void); |
47 | #endif /* CONFIG_PPC64 */ | 49 | #endif /* CONFIG_PPC64 */ |
48 | 50 | ||
@@ -369,6 +371,8 @@ static struct cpu_spec cpu_specs[] = { | |||
369 | .dcache_bsize = 64, | 371 | .dcache_bsize = 64, |
370 | .num_pmcs = 6, | 372 | .num_pmcs = 6, |
371 | .pmc_type = PPC_PMC_PA6T, | 373 | .pmc_type = PPC_PMC_PA6T, |
374 | .cpu_setup = __setup_cpu_pa6t, | ||
375 | .cpu_restore = __restore_cpu_pa6t, | ||
372 | .platform = "pa6t", | 376 | .platform = "pa6t", |
373 | }, | 377 | }, |
374 | { /* default match */ | 378 | { /* default match */ |