diff options
Diffstat (limited to 'include/asm-powerpc/cputable.h')
-rw-r--r-- | include/asm-powerpc/cputable.h | 84 |
1 files changed, 51 insertions, 33 deletions
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 1e79673b7316..2a3e9075a5a0 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 |
@@ -132,7 +139,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
132 | #define CPU_FTR_TAU ASM_CONST(0x0000000000000010) | 139 | #define CPU_FTR_TAU ASM_CONST(0x0000000000000010) |
133 | #define CPU_FTR_CAN_DOZE ASM_CONST(0x0000000000000020) | 140 | #define CPU_FTR_CAN_DOZE ASM_CONST(0x0000000000000020) |
134 | #define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040) | 141 | #define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040) |
135 | #define CPU_FTR_604_PERF_MON ASM_CONST(0x0000000000000080) | 142 | #define CPU_FTR_L2CSR ASM_CONST(0x0000000000000080) |
136 | #define CPU_FTR_601 ASM_CONST(0x0000000000000100) | 143 | #define CPU_FTR_601 ASM_CONST(0x0000000000000100) |
137 | #define CPU_FTR_HPTE_TABLE ASM_CONST(0x0000000000000200) | 144 | #define CPU_FTR_HPTE_TABLE ASM_CONST(0x0000000000000200) |
138 | #define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400) | 145 | #define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400) |
@@ -152,6 +159,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
152 | #define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000) | 159 | #define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000) |
153 | #define CPU_FTR_SPE ASM_CONST(0x0000000002000000) | 160 | #define CPU_FTR_SPE ASM_CONST(0x0000000002000000) |
154 | #define CPU_FTR_NEED_PAIRED_STWCX ASM_CONST(0x0000000004000000) | 161 | #define CPU_FTR_NEED_PAIRED_STWCX ASM_CONST(0x0000000004000000) |
162 | #define CPU_FTR_LWSYNC ASM_CONST(0x0000000008000000) | ||
155 | 163 | ||
156 | /* | 164 | /* |
157 | * Add the 64-bit processor unique features in the top half of the word; | 165 | * Add the 64-bit processor unique features in the top half of the word; |
@@ -180,6 +188,8 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
180 | #define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000) | 188 | #define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000) |
181 | #define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000) | 189 | #define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000) |
182 | #define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000) | 190 | #define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000) |
191 | #define CPU_FTR_VSX LONG_ASM_CONST(0x0010000000000000) | ||
192 | #define CPU_FTR_SAO LONG_ASM_CONST(0x0020000000000000) | ||
183 | 193 | ||
184 | #ifndef __ASSEMBLY__ | 194 | #ifndef __ASSEMBLY__ |
185 | 195 | ||
@@ -198,6 +208,17 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
198 | #define PPC_FEATURE_HAS_ALTIVEC_COMP 0 | 208 | #define PPC_FEATURE_HAS_ALTIVEC_COMP 0 |
199 | #endif | 209 | #endif |
200 | 210 | ||
211 | /* We only set the VSX features if the kernel was compiled with VSX | ||
212 | * support | ||
213 | */ | ||
214 | #ifdef CONFIG_VSX | ||
215 | #define CPU_FTR_VSX_COMP CPU_FTR_VSX | ||
216 | #define PPC_FEATURE_HAS_VSX_COMP PPC_FEATURE_HAS_VSX | ||
217 | #else | ||
218 | #define CPU_FTR_VSX_COMP 0 | ||
219 | #define PPC_FEATURE_HAS_VSX_COMP 0 | ||
220 | #endif | ||
221 | |||
201 | /* We only set the spe features if the kernel was compiled with spe | 222 | /* We only set the spe features if the kernel was compiled with spe |
202 | * support | 223 | * support |
203 | */ | 224 | */ |
@@ -245,8 +266,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
245 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ | 266 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ |
246 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) | 267 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
247 | #define CPU_FTRS_604 (CPU_FTR_COMMON | \ | 268 | #define CPU_FTRS_604 (CPU_FTR_COMMON | \ |
248 | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \ | 269 | 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 | \ | 270 | #define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | \ |
251 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 271 | 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) | 272 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
@@ -347,40 +367,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 | \ | 367 | #define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ |
348 | CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \ | 368 | CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \ |
349 | CPU_FTR_UNIFIED_ID_CACHE) | 369 | CPU_FTR_UNIFIED_ID_CACHE) |
350 | #define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ | 370 | #define CPU_FTRS_E500 (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ |
371 | CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN) | ||
372 | #define CPU_FTRS_E500_2 (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ | ||
373 | CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_BIG_PHYS | \ | ||
351 | CPU_FTR_NODSISRALIGN) | 374 | CPU_FTR_NODSISRALIGN) |
352 | #define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ | 375 | #define CPU_FTRS_E500MC (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ |
353 | CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) | 376 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN | \ |
377 | CPU_FTR_L2CSR | CPU_FTR_LWSYNC) | ||
354 | #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) | 378 | #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) |
355 | 379 | ||
356 | /* 64-bit CPUs */ | 380 | /* 64-bit CPUs */ |
357 | #define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | \ | 381 | #define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
358 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE) | 382 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE) |
359 | #define CPU_FTRS_RS64 (CPU_FTR_USE_TB | \ | 383 | #define CPU_FTRS_RS64 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
360 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ | 384 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ |
361 | CPU_FTR_MMCRA | CPU_FTR_CTRL) | 385 | CPU_FTR_MMCRA | CPU_FTR_CTRL) |
362 | #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | \ | 386 | #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
363 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 387 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
364 | CPU_FTR_MMCRA) | 388 | CPU_FTR_MMCRA) |
365 | #define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | \ | 389 | #define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
366 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 390 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
367 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA) | 391 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA) |
368 | #define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | \ | 392 | #define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
369 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 393 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
370 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 394 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
371 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 395 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
372 | CPU_FTR_PURR) | 396 | CPU_FTR_PURR) |
373 | #define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | \ | 397 | #define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
374 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 398 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
375 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 399 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
376 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 400 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
377 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ | 401 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ |
378 | CPU_FTR_DSCR) | 402 | CPU_FTR_DSCR) |
379 | #define CPU_FTRS_CELL (CPU_FTR_USE_TB | \ | 403 | #define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
404 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | ||
405 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | ||
406 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | ||
407 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ | ||
408 | CPU_FTR_DSCR | CPU_FTR_SAO) | ||
409 | #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ | ||
380 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 410 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
381 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 411 | 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) | 412 | CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG) |
383 | #define CPU_FTRS_PA6T (CPU_FTR_USE_TB | \ | 413 | #define CPU_FTRS_PA6T (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
384 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | 414 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ |
385 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ | 415 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ |
386 | CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_NO_SLBIE_B) | 416 | CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_NO_SLBIE_B) |
@@ -391,7 +421,8 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
391 | #define CPU_FTRS_POSSIBLE \ | 421 | #define CPU_FTRS_POSSIBLE \ |
392 | (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ | 422 | (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ |
393 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ | 423 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ |
394 | CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_1T_SEGMENT) | 424 | CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \ |
425 | CPU_FTR_1T_SEGMENT | CPU_FTR_VSX) | ||
395 | #else | 426 | #else |
396 | enum { | 427 | enum { |
397 | CPU_FTRS_POSSIBLE = | 428 | CPU_FTRS_POSSIBLE = |
@@ -421,7 +452,7 @@ enum { | |||
421 | CPU_FTRS_E200 | | 452 | CPU_FTRS_E200 | |
422 | #endif | 453 | #endif |
423 | #ifdef CONFIG_E500 | 454 | #ifdef CONFIG_E500 |
424 | CPU_FTRS_E500 | CPU_FTRS_E500_2 | | 455 | CPU_FTRS_E500 | CPU_FTRS_E500_2 | CPU_FTRS_E500MC | |
425 | #endif | 456 | #endif |
426 | 0, | 457 | 0, |
427 | }; | 458 | }; |
@@ -431,7 +462,7 @@ enum { | |||
431 | #define CPU_FTRS_ALWAYS \ | 462 | #define CPU_FTRS_ALWAYS \ |
432 | (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ | 463 | (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ |
433 | CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \ | 464 | CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \ |
434 | CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE) | 465 | CPU_FTRS_POWER7 & CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE) |
435 | #else | 466 | #else |
436 | enum { | 467 | enum { |
437 | CPU_FTRS_ALWAYS = | 468 | CPU_FTRS_ALWAYS = |
@@ -461,7 +492,7 @@ enum { | |||
461 | CPU_FTRS_E200 & | 492 | CPU_FTRS_E200 & |
462 | #endif | 493 | #endif |
463 | #ifdef CONFIG_E500 | 494 | #ifdef CONFIG_E500 |
464 | CPU_FTRS_E500 & CPU_FTRS_E500_2 & | 495 | CPU_FTRS_E500 & CPU_FTRS_E500_2 & CPU_FTRS_E500MC & |
465 | #endif | 496 | #endif |
466 | CPU_FTRS_POSSIBLE, | 497 | CPU_FTRS_POSSIBLE, |
467 | }; | 498 | }; |
@@ -477,18 +508,5 @@ static inline int cpu_has_feature(unsigned long feature) | |||
477 | 508 | ||
478 | #endif /* !__ASSEMBLY__ */ | 509 | #endif /* !__ASSEMBLY__ */ |
479 | 510 | ||
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__ */ | 511 | #endif /* __KERNEL__ */ |
494 | #endif /* __ASM_POWERPC_CPUTABLE_H */ | 512 | #endif /* __ASM_POWERPC_CPUTABLE_H */ |