Commit a2f7a9ce authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: Fix runlatch code to work on pseries machines

Not all ppc64 CPUs have the CTRL SPR, so we need a cputable feature for it.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 315a6998
...@@ -81,7 +81,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -81,7 +81,7 @@ struct cpu_spec cpu_specs[] = {
.cpu_name = "RS64-II (northstar)", .cpu_name = "RS64-II (northstar)",
.cpu_features = CPU_FTR_SPLIT_ID_CACHE | .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
CPU_FTR_PMC8 | CPU_FTR_MMCRA, CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
.cpu_user_features = COMMON_USER_PPC64, .cpu_user_features = COMMON_USER_PPC64,
.icache_bsize = 128, .icache_bsize = 128,
.dcache_bsize = 128, .dcache_bsize = 128,
...@@ -94,7 +94,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -94,7 +94,7 @@ struct cpu_spec cpu_specs[] = {
.cpu_name = "RS64-III (pulsar)", .cpu_name = "RS64-III (pulsar)",
.cpu_features = CPU_FTR_SPLIT_ID_CACHE | .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
CPU_FTR_PMC8 | CPU_FTR_MMCRA, CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
.cpu_user_features = COMMON_USER_PPC64, .cpu_user_features = COMMON_USER_PPC64,
.icache_bsize = 128, .icache_bsize = 128,
.dcache_bsize = 128, .dcache_bsize = 128,
...@@ -107,7 +107,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -107,7 +107,7 @@ struct cpu_spec cpu_specs[] = {
.cpu_name = "RS64-III (icestar)", .cpu_name = "RS64-III (icestar)",
.cpu_features = CPU_FTR_SPLIT_ID_CACHE | .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
CPU_FTR_PMC8 | CPU_FTR_MMCRA, CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
.cpu_user_features = COMMON_USER_PPC64, .cpu_user_features = COMMON_USER_PPC64,
.icache_bsize = 128, .icache_bsize = 128,
.dcache_bsize = 128, .dcache_bsize = 128,
...@@ -120,7 +120,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -120,7 +120,7 @@ struct cpu_spec cpu_specs[] = {
.cpu_name = "RS64-IV (sstar)", .cpu_name = "RS64-IV (sstar)",
.cpu_features = CPU_FTR_SPLIT_ID_CACHE | .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
CPU_FTR_PMC8 | CPU_FTR_MMCRA, CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
.cpu_user_features = COMMON_USER_PPC64, .cpu_user_features = COMMON_USER_PPC64,
.icache_bsize = 128, .icache_bsize = 128,
.dcache_bsize = 128, .dcache_bsize = 128,
......
...@@ -138,6 +138,7 @@ extern firmware_feature_t firmware_features_table[]; ...@@ -138,6 +138,7 @@ extern firmware_feature_t firmware_features_table[];
#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000)
#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000)
#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000)
#define CPU_FTR_CTRL ASM_CONST(0x0000100000000000)
/* Platform firmware features */ /* Platform firmware features */
#define FW_FTR_ ASM_CONST(0x0000000000000001) #define FW_FTR_ ASM_CONST(0x0000000000000001)
...@@ -148,7 +149,7 @@ extern firmware_feature_t firmware_features_table[]; ...@@ -148,7 +149,7 @@ extern firmware_feature_t firmware_features_table[];
#define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \ #define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \
CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \ CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \
CPU_FTR_NODSISRALIGN) CPU_FTR_NODSISRALIGN | CPU_FTR_CTRL)
/* iSeries doesn't support large pages */ /* iSeries doesn't support large pages */
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/types.h> #include <asm/types.h>
#include <asm/systemcfg.h> #include <asm/systemcfg.h>
#include <asm/cputable.h>
/* Machine State Register (MSR) Fields */ /* Machine State Register (MSR) Fields */
#define MSR_SF_LG 63 /* Enable 64 bit mode */ #define MSR_SF_LG 63 /* Enable 64 bit mode */
...@@ -501,18 +502,22 @@ static inline void ppc64_runlatch_on(void) ...@@ -501,18 +502,22 @@ static inline void ppc64_runlatch_on(void)
{ {
unsigned long ctrl; unsigned long ctrl;
ctrl = mfspr(SPRN_CTRLF); if (cpu_has_feature(CPU_FTR_CTRL)) {
ctrl |= CTRL_RUNLATCH; ctrl = mfspr(SPRN_CTRLF);
mtspr(SPRN_CTRLT, ctrl); ctrl |= CTRL_RUNLATCH;
mtspr(SPRN_CTRLT, ctrl);
}
} }
static inline void ppc64_runlatch_off(void) static inline void ppc64_runlatch_off(void)
{ {
unsigned long ctrl; unsigned long ctrl;
ctrl = mfspr(SPRN_CTRLF); if (cpu_has_feature(CPU_FTR_CTRL)) {
ctrl &= ~CTRL_RUNLATCH; ctrl = mfspr(SPRN_CTRLF);
mtspr(SPRN_CTRLT, ctrl); ctrl &= ~CTRL_RUNLATCH;
mtspr(SPRN_CTRLT, ctrl);
}
} }
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment