diff options
author | Jimi Xenidis <jimix@pobox.com> | 2011-09-29 06:55:13 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-11-24 22:11:28 -0500 |
commit | fac26ad4f9cb794c9d1032f55f40a31cb55be09a (patch) | |
tree | 6acb31ab3fbc959de6f62aa4dd6ea08c004205f4 /arch | |
parent | 9d670280908013004f173b2b86414d9b6918511b (diff) |
powerpc/book3e: Add ICSWX/ACOP support to Book3e cores like A2
ICSWX is also used by the A2 processor to access coprocessors,
although not all "chips" that contain A2s have coprocessors.
Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/cputable.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/mmu-book3e.h | 4 | ||||
-rw-r--r-- | arch/powerpc/include/asm/reg_booke.h | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_a2.S | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/wsp/Kconfig | 1 |
6 files changed, 19 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index e30442c539ce..7044233124ba 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h | |||
@@ -437,7 +437,7 @@ extern const char *powerpc_base_platform; | |||
437 | #define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2) | 437 | #define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2) |
438 | 438 | ||
439 | #define CPU_FTRS_A2 (CPU_FTR_USE_TB | CPU_FTR_SMT | CPU_FTR_DBELL | \ | 439 | #define CPU_FTRS_A2 (CPU_FTR_USE_TB | CPU_FTR_SMT | CPU_FTR_DBELL | \ |
440 | CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN) | 440 | CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN | CPU_FTR_ICSWX) |
441 | 441 | ||
442 | #ifdef __powerpc64__ | 442 | #ifdef __powerpc64__ |
443 | #ifdef CONFIG_PPC_BOOK3E | 443 | #ifdef CONFIG_PPC_BOOK3E |
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h index 0260ea5ec3c2..50210b9b0147 100644 --- a/arch/powerpc/include/asm/mmu-book3e.h +++ b/arch/powerpc/include/asm/mmu-book3e.h | |||
@@ -214,6 +214,10 @@ typedef struct { | |||
214 | unsigned int id; | 214 | unsigned int id; |
215 | unsigned int active; | 215 | unsigned int active; |
216 | unsigned long vdso_base; | 216 | unsigned long vdso_base; |
217 | #ifdef CONFIG_PPC_ICSWX | ||
218 | struct spinlock *cop_lockp; /* guard cop related stuff */ | ||
219 | unsigned long acop; /* mask of enabled coprocessor types */ | ||
220 | #endif /* CONFIG_PPC_ICSWX */ | ||
217 | #ifdef CONFIG_PPC_MM_SLICES | 221 | #ifdef CONFIG_PPC_MM_SLICES |
218 | u64 low_slices_psize; /* SLB page size encodings */ | 222 | u64 low_slices_psize; /* SLB page size encodings */ |
219 | u64 high_slices_psize; /* 4 bits per slice for now */ | 223 | u64 high_slices_psize; /* 4 bits per slice for now */ |
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index 03c48e819c8e..500fe1dc43e6 100644 --- a/arch/powerpc/include/asm/reg_booke.h +++ b/arch/powerpc/include/asm/reg_booke.h | |||
@@ -187,6 +187,10 @@ | |||
187 | #define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */ | 187 | #define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */ |
188 | #endif | 188 | #endif |
189 | 189 | ||
190 | #ifdef CONFIG_PPC_ICSWX | ||
191 | #define SPRN_HACOP 0x15F /* Hypervisor Available Coprocessor Register */ | ||
192 | #endif | ||
193 | |||
190 | /* Bit definitions for CCR1. */ | 194 | /* Bit definitions for CCR1. */ |
191 | #define CCR1_DPC 0x00000100 /* Disable L1 I-Cache/D-Cache parity checking */ | 195 | #define CCR1_DPC 0x00000100 /* Disable L1 I-Cache/D-Cache parity checking */ |
192 | #define CCR1_TCS 0x00000080 /* Timer Clock Select */ | 196 | #define CCR1_TCS 0x00000080 /* Timer Clock Select */ |
diff --git a/arch/powerpc/kernel/cpu_setup_a2.S b/arch/powerpc/kernel/cpu_setup_a2.S index 7f818feaa7a5..ebc62f42a237 100644 --- a/arch/powerpc/kernel/cpu_setup_a2.S +++ b/arch/powerpc/kernel/cpu_setup_a2.S | |||
@@ -41,11 +41,16 @@ _GLOBAL(__setup_cpu_a2) | |||
41 | * core local but doing it always won't hurt | 41 | * core local but doing it always won't hurt |
42 | */ | 42 | */ |
43 | 43 | ||
44 | #ifdef CONFIG_PPC_WSP_COPRO | 44 | #ifdef CONFIG_PPC_ICSWX |
45 | /* Make sure ACOP starts out as zero */ | 45 | /* Make sure ACOP starts out as zero */ |
46 | li r3,0 | 46 | li r3,0 |
47 | mtspr SPRN_ACOP,r3 | 47 | mtspr SPRN_ACOP,r3 |
48 | 48 | ||
49 | /* Skip the following if we are in Guest mode */ | ||
50 | mfmsr r3 | ||
51 | andis. r0,r3,MSR_GS@h | ||
52 | bne _icswx_skip_guest | ||
53 | |||
49 | /* Enable icswx instruction */ | 54 | /* Enable icswx instruction */ |
50 | mfspr r3,SPRN_A2_CCR2 | 55 | mfspr r3,SPRN_A2_CCR2 |
51 | ori r3,r3,A2_CCR2_ENABLE_ICSWX | 56 | ori r3,r3,A2_CCR2_ENABLE_ICSWX |
@@ -54,7 +59,8 @@ _GLOBAL(__setup_cpu_a2) | |||
54 | /* Unmask all CTs in HACOP */ | 59 | /* Unmask all CTs in HACOP */ |
55 | li r3,-1 | 60 | li r3,-1 |
56 | mtspr SPRN_HACOP,r3 | 61 | mtspr SPRN_HACOP,r3 |
57 | #endif /* CONFIG_PPC_WSP_COPRO */ | 62 | _icswx_skip_guest: |
63 | #endif /* CONFIG_PPC_ICSWX */ | ||
58 | 64 | ||
59 | /* Enable doorbell */ | 65 | /* Enable doorbell */ |
60 | mfspr r3,SPRN_A2_CCR2 | 66 | mfspr r3,SPRN_A2_CCR2 |
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index a67105aeeda8..46d2a7c77dc0 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -236,7 +236,7 @@ config VSX | |||
236 | 236 | ||
237 | config PPC_ICSWX | 237 | config PPC_ICSWX |
238 | bool "Support for PowerPC icswx coprocessor instruction" | 238 | bool "Support for PowerPC icswx coprocessor instruction" |
239 | depends on POWER4 | 239 | depends on POWER4 || PPC_A2 |
240 | default n | 240 | default n |
241 | ---help--- | 241 | ---help--- |
242 | 242 | ||
diff --git a/arch/powerpc/platforms/wsp/Kconfig b/arch/powerpc/platforms/wsp/Kconfig index bd560c786ed6..43a3b00261e7 100644 --- a/arch/powerpc/platforms/wsp/Kconfig +++ b/arch/powerpc/platforms/wsp/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config PPC_WSP | 1 | config PPC_WSP |
2 | bool | 2 | bool |
3 | select PPC_A2 | 3 | select PPC_A2 |
4 | select PPC_ICSWX | ||
4 | select PPC_SCOM | 5 | select PPC_SCOM |
5 | select PPC_XICS | 6 | select PPC_XICS |
6 | select PPC_ICP_NATIVE | 7 | select PPC_ICP_NATIVE |