aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/cputable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/cputable.h')
-rw-r--r--include/asm-powerpc/cputable.h86
1 files changed, 53 insertions, 33 deletions
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 1e79673b7316..ef8a248dfd55 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_POWERPC_CPUTABLE_H 1#ifndef __ASM_POWERPC_CPUTABLE_H
2#define __ASM_POWERPC_CPUTABLE_H 2#define __ASM_POWERPC_CPUTABLE_H
3 3
4#include <asm/asm-compat.h>
5
6#define PPC_FEATURE_32 0x80000000 4#define PPC_FEATURE_32 0x80000000
7#define PPC_FEATURE_64 0x40000000 5#define PPC_FEATURE_64 0x40000000
8#define PPC_FEATURE_601_INSTR 0x20000000 6#define PPC_FEATURE_601_INSTR 0x20000000
@@ -26,11 +24,20 @@
26#define PPC_FEATURE_PA6T 0x00000800 24#define PPC_FEATURE_PA6T 0x00000800
27#define PPC_FEATURE_HAS_DFP 0x00000400 25#define PPC_FEATURE_HAS_DFP 0x00000400
28#define PPC_FEATURE_POWER6_EXT 0x00000200 26#define PPC_FEATURE_POWER6_EXT 0x00000200
27#define PPC_FEATURE_ARCH_2_06 0x00000100
28#define PPC_FEATURE_HAS_VSX 0x00000080
29
30#define PPC_FEATURE_PSERIES_PERFMON_COMPAT \
31 0x00000040
29 32
30#define PPC_FEATURE_TRUE_LE 0x00000002 33#define PPC_FEATURE_TRUE_LE 0x00000002
31#define PPC_FEATURE_PPC_LE 0x00000001 34#define PPC_FEATURE_PPC_LE 0x00000001
32 35
33#ifdef __KERNEL__ 36#ifdef __KERNEL__
37
38#include <asm/asm-compat.h>
39#include <asm/feature-fixups.h>
40
34#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
35 42
36/* This structure can grow, it's real size is used by head.S code 43/* This structure can grow, it's real size is used by head.S code
@@ -120,6 +127,8 @@ extern struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr);
120extern void do_feature_fixups(unsigned long value, void *fixup_start, 127extern void do_feature_fixups(unsigned long value, void *fixup_start,
121 void *fixup_end); 128 void *fixup_end);
122 129
130extern const char *powerpc_base_platform;
131
123#endif /* __ASSEMBLY__ */ 132#endif /* __ASSEMBLY__ */
124 133
125/* CPU kernel features */ 134/* CPU kernel features */
@@ -132,7 +141,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
132#define CPU_FTR_TAU ASM_CONST(0x0000000000000010) 141#define CPU_FTR_TAU ASM_CONST(0x0000000000000010)
133#define CPU_FTR_CAN_DOZE ASM_CONST(0x0000000000000020) 142#define CPU_FTR_CAN_DOZE ASM_CONST(0x0000000000000020)
134#define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040) 143#define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040)
135#define CPU_FTR_604_PERF_MON ASM_CONST(0x0000000000000080) 144#define CPU_FTR_L2CSR ASM_CONST(0x0000000000000080)
136#define CPU_FTR_601 ASM_CONST(0x0000000000000100) 145#define CPU_FTR_601 ASM_CONST(0x0000000000000100)
137#define CPU_FTR_HPTE_TABLE ASM_CONST(0x0000000000000200) 146#define CPU_FTR_HPTE_TABLE ASM_CONST(0x0000000000000200)
138#define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400) 147#define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400)
@@ -152,6 +161,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
152#define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000) 161#define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000)
153#define CPU_FTR_SPE ASM_CONST(0x0000000002000000) 162#define CPU_FTR_SPE ASM_CONST(0x0000000002000000)
154#define CPU_FTR_NEED_PAIRED_STWCX ASM_CONST(0x0000000004000000) 163#define CPU_FTR_NEED_PAIRED_STWCX ASM_CONST(0x0000000004000000)
164#define CPU_FTR_LWSYNC ASM_CONST(0x0000000008000000)
155 165
156/* 166/*
157 * Add the 64-bit processor unique features in the top half of the word; 167 * Add the 64-bit processor unique features in the top half of the word;
@@ -180,6 +190,8 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
180#define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000) 190#define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000)
181#define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000) 191#define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000)
182#define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000) 192#define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000)
193#define CPU_FTR_VSX LONG_ASM_CONST(0x0010000000000000)
194#define CPU_FTR_SAO LONG_ASM_CONST(0x0020000000000000)
183 195
184#ifndef __ASSEMBLY__ 196#ifndef __ASSEMBLY__
185 197
@@ -198,6 +210,17 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
198#define PPC_FEATURE_HAS_ALTIVEC_COMP 0 210#define PPC_FEATURE_HAS_ALTIVEC_COMP 0
199#endif 211#endif
200 212
213/* We only set the VSX features if the kernel was compiled with VSX
214 * support
215 */
216#ifdef CONFIG_VSX
217#define CPU_FTR_VSX_COMP CPU_FTR_VSX
218#define PPC_FEATURE_HAS_VSX_COMP PPC_FEATURE_HAS_VSX
219#else
220#define CPU_FTR_VSX_COMP 0
221#define PPC_FEATURE_HAS_VSX_COMP 0
222#endif
223
201/* We only set the spe features if the kernel was compiled with spe 224/* We only set the spe features if the kernel was compiled with spe
202 * support 225 * support
203 */ 226 */
@@ -245,8 +268,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
245 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ 268 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
246 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) 269 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
247#define CPU_FTRS_604 (CPU_FTR_COMMON | \ 270#define CPU_FTRS_604 (CPU_FTR_COMMON | \
248 CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \ 271 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_PPC_LE)
249 CPU_FTR_PPC_LE)
250#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | \ 272#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | \
251 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 273 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
252 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) 274 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
@@ -347,40 +369,50 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
347#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ 369#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
348 CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \ 370 CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \
349 CPU_FTR_UNIFIED_ID_CACHE) 371 CPU_FTR_UNIFIED_ID_CACHE)
350#define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ 372#define CPU_FTRS_E500 (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
373 CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN)
374#define CPU_FTRS_E500_2 (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
375 CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_BIG_PHYS | \
351 CPU_FTR_NODSISRALIGN) 376 CPU_FTR_NODSISRALIGN)
352#define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ 377#define CPU_FTRS_E500MC (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
353 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) 378 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN | \
379 CPU_FTR_L2CSR | CPU_FTR_LWSYNC)
354#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 380#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
355 381
356/* 64-bit CPUs */ 382/* 64-bit CPUs */
357#define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | \ 383#define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
358 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE) 384 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE)
359#define CPU_FTRS_RS64 (CPU_FTR_USE_TB | \ 385#define CPU_FTRS_RS64 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
360 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ 386 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \
361 CPU_FTR_MMCRA | CPU_FTR_CTRL) 387 CPU_FTR_MMCRA | CPU_FTR_CTRL)
362#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | \ 388#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
363 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 389 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
364 CPU_FTR_MMCRA) 390 CPU_FTR_MMCRA)
365#define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | \ 391#define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
366 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 392 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
367 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA) 393 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA)
368#define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | \ 394#define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
369 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 395 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
370 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 396 CPU_FTR_MMCRA | CPU_FTR_SMT | \
371 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 397 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
372 CPU_FTR_PURR) 398 CPU_FTR_PURR)
373#define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | \ 399#define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
374 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 400 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
375 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 401 CPU_FTR_MMCRA | CPU_FTR_SMT | \
376 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 402 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
377 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 403 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
378 CPU_FTR_DSCR) 404 CPU_FTR_DSCR)
379#define CPU_FTRS_CELL (CPU_FTR_USE_TB | \ 405#define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
406 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
407 CPU_FTR_MMCRA | CPU_FTR_SMT | \
408 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
409 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
410 CPU_FTR_DSCR | CPU_FTR_SAO)
411#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
380 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 412 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
381 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 413 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
382 CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG) 414 CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG)
383#define CPU_FTRS_PA6T (CPU_FTR_USE_TB | \ 415#define CPU_FTRS_PA6T (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
384 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 416 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
385 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ 417 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \
386 CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_NO_SLBIE_B) 418 CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_NO_SLBIE_B)
@@ -391,7 +423,8 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
391#define CPU_FTRS_POSSIBLE \ 423#define CPU_FTRS_POSSIBLE \
392 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 424 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
393 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 425 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \
394 CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_1T_SEGMENT) 426 CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \
427 CPU_FTR_1T_SEGMENT | CPU_FTR_VSX)
395#else 428#else
396enum { 429enum {
397 CPU_FTRS_POSSIBLE = 430 CPU_FTRS_POSSIBLE =
@@ -421,7 +454,7 @@ enum {
421 CPU_FTRS_E200 | 454 CPU_FTRS_E200 |
422#endif 455#endif
423#ifdef CONFIG_E500 456#ifdef CONFIG_E500
424 CPU_FTRS_E500 | CPU_FTRS_E500_2 | 457 CPU_FTRS_E500 | CPU_FTRS_E500_2 | CPU_FTRS_E500MC |
425#endif 458#endif
426 0, 459 0,
427}; 460};
@@ -431,7 +464,7 @@ enum {
431#define CPU_FTRS_ALWAYS \ 464#define CPU_FTRS_ALWAYS \
432 (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ 465 (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \
433 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \ 466 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \
434 CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE) 467 CPU_FTRS_POWER7 & CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE)
435#else 468#else
436enum { 469enum {
437 CPU_FTRS_ALWAYS = 470 CPU_FTRS_ALWAYS =
@@ -461,7 +494,7 @@ enum {
461 CPU_FTRS_E200 & 494 CPU_FTRS_E200 &
462#endif 495#endif
463#ifdef CONFIG_E500 496#ifdef CONFIG_E500
464 CPU_FTRS_E500 & CPU_FTRS_E500_2 & 497 CPU_FTRS_E500 & CPU_FTRS_E500_2 & CPU_FTRS_E500MC &
465#endif 498#endif
466 CPU_FTRS_POSSIBLE, 499 CPU_FTRS_POSSIBLE,
467}; 500};
@@ -477,18 +510,5 @@ static inline int cpu_has_feature(unsigned long feature)
477 510
478#endif /* !__ASSEMBLY__ */ 511#endif /* !__ASSEMBLY__ */
479 512
480#ifdef __ASSEMBLY__
481
482#define BEGIN_FTR_SECTION_NESTED(label) label:
483#define BEGIN_FTR_SECTION BEGIN_FTR_SECTION_NESTED(97)
484#define END_FTR_SECTION_NESTED(msk, val, label) \
485 MAKE_FTR_SECTION_ENTRY(msk, val, label, __ftr_fixup)
486#define END_FTR_SECTION(msk, val) \
487 END_FTR_SECTION_NESTED(msk, val, 97)
488
489#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk))
490#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0)
491#endif /* __ASSEMBLY__ */
492
493#endif /* __KERNEL__ */ 513#endif /* __KERNEL__ */
494#endif /* __ASM_POWERPC_CPUTABLE_H */ 514#endif /* __ASM_POWERPC_CPUTABLE_H */