linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 6/9] powerpc: Add VSX CPU feature
Date: Wed, 25 Jun 2008 14:07:18 +1000	[thread overview]
Message-ID: <20080625040718.21E4B7029B@localhost.localdomain> (raw)
In-Reply-To: <1214366837.623950.515350956858.qpush@coopers>

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>

---

 arch/powerpc/kernel/prom.c     |    4 ++++
 include/asm-powerpc/cputable.h |   15 ++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/prom.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/prom.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/prom.c
@@ -609,6 +609,10 @@ static struct feature_property {
 	{"altivec", 0, CPU_FTR_ALTIVEC, PPC_FEATURE_HAS_ALTIVEC},
 	{"ibm,vmx", 1, CPU_FTR_ALTIVEC, PPC_FEATURE_HAS_ALTIVEC},
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_VSX
+	/* Yes, this _really_ is ibm,vmx == 2 to enable VSX */
+	{"ibm,vmx", 2, CPU_FTR_VSX, PPC_FEATURE_HAS_VSX},
+#endif /* CONFIG_VSX */
 #ifdef CONFIG_PPC64
 	{"ibm,dfp", 1, 0, PPC_FEATURE_HAS_DFP},
 	{"ibm,purr", 1, CPU_FTR_PURR, 0},
Index: linux-2.6-ozlabs/include/asm-powerpc/cputable.h
===================================================================
--- linux-2.6-ozlabs.orig/include/asm-powerpc/cputable.h
+++ linux-2.6-ozlabs/include/asm-powerpc/cputable.h
@@ -27,6 +27,7 @@
 #define PPC_FEATURE_HAS_DFP		0x00000400
 #define PPC_FEATURE_POWER6_EXT		0x00000200
 #define PPC_FEATURE_ARCH_2_06		0x00000100
+#define PPC_FEATURE_HAS_VSX		0x00000080
 
 #define PPC_FEATURE_TRUE_LE		0x00000002
 #define PPC_FEATURE_PPC_LE		0x00000001
@@ -181,6 +182,7 @@ extern void do_feature_fixups(unsigned l
 #define CPU_FTR_DSCR			LONG_ASM_CONST(0x0002000000000000)
 #define CPU_FTR_1T_SEGMENT		LONG_ASM_CONST(0x0004000000000000)
 #define CPU_FTR_NO_SLBIE_B		LONG_ASM_CONST(0x0008000000000000)
+#define CPU_FTR_VSX			LONG_ASM_CONST(0x0010000000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -199,6 +201,17 @@ extern void do_feature_fixups(unsigned l
 #define PPC_FEATURE_HAS_ALTIVEC_COMP    0
 #endif
 
+/* We only set the VSX features if the kernel was compiled with VSX
+ * support
+ */
+#ifdef CONFIG_VSX
+#define CPU_FTR_VSX_COMP	CPU_FTR_VSX
+#define PPC_FEATURE_HAS_VSX_COMP PPC_FEATURE_HAS_VSX
+#else
+#define CPU_FTR_VSX_COMP	0
+#define PPC_FEATURE_HAS_VSX_COMP    0
+#endif
+
 /* We only set the spe features if the kernel was compiled with spe
  * support
  */
@@ -399,7 +412,7 @@ extern void do_feature_fixups(unsigned l
 	    (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 |	\
 	    CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 |	\
 	    CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T |		\
-	    CPU_FTR_1T_SEGMENT)
+	    CPU_FTR_1T_SEGMENT | CPU_FTR_VSX)
 #else
 enum {
 	CPU_FTRS_POSSIBLE =

      parent reply	other threads:[~2008-06-25  4:07 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18  0:47 [PATCH 0/9] powerpc: Add kernel support for POWER7 VSX Michael Neuling
2008-06-18  0:47 ` [PATCH 5/9] powerpc: Introduce VSX thread_struct and CONFIG_VSX Michael Neuling
2008-06-18 19:35   ` Kumar Gala
2008-06-18 22:58     ` Paul Mackerras
2008-06-19  4:13       ` Kumar Gala
2008-06-19  4:30         ` Michael Neuling
2008-06-19  4:22   ` Kumar Gala
2008-06-19  4:35     ` Michael Neuling
2008-06-19  4:58       ` Kumar Gala
2008-06-19  5:37         ` Michael Neuling
2008-06-19  5:47           ` Kumar Gala
2008-06-19  6:01             ` Michael Neuling
2008-06-19  6:10               ` Kumar Gala
2008-06-19  9:33                 ` Benjamin Herrenschmidt
2008-06-19 13:24                   ` Kumar Gala
2008-06-18  0:47 ` [PATCH 3/9] powerpc: Move altivec_unavailable Michael Neuling
2008-06-18  0:47 ` [PATCH 2/9] powerpc: Add macros to access floating point registers in thread_struct Michael Neuling
2008-06-18  0:47 ` [PATCH 4/9] powerpc: Make load_up_fpu and load_up_altivec callable Michael Neuling
2008-06-18  0:47 ` [PATCH 1/9] powerpc: Fix msr setting in 32 bit signal code Michael Neuling
2008-06-18 14:53   ` Kumar Gala
2008-06-18 23:55     ` Michael Neuling
2008-06-18  0:47 ` [PATCH 8/9] powerpc: Add VSX context save/restore, ptrace and signal support Michael Neuling
2008-06-18  0:47 ` [PATCH 6/9] powerpc: Add VSX CPU feature Michael Neuling
2008-06-18 16:28   ` Joel Schopp
2008-06-19  6:51   ` David Woodhouse
2008-06-19  7:00     ` Michael Neuling
2008-06-18  0:47 ` [PATCH 7/9] powerpc: Add VSX assembler code macros Michael Neuling
2008-06-18  0:47 ` [PATCH 9/9] powerpc: Add CONFIG_VSX config option Michael Neuling
2008-06-18 13:05 ` [PATCH 0/9] powerpc: Add kernel support for POWER7 VSX Kumar Gala
2008-06-18 23:54   ` Michael Neuling
2008-06-20  4:13 ` Michael Neuling
2008-06-20  4:13   ` [PATCH 4/9] powerpc: Make load_up_fpu and load_up_altivec callable Michael Neuling
2008-06-20  4:13   ` [PATCH 8/9] powerpc: Add VSX context save/restore, ptrace and signal support Michael Neuling
2008-06-20  4:13   ` [PATCH 6/9] powerpc: Add VSX CPU feature Michael Neuling
2008-06-20  4:13   ` [PATCH 3/9] powerpc: Move altivec_unavailable Michael Neuling
2008-06-20  4:13   ` [PATCH 5/9] powerpc: Introduce VSX thread_struct and CONFIG_VSX Michael Neuling
2008-06-20  6:44     ` Kumar Gala
2008-06-20  4:13   ` [PATCH 7/9] powerpc: Add VSX assembler code macros Michael Neuling
2008-06-20  4:13   ` [PATCH 1/9] powerpc: Fix msr setting in 32 bit signal code Michael Neuling
2008-06-20  6:35     ` Kumar Gala
2008-06-20  4:13   ` [PATCH 9/9] powerpc: Add CONFIG_VSX config option Michael Neuling
2008-06-20  4:13   ` [PATCH 2/9] powerpc: Add macros to access floating point registers in thread_struct Michael Neuling
2008-06-20  6:39     ` Kumar Gala
2008-06-22 11:29       ` Michael Neuling
2008-06-20  6:37   ` [PATCH 0/9] powerpc: Add kernel support for POWER7 VSX Kumar Gala
2008-06-20  8:15     ` Michael Neuling
2008-06-23  5:31   ` Michael Neuling
2008-06-23  5:31     ` [PATCH 1/9] powerpc: Fix msr setting in 32 bit signal code Michael Neuling
2008-06-23  5:31     ` [PATCH 3/9] powerpc: Move altivec_unavailable Michael Neuling
2008-06-23  5:31     ` [PATCH 4/9] powerpc: Make load_up_fpu and load_up_altivec callable Michael Neuling
2008-06-23  5:31     ` [PATCH 2/9] powerpc: Add macros to access floating point registers in thread_struct Michael Neuling
2008-06-23  5:31     ` [PATCH 9/9] powerpc: Add CONFIG_VSX config option Michael Neuling
2008-06-23  5:31     ` [PATCH 5/9] powerpc: Introduce VSX thread_struct and CONFIG_VSX Michael Neuling
2008-06-23  5:31     ` [PATCH 7/9] powerpc: Add VSX assembler code macros Michael Neuling
2008-06-23  5:31     ` [PATCH 6/9] powerpc: Add VSX CPU feature Michael Neuling
2008-06-23  5:31     ` [PATCH 8/9] powerpc: Add VSX context save/restore, ptrace and signal support Michael Neuling
2008-06-23  7:38     ` [PATCH 0/9] powerpc: Add kernel support for POWER7 VSX Michael Neuling
2008-06-23  7:38       ` [PATCH 2/9] powerpc: Add macros to access floating point registers in thread_struct Michael Neuling
2008-06-23  7:38       ` [PATCH 1/9] powerpc: Fix msr setting in 32 bit signal code Michael Neuling
2008-06-23 14:46         ` Kumar Gala
2008-06-23  7:38       ` [PATCH 8/9] powerpc: Add VSX context save/restore, ptrace and signal support Michael Neuling
2008-06-23  7:38       ` [PATCH 6/9] powerpc: Add VSX CPU feature Michael Neuling
2008-06-23  7:38       ` [PATCH 3/9] powerpc: Move altivec_unavailable Michael Neuling
2008-06-23  7:38       ` [PATCH 5/9] powerpc: Introduce VSX thread_struct and CONFIG_VSX Michael Neuling
2008-06-23  7:38       ` [PATCH 9/9] powerpc: Add CONFIG_VSX config option Michael Neuling
2008-06-23  7:38       ` [PATCH 7/9] powerpc: Add VSX assembler code macros Michael Neuling
2008-06-23  7:38       ` [PATCH 4/9] powerpc: Make load_up_fpu and load_up_altivec callable Michael Neuling
2008-06-24 10:57       ` [PATCH 0/9] powerpc: Add kernel support for POWER7 VSX Michael Neuling
2008-06-24 10:57         ` [PATCH 3/9] powerpc: Move altivec_unavailable Michael Neuling
2008-06-24 10:57         ` [PATCH 2/9] powerpc: Add macros to access floating point registers in thread_struct Michael Neuling
2008-06-24 14:07           ` Kumar Gala
2008-06-24 16:33             ` Segher Boessenkool
2008-06-25  0:25             ` Michael Neuling
2008-06-24 10:57         ` [PATCH 1/9] powerpc: Fix msr setting in 32 bit signal code Michael Neuling
2008-06-24 13:47           ` Kumar Gala
2008-06-24 10:57         ` [PATCH 5/9] powerpc: Introduce VSX thread_struct and CONFIG_VSX Michael Neuling
2008-06-24 10:57         ` [PATCH 9/9] powerpc: Add CONFIG_VSX config option Michael Neuling
2008-06-24 14:19           ` Kumar Gala
2008-06-24 10:57         ` [PATCH 7/9] powerpc: Add VSX assembler code macros Michael Neuling
2008-06-24 14:06           ` Kumar Gala
2008-06-25  0:06             ` Michael Neuling
2008-06-25  2:19               ` Kumar Gala
2008-06-24 10:57         ` [PATCH 6/9] powerpc: Add VSX CPU feature Michael Neuling
2008-06-24 14:19           ` Kumar Gala
2008-06-24 10:57         ` [PATCH 4/9] powerpc: Make load_up_fpu and load_up_altivec callable Michael Neuling
2008-06-24 14:01           ` Kumar Gala
2008-06-24 10:57         ` [PATCH 8/9] powerpc: Add VSX context save/restore, ptrace and signal support Michael Neuling
2008-06-25  4:07         ` [PATCH 0/9] powerpc: Add kernel support for POWER7 VSX Michael Neuling
2008-06-25  4:07           ` [PATCH 2/9] powerpc: Add macros to access floating point registers in thread_struct Michael Neuling
2008-06-25 14:08             ` Kumar Gala
2008-06-25 15:34               ` Scott Wood
2008-06-25 16:12                 ` Gabriel Paubert
2008-06-25 16:17                   ` Scott Wood
2008-06-25 17:07                     ` Kumar Gala
2008-06-26  0:09                       ` Michael Neuling
2008-06-26  7:07                         ` [PATCH] " Michael Neuling
2008-06-26 10:44                     ` [PATCH 2/9] " Gabriel Paubert
2008-06-25 17:08                   ` Andreas Schwab
2008-06-25  4:07           ` [PATCH 1/9] powerpc: Fix msr setting in 32 bit signal code Michael Neuling
2008-06-25  4:07           ` [PATCH 4/9] powerpc: Make load_up_fpu and load_up_altivec callable Michael Neuling
2008-06-25  4:07           ` [PATCH 5/9] powerpc: Introduce VSX thread_struct and CONFIG_VSX Michael Neuling
2008-06-25  4:07           ` [PATCH 8/9] powerpc: Add VSX context save/restore, ptrace and signal support Michael Neuling
2008-06-25  4:07           ` [PATCH 7/9] powerpc: Add VSX assembler code macros Michael Neuling
2008-06-25  4:07           ` [PATCH 9/9] powerpc: Add CONFIG_VSX config option Michael Neuling
2008-06-25  4:07           ` [PATCH 3/9] powerpc: Move altivec_unavailable Michael Neuling
2008-06-25  4:07           ` Michael Neuling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080625040718.21E4B7029B@localhost.localdomain \
    --to=mikey@neuling.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).