diff mbox

[07/15] powerpc: Move CPU_FTRS_BASE_BOOK3E into cputable.h & update FTR masks

Message ID 1a24282746fd056fb51dda3b25d160d2fc609da5.1302856271.git.michael@ellerman.id.au (mailing list archive)
State Rejected
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Michael Ellerman April 15, 2011, 8:32 a.m. UTC
From: Michael Ellerman <michael@ellerman.id.au>

Where they belong with all the others. Remove SMT which may not be
true for all BOOK3E parts.

Currently the FTRS_POSSIBLE & FTRS_ALWAYS are defined for 64 or 32 bit.
Now that we have BOOK3E we need to split it three ways, BOOK3S, BOOK3E,
and 32-bit.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/include/asm/cputable.h |   17 +++++++++++++----
 arch/powerpc/kernel/cputable.c      |    3 ---
 2 files changed, 13 insertions(+), 7 deletions(-)

Comments

Kumar Gala April 18, 2011, 12:37 p.m. UTC | #1
On Apr 15, 2011, at 3:32 AM, Michael Ellerman wrote:

> From: Michael Ellerman <michael@ellerman.id.au>
> 
> Where they belong with all the others. Remove SMT which may not be
> true for all BOOK3E parts.
> 
> Currently the FTRS_POSSIBLE & FTRS_ALWAYS are defined for 64 or 32 bit.
> Now that we have BOOK3E we need to split it three ways, BOOK3S, BOOK3E,
> and 32-bit.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/include/asm/cputable.h |   17 +++++++++++++----
> arch/powerpc/kernel/cputable.c      |    3 ---
> 2 files changed, 13 insertions(+), 7 deletions(-)

will probably need some updating based on:

commit 11ed0db9f6c7811233632d2ab79c50c011b89902
Author: Kumar Gala <galak@kernel.crashing.org>
Date:   Wed Apr 6 00:11:06 2011 -0500

    powerpc/book3e: Fix CPU feature handling on 64-bit e5500
    
    The CPU_FTRS_POSSIBLE and CPU_FTRS_ALWAYS defines did not encompass
    e5500 CPU features when built for 64-bit.  This causes issues with
    cpu_has_feature() as it utilizes the POSSIBLE & ALWAYS defines as part
    of its check.
    
    Create a unique CPU_FTRS_E5500 (as its different from CPU_FTRS_E500MC),
    created a new group for 64-bit Book3e based CPUs and add CPU_FTRS_E5500
    to that group.
    
    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

- k
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 7d2eb44..32a970d 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -435,12 +435,18 @@  extern const char *powerpc_base_platform;
 	    CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_NO_SLBIE_B)
 #define CPU_FTRS_COMPATIBLE	(CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2)
 
-#ifdef __powerpc64__
+#define CPU_FTRS_BASE_BOOK3E	(CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2 | \
+				 CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
+
+#if defined(CONFIG_PPC_BOOK3S_64)
 #define CPU_FTRS_POSSIBLE	\
 	    (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_VSX)
+#elif defined(CONFIG_PPC_BOOK3E_64)
+#define CPU_FTRS_POSSIBLE	\
+	    (CPU_FTRS_BASE_BOOK3E)
 #else
 enum {
 	CPU_FTRS_POSSIBLE =
@@ -477,13 +483,16 @@  enum {
 #endif
 	    0,
 };
-#endif /* __powerpc64__ */
+#endif /* defined(CONFIG_PPC_BOOK3S_64) */
 
-#ifdef __powerpc64__
+#if defined(CONFIG_PPC_BOOK3S_64)
 #define CPU_FTRS_ALWAYS		\
 	    (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_FTRS_POSSIBLE)
+#elif defined(CONFIG_PPC_BOOK3E_64)
+#define CPU_FTRS_ALWAYS	\
+	    (CPU_FTRS_BASE_BOOK3E)
 #else
 enum {
 	CPU_FTRS_ALWAYS =
@@ -517,7 +526,7 @@  enum {
 #endif
 	    CPU_FTRS_POSSIBLE,
 };
-#endif /* __powerpc64__ */
+#endif /* defined(CONFIG_PPC_BOOK3S_64) */
 
 static inline int cpu_has_feature(unsigned long feature)
 {
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 867ae30..70cbae1 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -2015,9 +2015,6 @@  static struct cpu_spec __initdata cpu_specs[] = {
 	{	/* This is a default entry to get going, to be replaced by
 		 * a real one at some stage
 		 */
-#define CPU_FTRS_BASE_BOOK3E	(CPU_FTR_USE_TB | \
-	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_SMT | \
-	    CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
 		.pvr_mask		= 0x00000000,
 		.pvr_value		= 0x00000000,
 		.cpu_name		= "Book3E",