aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-09-13 02:44:20 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-09-14 09:53:30 -0400
commit5e14d21e3f28a4181dacff0336040e30942f4921 (patch)
treeebaa8217d5af80e15116960641a0bf87a8b5d717 /include/asm-powerpc
parentd8f1324a5063c833862328ceafabc53ac3cc4f71 (diff)
[POWERPC] Add cpu feature for SPE handling
Make it so that SPE support can be determined at runtime. This is similiar to how we handle AltiVec. This allows us to have SPE support built in and work on processors with and without SPE. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/cputable.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 3dc8e2dfca8..f62cffd56c0 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -136,6 +136,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
136#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) 136#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000)
137#define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000) 137#define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000)
138#define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000) 138#define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000)
139#define CPU_FTR_SPE ASM_CONST(0x0000000002000000)
139 140
140/* 141/*
141 * Add the 64-bit processor unique features in the top half of the word; 142 * Add the 64-bit processor unique features in the top half of the word;
@@ -180,6 +181,21 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
180#define PPC_FEATURE_HAS_ALTIVEC_COMP 0 181#define PPC_FEATURE_HAS_ALTIVEC_COMP 0
181#endif 182#endif
182 183
184/* We only set the spe features if the kernel was compiled with spe
185 * support
186 */
187#ifdef CONFIG_SPE
188#define CPU_FTR_SPE_COMP CPU_FTR_SPE
189#define PPC_FEATURE_HAS_SPE_COMP PPC_FEATURE_HAS_SPE
190#define PPC_FEATURE_HAS_EFP_SINGLE_COMP PPC_FEATURE_HAS_EFP_SINGLE
191#define PPC_FEATURE_HAS_EFP_DOUBLE_COMP PPC_FEATURE_HAS_EFP_DOUBLE
192#else
193#define CPU_FTR_SPE_COMP 0
194#define PPC_FEATURE_HAS_SPE_COMP 0
195#define PPC_FEATURE_HAS_EFP_SINGLE_COMP 0
196#define PPC_FEATURE_HAS_EFP_DOUBLE_COMP 0
197#endif
198
183/* We need to mark all pages as being coherent if we're SMP or we 199/* We need to mark all pages as being coherent if we're SMP or we
184 * have a 74[45]x and an MPC107 host bridge. Also 83xx requires 200 * have a 74[45]x and an MPC107 host bridge. Also 83xx requires
185 * it for PCI "streaming/prefetch" to work properly. 201 * it for PCI "streaming/prefetch" to work properly.
@@ -310,10 +326,12 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
310#define CPU_FTRS_8XX (CPU_FTR_USE_TB) 326#define CPU_FTRS_8XX (CPU_FTR_USE_TB)
311#define CPU_FTRS_40X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) 327#define CPU_FTRS_40X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
312#define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) 328#define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
313#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \ 329#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
314 CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE) 330 CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \
315#define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) 331 CPU_FTR_UNIFIED_ID_CACHE)
316#define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | \ 332#define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
333 CPU_FTR_NODSISRALIGN)
334#define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
317 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) 335 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN)
318#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 336#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
319 337