aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2008-06-25 00:07:18 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 21:28:47 -0400
commitb962ce9d26fd6677e6720949642420ceb029a102 (patch)
treedd05752d5f48204b3b87f8330be043b9c39745a8
parentc6e6771b87d4e339d27f1383c8a808ae9b4ee5b8 (diff)
powerpc: Add VSX CPU feature
Add a VSX CPU feature. Also add code to detect if VSX is available from the device tree. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Joel Schopp <jschopp@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/kernel/prom.c4
-rw-r--r--include/asm-powerpc/cputable.h15
2 files changed, 18 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 2aefe2a4129a..87d83c56b31e 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -609,6 +609,10 @@ static struct feature_property {
609 {"altivec", 0, CPU_FTR_ALTIVEC, PPC_FEATURE_HAS_ALTIVEC}, 609 {"altivec", 0, CPU_FTR_ALTIVEC, PPC_FEATURE_HAS_ALTIVEC},
610 {"ibm,vmx", 1, CPU_FTR_ALTIVEC, PPC_FEATURE_HAS_ALTIVEC}, 610 {"ibm,vmx", 1, CPU_FTR_ALTIVEC, PPC_FEATURE_HAS_ALTIVEC},
611#endif /* CONFIG_ALTIVEC */ 611#endif /* CONFIG_ALTIVEC */
612#ifdef CONFIG_VSX
613 /* Yes, this _really_ is ibm,vmx == 2 to enable VSX */
614 {"ibm,vmx", 2, CPU_FTR_VSX, PPC_FEATURE_HAS_VSX},
615#endif /* CONFIG_VSX */
612#ifdef CONFIG_PPC64 616#ifdef CONFIG_PPC64
613 {"ibm,dfp", 1, 0, PPC_FEATURE_HAS_DFP}, 617 {"ibm,dfp", 1, 0, PPC_FEATURE_HAS_DFP},
614 {"ibm,purr", 1, CPU_FTR_PURR, 0}, 618 {"ibm,purr", 1, CPU_FTR_PURR, 0},
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 0d96b0284a73..4e4491cb9d3b 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -25,6 +25,7 @@
25#define PPC_FEATURE_HAS_DFP 0x00000400 25#define PPC_FEATURE_HAS_DFP 0x00000400
26#define PPC_FEATURE_POWER6_EXT 0x00000200 26#define PPC_FEATURE_POWER6_EXT 0x00000200
27#define PPC_FEATURE_ARCH_2_06 0x00000100 27#define PPC_FEATURE_ARCH_2_06 0x00000100
28#define PPC_FEATURE_HAS_VSX 0x00000080
28 29
29#define PPC_FEATURE_TRUE_LE 0x00000002 30#define PPC_FEATURE_TRUE_LE 0x00000002
30#define PPC_FEATURE_PPC_LE 0x00000001 31#define PPC_FEATURE_PPC_LE 0x00000001
@@ -183,6 +184,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
183#define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000) 184#define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000)
184#define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000) 185#define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000)
185#define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000) 186#define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000)
187#define CPU_FTR_VSX LONG_ASM_CONST(0x0010000000000000)
186 188
187#ifndef __ASSEMBLY__ 189#ifndef __ASSEMBLY__
188 190
@@ -201,6 +203,17 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
201#define PPC_FEATURE_HAS_ALTIVEC_COMP 0 203#define PPC_FEATURE_HAS_ALTIVEC_COMP 0
202#endif 204#endif
203 205
206/* We only set the VSX features if the kernel was compiled with VSX
207 * support
208 */
209#ifdef CONFIG_VSX
210#define CPU_FTR_VSX_COMP CPU_FTR_VSX
211#define PPC_FEATURE_HAS_VSX_COMP PPC_FEATURE_HAS_VSX
212#else
213#define CPU_FTR_VSX_COMP 0
214#define PPC_FEATURE_HAS_VSX_COMP 0
215#endif
216
204/* We only set the spe features if the kernel was compiled with spe 217/* We only set the spe features if the kernel was compiled with spe
205 * support 218 * support
206 */ 219 */
@@ -404,7 +417,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
404 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 417 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
405 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 418 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \
406 CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \ 419 CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \
407 CPU_FTR_1T_SEGMENT) 420 CPU_FTR_1T_SEGMENT | CPU_FTR_VSX)
408#else 421#else
409enum { 422enum {
410 CPU_FTRS_POSSIBLE = 423 CPU_FTRS_POSSIBLE =