Skip to contentSkip to conversation

powerpc/book3e: Fix CPU feature handling on 64-bit e5500

PATCH Superseded Kumar Gala 2 participants 4 messages Apr 6, 2011 – Apr 7, 2011 PowerPC

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 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.

---
* This patch is intened to fix some issues and I'd like to see it in v2.6.39

- k

 arch/powerpc/include/asm/cputable.h |   14 ++++++++++++++
 arch/powerpc/kernel/cputable.c      |    2 +-
 2 files changed, 15 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/cputable.h +14 -0
index be3cdf9..9028a9e 100644
@@ -386,6 +386,10 @@ extern const char *powerpc_base_platform;
 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
 	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
 	    CPU_FTR_DBELL)
+#define CPU_FTRS_E5500	(CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
+	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
+	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
+	    CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD)
 #define CPU_FTRS_GENERIC_32	(CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
 
 /* 64-bit CPUs */
@@ -435,11 +439,15 @@ extern const char *powerpc_base_platform;
 #define CPU_FTRS_COMPATIBLE	(CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2)
 
 #ifdef __powerpc64__
+#ifdef CONFIG_PPC_BOOK3E
+#define CPU_FTRS_POSSIBLE	(CPU_FTRS_E5500)
+#else
 #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)
+#endif
 #else
 enum {
 	CPU_FTRS_POSSIBLE =
@@ -473,16 +481,21 @@ enum {
 #endif
 #ifdef CONFIG_E500
 	    CPU_FTRS_E500 | CPU_FTRS_E500_2 | CPU_FTRS_E500MC |
+	    CPU_FTRS_E5500 |
 #endif
 	    0,
 };
 #endif /* __powerpc64__ */
 
 #ifdef __powerpc64__
+#ifdef CONFIG_PPC_BOOK3E
+#define CPU_FTRS_ALWAYS		(CPU_FTRS_E5500)
+#else
 #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)
+#endif
 #else
 enum {
 	CPU_FTRS_ALWAYS =
@@ -513,6 +526,7 @@ enum {
 #endif
 #ifdef CONFIG_E500
 	    CPU_FTRS_E500 & CPU_FTRS_E500_2 & CPU_FTRS_E500MC &
+	    CPU_FTRS_E5500 &
 #endif
 	    CPU_FTRS_POSSIBLE,
 };
arch/powerpc/kernel/cputable.c +1 -1
index c9b68d0..b9602ee 100644
@@ -1973,7 +1973,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
 		.pvr_mask		= 0xffff0000,
 		.pvr_value		= 0x80240000,
 		.cpu_name		= "e5500",
-		.cpu_features		= CPU_FTRS_E500MC,
+		.cpu_features		= CPU_FTRS_E5500,
 		.cpu_user_features	= COMMON_USER_BOOKE,
 		.mmu_features		= MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
 			MMU_FTR_USE_TLBILX,
Signature · 1 line
1.7.3.4
#1 lore raw

arch/powerpc/include/asm/cputable.h extern const char *powerpc_base_platform; · line 390

Quoted 10 lines · On Wed, 6 Apr 2011 07:29:03 -0500 Kumar Gala <[email protected]> wrote:
arch/powerpc/include/asm/cputable.h +2 -0
index be3cdf9..9028a9e 100644
@@ -386,6 +386,10 @@ extern const char *powerpc_base_platform;
 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
 	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
 	    CPU_FTR_DBELL)
+#define CPU_FTRS_E5500	(CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
+	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \

E5500 cannot doze or nap in the way meant by existing code (MSR[WE]).

-Scott

author
#2 lore raw
Quoted 4 lines · Scott Wood

On Wed, 6 Apr 2011 07:29:03 -0500
Kumar Gala <[email protected]> wrote:
=20

=

Quoted 1 line
= renamed from arch/powerpc/include/asm/cputable.h +0 -0

b/arch/powerpc/include/asm/cputable.h

Quoted 8 lines

arch/powerpc/include/asm/cputable.h extern const char *powerpc_base_platform; · line 389

Quoted 8 lines

index be3cdf9..9028a9e 100644

arch/powerpc/include/asm/cputable.h +1 -0
@@ -386,6 +386,10 @@ extern const char *powerpc_base_platform;
 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
 	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
 	    CPU_FTR_DBELL)
+#define CPU_FTRS_E5500	(CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB =

| \

Quoted 3 lines

arch/powerpc/include/asm/cputable.h extern const char *powerpc_base_platform; · line 390

Quoted 1 line
arch/powerpc/include/asm/cputable.h +1 -0
+	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \

=20
E5500 cannot doze or nap in the way meant by existing code (MSR[WE]).

Should I drop them for e500mc as well?

- k=

#3 lore raw
Quoted 19 lines · On Thu, 7 Apr 2011 14:38:57 -0500 Kumar Gala <[email protected]> wrote:
Quoted 15 lines · Scott Wood

arch/powerpc/include/asm/cputable.h extern const char *powerpc_base_platform; · line 390

Quoted 10 lines · On Wed, 6 Apr 2011 07:29:03 -0500 Kumar Gala <[email protected]> wrote:
arch/powerpc/include/asm/cputable.h +2 -0
index be3cdf9..9028a9e 100644
@@ -386,6 +386,10 @@ extern const char *powerpc_base_platform;
 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
 	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
 	    CPU_FTR_DBELL)
+#define CPU_FTRS_E5500	(CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
+	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \

E5500 cannot doze or nap in the way meant by existing code (MSR[WE]).

Quoted 1 line

Should I drop them for e500mc as well?

Yes.

-Scott