cputable.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. #ifndef __ASM_POWERPC_CPUTABLE_H
  2. #define __ASM_POWERPC_CPUTABLE_H
  3. #include <linux/types.h>
  4. #include <asm/asm-compat.h>
  5. #include <asm/feature-fixups.h>
  6. #include <uapi/asm/cputable.h>
  7. #ifndef __ASSEMBLY__
  8. /* This structure can grow, it's real size is used by head.S code
  9. * via the mkdefs mechanism.
  10. */
  11. struct cpu_spec;
  12. typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
  13. typedef void (*cpu_restore_t)(void);
  14. enum powerpc_oprofile_type {
  15. PPC_OPROFILE_INVALID = 0,
  16. PPC_OPROFILE_RS64 = 1,
  17. PPC_OPROFILE_POWER4 = 2,
  18. PPC_OPROFILE_G4 = 3,
  19. PPC_OPROFILE_FSL_EMB = 4,
  20. PPC_OPROFILE_CELL = 5,
  21. PPC_OPROFILE_PA6T = 6,
  22. };
  23. enum powerpc_pmc_type {
  24. PPC_PMC_DEFAULT = 0,
  25. PPC_PMC_IBM = 1,
  26. PPC_PMC_PA6T = 2,
  27. PPC_PMC_G4 = 3,
  28. };
  29. struct pt_regs;
  30. extern int machine_check_generic(struct pt_regs *regs);
  31. extern int machine_check_4xx(struct pt_regs *regs);
  32. extern int machine_check_440A(struct pt_regs *regs);
  33. extern int machine_check_e500mc(struct pt_regs *regs);
  34. extern int machine_check_e500(struct pt_regs *regs);
  35. extern int machine_check_e200(struct pt_regs *regs);
  36. extern int machine_check_47x(struct pt_regs *regs);
  37. int machine_check_8xx(struct pt_regs *regs);
  38. extern void cpu_down_flush_e500v2(void);
  39. extern void cpu_down_flush_e500mc(void);
  40. extern void cpu_down_flush_e5500(void);
  41. extern void cpu_down_flush_e6500(void);
  42. /* NOTE WELL: Update identify_cpu() if fields are added or removed! */
  43. struct cpu_spec {
  44. /* CPU is matched via (PVR & pvr_mask) == pvr_value */
  45. unsigned int pvr_mask;
  46. unsigned int pvr_value;
  47. char *cpu_name;
  48. unsigned long cpu_features; /* Kernel features */
  49. unsigned int cpu_user_features; /* Userland features */
  50. unsigned int cpu_user_features2; /* Userland features v2 */
  51. unsigned int mmu_features; /* MMU features */
  52. /* cache line sizes */
  53. unsigned int icache_bsize;
  54. unsigned int dcache_bsize;
  55. /* flush caches inside the current cpu */
  56. void (*cpu_down_flush)(void);
  57. /* number of performance monitor counters */
  58. unsigned int num_pmcs;
  59. enum powerpc_pmc_type pmc_type;
  60. /* this is called to initialize various CPU bits like L1 cache,
  61. * BHT, SPD, etc... from head.S before branching to identify_machine
  62. */
  63. cpu_setup_t cpu_setup;
  64. /* Used to restore cpu setup on secondary processors and at resume */
  65. cpu_restore_t cpu_restore;
  66. /* Used by oprofile userspace to select the right counters */
  67. char *oprofile_cpu_type;
  68. /* Processor specific oprofile operations */
  69. enum powerpc_oprofile_type oprofile_type;
  70. /* Bit locations inside the mmcra change */
  71. unsigned long oprofile_mmcra_sihv;
  72. unsigned long oprofile_mmcra_sipr;
  73. /* Bits to clear during an oprofile exception */
  74. unsigned long oprofile_mmcra_clear;
  75. /* Name of processor class, for the ELF AT_PLATFORM entry */
  76. char *platform;
  77. /* Processor specific machine check handling. Return negative
  78. * if the error is fatal, 1 if it was fully recovered and 0 to
  79. * pass up (not CPU originated) */
  80. int (*machine_check)(struct pt_regs *regs);
  81. /*
  82. * Processor specific early machine check handler which is
  83. * called in real mode to handle SLB and TLB errors.
  84. */
  85. long (*machine_check_early)(struct pt_regs *regs);
  86. /*
  87. * Processor specific routine to flush tlbs.
  88. */
  89. void (*flush_tlb)(unsigned int action);
  90. };
  91. extern struct cpu_spec *cur_cpu_spec;
  92. extern unsigned int __start___ftr_fixup, __stop___ftr_fixup;
  93. extern struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr);
  94. extern void do_feature_fixups(unsigned long value, void *fixup_start,
  95. void *fixup_end);
  96. extern const char *powerpc_base_platform;
  97. #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS
  98. extern void cpu_feature_keys_init(void);
  99. #else
  100. static inline void cpu_feature_keys_init(void) { }
  101. #endif
  102. /* TLB flush actions. Used as argument to cpu_spec.flush_tlb() hook */
  103. enum {
  104. TLB_INVAL_SCOPE_GLOBAL = 0, /* invalidate all TLBs */
  105. TLB_INVAL_SCOPE_LPID = 1, /* invalidate TLBs for current LPID */
  106. };
  107. #endif /* __ASSEMBLY__ */
  108. /* CPU kernel features */
  109. /* Retain the 32b definitions all use bottom half of word */
  110. #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x00000001)
  111. #define CPU_FTR_L2CR ASM_CONST(0x00000002)
  112. #define CPU_FTR_SPEC7450 ASM_CONST(0x00000004)
  113. #define CPU_FTR_ALTIVEC ASM_CONST(0x00000008)
  114. #define CPU_FTR_TAU ASM_CONST(0x00000010)
  115. #define CPU_FTR_CAN_DOZE ASM_CONST(0x00000020)
  116. #define CPU_FTR_USE_TB ASM_CONST(0x00000040)
  117. #define CPU_FTR_L2CSR ASM_CONST(0x00000080)
  118. #define CPU_FTR_601 ASM_CONST(0x00000100)
  119. #define CPU_FTR_DBELL ASM_CONST(0x00000200)
  120. #define CPU_FTR_CAN_NAP ASM_CONST(0x00000400)
  121. #define CPU_FTR_L3CR ASM_CONST(0x00000800)
  122. #define CPU_FTR_L3_DISABLE_NAP ASM_CONST(0x00001000)
  123. #define CPU_FTR_NAP_DISABLE_L2_PR ASM_CONST(0x00002000)
  124. #define CPU_FTR_DUAL_PLL_750FX ASM_CONST(0x00004000)
  125. #define CPU_FTR_NO_DPM ASM_CONST(0x00008000)
  126. #define CPU_FTR_476_DD2 ASM_CONST(0x00010000)
  127. #define CPU_FTR_NEED_COHERENT ASM_CONST(0x00020000)
  128. #define CPU_FTR_NO_BTIC ASM_CONST(0x00040000)
  129. #define CPU_FTR_DEBUG_LVL_EXC ASM_CONST(0x00080000)
  130. #define CPU_FTR_NODSISRALIGN ASM_CONST(0x00100000)
  131. #define CPU_FTR_PPC_LE ASM_CONST(0x00200000)
  132. #define CPU_FTR_REAL_LE ASM_CONST(0x00400000)
  133. #define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x00800000)
  134. #define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x01000000)
  135. #define CPU_FTR_SPE ASM_CONST(0x02000000)
  136. #define CPU_FTR_NEED_PAIRED_STWCX ASM_CONST(0x04000000)
  137. #define CPU_FTR_LWSYNC ASM_CONST(0x08000000)
  138. #define CPU_FTR_NOEXECUTE ASM_CONST(0x10000000)
  139. #define CPU_FTR_INDEXED_DCR ASM_CONST(0x20000000)
  140. #define CPU_FTR_EMB_HV ASM_CONST(0x40000000)
  141. /*
  142. * Add the 64-bit processor unique features in the top half of the word;
  143. * on 32-bit, make the names available but defined to be 0.
  144. */
  145. #ifdef __powerpc64__
  146. #define LONG_ASM_CONST(x) ASM_CONST(x)
  147. #else
  148. #define LONG_ASM_CONST(x) 0
  149. #endif
  150. #define CPU_FTR_HVMODE LONG_ASM_CONST(0x0000000100000000)
  151. #define CPU_FTR_ARCH_201 LONG_ASM_CONST(0x0000000200000000)
  152. #define CPU_FTR_ARCH_206 LONG_ASM_CONST(0x0000000400000000)
  153. #define CPU_FTR_ARCH_207S LONG_ASM_CONST(0x0000000800000000)
  154. #define CPU_FTR_ARCH_300 LONG_ASM_CONST(0x0000001000000000)
  155. #define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000002000000000)
  156. #define CPU_FTR_CTRL LONG_ASM_CONST(0x0000004000000000)
  157. #define CPU_FTR_SMT LONG_ASM_CONST(0x0000008000000000)
  158. #define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000010000000000)
  159. #define CPU_FTR_PURR LONG_ASM_CONST(0x0000020000000000)
  160. #define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000040000000000)
  161. #define CPU_FTR_SPURR LONG_ASM_CONST(0x0000080000000000)
  162. #define CPU_FTR_DSCR LONG_ASM_CONST(0x0000100000000000)
  163. #define CPU_FTR_VSX LONG_ASM_CONST(0x0000200000000000)
  164. #define CPU_FTR_SAO LONG_ASM_CONST(0x0000400000000000)
  165. #define CPU_FTR_CP_USE_DCBTZ LONG_ASM_CONST(0x0000800000000000)
  166. #define CPU_FTR_UNALIGNED_LD_STD LONG_ASM_CONST(0x0001000000000000)
  167. #define CPU_FTR_ASYM_SMT LONG_ASM_CONST(0x0002000000000000)
  168. #define CPU_FTR_STCX_CHECKS_ADDRESS LONG_ASM_CONST(0x0004000000000000)
  169. #define CPU_FTR_POPCNTB LONG_ASM_CONST(0x0008000000000000)
  170. #define CPU_FTR_POPCNTD LONG_ASM_CONST(0x0010000000000000)
  171. #define CPU_FTR_ICSWX LONG_ASM_CONST(0x0020000000000000)
  172. #define CPU_FTR_VMX_COPY LONG_ASM_CONST(0x0040000000000000)
  173. #define CPU_FTR_TM LONG_ASM_CONST(0x0080000000000000)
  174. #define CPU_FTR_CFAR LONG_ASM_CONST(0x0100000000000000)
  175. #define CPU_FTR_HAS_PPR LONG_ASM_CONST(0x0200000000000000)
  176. #define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000)
  177. #define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000)
  178. #define CPU_FTR_PMAO_BUG LONG_ASM_CONST(0x1000000000000000)
  179. #define CPU_FTR_SUBCORE LONG_ASM_CONST(0x2000000000000000)
  180. #define CPU_FTR_POWER9_DD1 LONG_ASM_CONST(0x4000000000000000)
  181. #ifndef __ASSEMBLY__
  182. #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN)
  183. #define MMU_FTR_PPCAS_ARCH_V2 (MMU_FTR_TLBIEL | MMU_FTR_16M_PAGE)
  184. /* We only set the altivec features if the kernel was compiled with altivec
  185. * support
  186. */
  187. #ifdef CONFIG_ALTIVEC
  188. #define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC
  189. #define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
  190. #else
  191. #define CPU_FTR_ALTIVEC_COMP 0
  192. #define PPC_FEATURE_HAS_ALTIVEC_COMP 0
  193. #endif
  194. /* We only set the VSX features if the kernel was compiled with VSX
  195. * support
  196. */
  197. #ifdef CONFIG_VSX
  198. #define CPU_FTR_VSX_COMP CPU_FTR_VSX
  199. #define PPC_FEATURE_HAS_VSX_COMP PPC_FEATURE_HAS_VSX
  200. #else
  201. #define CPU_FTR_VSX_COMP 0
  202. #define PPC_FEATURE_HAS_VSX_COMP 0
  203. #endif
  204. /* We only set the spe features if the kernel was compiled with spe
  205. * support
  206. */
  207. #ifdef CONFIG_SPE
  208. #define CPU_FTR_SPE_COMP CPU_FTR_SPE
  209. #define PPC_FEATURE_HAS_SPE_COMP PPC_FEATURE_HAS_SPE
  210. #define PPC_FEATURE_HAS_EFP_SINGLE_COMP PPC_FEATURE_HAS_EFP_SINGLE
  211. #define PPC_FEATURE_HAS_EFP_DOUBLE_COMP PPC_FEATURE_HAS_EFP_DOUBLE
  212. #else
  213. #define CPU_FTR_SPE_COMP 0
  214. #define PPC_FEATURE_HAS_SPE_COMP 0
  215. #define PPC_FEATURE_HAS_EFP_SINGLE_COMP 0
  216. #define PPC_FEATURE_HAS_EFP_DOUBLE_COMP 0
  217. #endif
  218. /* We only set the TM feature if the kernel was compiled with TM supprt */
  219. #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
  220. #define CPU_FTR_TM_COMP CPU_FTR_TM
  221. #define PPC_FEATURE2_HTM_COMP PPC_FEATURE2_HTM
  222. #define PPC_FEATURE2_HTM_NOSC_COMP PPC_FEATURE2_HTM_NOSC
  223. #else
  224. #define CPU_FTR_TM_COMP 0
  225. #define PPC_FEATURE2_HTM_COMP 0
  226. #define PPC_FEATURE2_HTM_NOSC_COMP 0
  227. #endif
  228. /* We need to mark all pages as being coherent if we're SMP or we have a
  229. * 74[45]x and an MPC107 host bridge. Also 83xx and PowerQUICC II
  230. * require it for PCI "streaming/prefetch" to work properly.
  231. * This is also required by 52xx family.
  232. */
  233. #if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) \
  234. || defined(CONFIG_PPC_83xx) || defined(CONFIG_8260) \
  235. || defined(CONFIG_PPC_MPC52xx)
  236. #define CPU_FTR_COMMON CPU_FTR_NEED_COHERENT
  237. #else
  238. #define CPU_FTR_COMMON 0
  239. #endif
  240. /* The powersave features NAP & DOZE seems to confuse BDI when
  241. debugging. So if a BDI is used, disable theses
  242. */
  243. #ifndef CONFIG_BDI_SWITCH
  244. #define CPU_FTR_MAYBE_CAN_DOZE CPU_FTR_CAN_DOZE
  245. #define CPU_FTR_MAYBE_CAN_NAP CPU_FTR_CAN_NAP
  246. #else
  247. #define CPU_FTR_MAYBE_CAN_DOZE 0
  248. #define CPU_FTR_MAYBE_CAN_NAP 0
  249. #endif
  250. #define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | \
  251. CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE)
  252. #define CPU_FTRS_603 (CPU_FTR_COMMON | \
  253. CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
  254. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
  255. #define CPU_FTRS_604 (CPU_FTR_COMMON | \
  256. CPU_FTR_USE_TB | CPU_FTR_PPC_LE)
  257. #define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | \
  258. CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
  259. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
  260. #define CPU_FTRS_740 (CPU_FTR_COMMON | \
  261. CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
  262. CPU_FTR_TAU | CPU_FTR_MAYBE_CAN_NAP | \
  263. CPU_FTR_PPC_LE)
  264. #define CPU_FTRS_750 (CPU_FTR_COMMON | \
  265. CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
  266. CPU_FTR_TAU | CPU_FTR_MAYBE_CAN_NAP | \
  267. CPU_FTR_PPC_LE)
  268. #define CPU_FTRS_750CL (CPU_FTRS_750)
  269. #define CPU_FTRS_750FX1 (CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM)
  270. #define CPU_FTRS_750FX2 (CPU_FTRS_750 | CPU_FTR_NO_DPM)
  271. #define CPU_FTRS_750FX (CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX)
  272. #define CPU_FTRS_750GX (CPU_FTRS_750FX)
  273. #define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | \
  274. CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
  275. CPU_FTR_ALTIVEC_COMP | \
  276. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
  277. #define CPU_FTRS_7400 (CPU_FTR_COMMON | \
  278. CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
  279. CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | \
  280. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
  281. #define CPU_FTRS_7450_20 (CPU_FTR_COMMON | \
  282. CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  283. CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
  284. CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
  285. #define CPU_FTRS_7450_21 (CPU_FTR_COMMON | \
  286. CPU_FTR_USE_TB | \
  287. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  288. CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
  289. CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
  290. CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
  291. #define CPU_FTRS_7450_23 (CPU_FTR_COMMON | \
  292. CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
  293. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  294. CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
  295. CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
  296. #define CPU_FTRS_7455_1 (CPU_FTR_COMMON | \
  297. CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
  298. CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \
  299. CPU_FTR_SPEC7450 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
  300. #define CPU_FTRS_7455_20 (CPU_FTR_COMMON | \
  301. CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
  302. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  303. CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
  304. CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
  305. CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
  306. #define CPU_FTRS_7455 (CPU_FTR_COMMON | \
  307. CPU_FTR_USE_TB | \
  308. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  309. CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
  310. CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
  311. #define CPU_FTRS_7447_10 (CPU_FTR_COMMON | \
  312. CPU_FTR_USE_TB | \
  313. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  314. CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
  315. CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE | \
  316. CPU_FTR_NEED_PAIRED_STWCX)
  317. #define CPU_FTRS_7447 (CPU_FTR_COMMON | \
  318. CPU_FTR_USE_TB | \
  319. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  320. CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
  321. CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
  322. #define CPU_FTRS_7447A (CPU_FTR_COMMON | \
  323. CPU_FTR_USE_TB | \
  324. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  325. CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
  326. CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
  327. #define CPU_FTRS_7448 (CPU_FTR_COMMON | \
  328. CPU_FTR_USE_TB | \
  329. CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
  330. CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
  331. CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
  332. #define CPU_FTRS_82XX (CPU_FTR_COMMON | \
  333. CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
  334. #define CPU_FTRS_G2_LE (CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
  335. CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP)
  336. #define CPU_FTRS_E300 (CPU_FTR_MAYBE_CAN_DOZE | \
  337. CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | \
  338. CPU_FTR_COMMON)
  339. #define CPU_FTRS_E300C2 (CPU_FTR_MAYBE_CAN_DOZE | \
  340. CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | \
  341. CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE)
  342. #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_USE_TB)
  343. #define CPU_FTRS_8XX (CPU_FTR_USE_TB | CPU_FTR_NOEXECUTE)
  344. #define CPU_FTRS_40X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
  345. #define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
  346. #define CPU_FTRS_440x6 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE | \
  347. CPU_FTR_INDEXED_DCR)
  348. #define CPU_FTRS_47X (CPU_FTRS_440x6)
  349. #define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
  350. CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \
  351. CPU_FTR_UNIFIED_ID_CACHE | CPU_FTR_NOEXECUTE | \
  352. CPU_FTR_DEBUG_LVL_EXC)
  353. #define CPU_FTRS_E500 (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
  354. CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
  355. CPU_FTR_NOEXECUTE)
  356. #define CPU_FTRS_E500_2 (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
  357. CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | \
  358. CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
  359. #define CPU_FTRS_E500MC (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
  360. CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
  361. CPU_FTR_DBELL | CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV)
  362. /*
  363. * e5500/e6500 erratum A-006958 is a timebase bug that can use the
  364. * same workaround as CPU_FTR_CELL_TB_BUG.
  365. */
  366. #define CPU_FTRS_E5500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
  367. CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
  368. CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
  369. CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_CELL_TB_BUG)
  370. #define CPU_FTRS_E6500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
  371. CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
  372. CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
  373. CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \
  374. CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT)
  375. #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
  376. /* 64-bit CPUs */
  377. #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  378. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
  379. CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \
  380. CPU_FTR_STCX_CHECKS_ADDRESS)
  381. #define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  382. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_201 | \
  383. CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \
  384. CPU_FTR_CP_USE_DCBTZ | CPU_FTR_STCX_CHECKS_ADDRESS | \
  385. CPU_FTR_HVMODE | CPU_FTR_DABRX)
  386. #define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  387. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
  388. CPU_FTR_MMCRA | CPU_FTR_SMT | \
  389. CPU_FTR_COHERENT_ICACHE | CPU_FTR_PURR | \
  390. CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_DABRX)
  391. #define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  392. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
  393. CPU_FTR_MMCRA | CPU_FTR_SMT | \
  394. CPU_FTR_COHERENT_ICACHE | \
  395. CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
  396. CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \
  397. CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_CFAR | \
  398. CPU_FTR_DABRX)
  399. #define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  400. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
  401. CPU_FTR_MMCRA | CPU_FTR_SMT | \
  402. CPU_FTR_COHERENT_ICACHE | \
  403. CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
  404. CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \
  405. CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
  406. CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | \
  407. CPU_FTR_VMX_COPY | CPU_FTR_HAS_PPR | CPU_FTR_DABRX)
  408. #define CPU_FTRS_POWER8 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  409. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
  410. CPU_FTR_MMCRA | CPU_FTR_SMT | \
  411. CPU_FTR_COHERENT_ICACHE | \
  412. CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
  413. CPU_FTR_DSCR | CPU_FTR_SAO | \
  414. CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
  415. CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
  416. CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
  417. CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP | CPU_FTR_SUBCORE)
  418. #define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG)
  419. #define CPU_FTRS_POWER8_DD1 (CPU_FTRS_POWER8 & ~CPU_FTR_DBELL)
  420. #define CPU_FTRS_POWER9 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  421. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
  422. CPU_FTR_MMCRA | CPU_FTR_SMT | \
  423. CPU_FTR_COHERENT_ICACHE | \
  424. CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
  425. CPU_FTR_DSCR | CPU_FTR_SAO | \
  426. CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
  427. CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
  428. CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
  429. CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP | CPU_FTR_ARCH_300)
  430. #define CPU_FTRS_POWER9_DD1 ((CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD1) & \
  431. (~CPU_FTR_SAO))
  432. #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  433. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
  434. CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
  435. CPU_FTR_PAUSE_ZERO | CPU_FTR_CELL_TB_BUG | CPU_FTR_CP_USE_DCBTZ | \
  436. CPU_FTR_UNALIGNED_LD_STD | CPU_FTR_DABRX)
  437. #define CPU_FTRS_PA6T (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
  438. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP | \
  439. CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_DABRX)
  440. #define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2)
  441. #ifdef __powerpc64__
  442. #ifdef CONFIG_PPC_BOOK3E
  443. #define CPU_FTRS_POSSIBLE (CPU_FTRS_E6500 | CPU_FTRS_E5500)
  444. #else
  445. #define CPU_FTRS_POSSIBLE \
  446. (CPU_FTRS_POWER4 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \
  447. CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
  448. CPU_FTRS_POWER8 | CPU_FTRS_POWER8_DD1 | CPU_FTRS_CELL | \
  449. CPU_FTRS_PA6T | CPU_FTR_VSX | CPU_FTRS_POWER9 | CPU_FTRS_POWER9_DD1)
  450. #endif
  451. #else
  452. enum {
  453. CPU_FTRS_POSSIBLE =
  454. #ifdef CONFIG_PPC_BOOK3S_32
  455. CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU |
  456. CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 |
  457. CPU_FTRS_750FX2 | CPU_FTRS_750FX | CPU_FTRS_750GX |
  458. CPU_FTRS_7400_NOTAU | CPU_FTRS_7400 | CPU_FTRS_7450_20 |
  459. CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 |
  460. CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 |
  461. CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX |
  462. CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 |
  463. CPU_FTRS_CLASSIC32 |
  464. #else
  465. CPU_FTRS_GENERIC_32 |
  466. #endif
  467. #ifdef CONFIG_8xx
  468. CPU_FTRS_8XX |
  469. #endif
  470. #ifdef CONFIG_40x
  471. CPU_FTRS_40X |
  472. #endif
  473. #ifdef CONFIG_44x
  474. CPU_FTRS_44X | CPU_FTRS_440x6 |
  475. #endif
  476. #ifdef CONFIG_PPC_47x
  477. CPU_FTRS_47X | CPU_FTR_476_DD2 |
  478. #endif
  479. #ifdef CONFIG_E200
  480. CPU_FTRS_E200 |
  481. #endif
  482. #ifdef CONFIG_E500
  483. CPU_FTRS_E500 | CPU_FTRS_E500_2 |
  484. #endif
  485. #ifdef CONFIG_PPC_E500MC
  486. CPU_FTRS_E500MC | CPU_FTRS_E5500 | CPU_FTRS_E6500 |
  487. #endif
  488. 0,
  489. };
  490. #endif /* __powerpc64__ */
  491. #ifdef __powerpc64__
  492. #ifdef CONFIG_PPC_BOOK3E
  493. #define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500)
  494. #else
  495. #define CPU_FTRS_ALWAYS \
  496. (CPU_FTRS_POWER4 & CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \
  497. CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \
  498. CPU_FTRS_PA6T & CPU_FTRS_POWER8 & CPU_FTRS_POWER8E & \
  499. CPU_FTRS_POWER8_DD1 & ~CPU_FTR_HVMODE & CPU_FTRS_POSSIBLE & \
  500. CPU_FTRS_POWER9)
  501. #endif
  502. #else
  503. enum {
  504. CPU_FTRS_ALWAYS =
  505. #ifdef CONFIG_PPC_BOOK3S_32
  506. CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU &
  507. CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 &
  508. CPU_FTRS_750FX2 & CPU_FTRS_750FX & CPU_FTRS_750GX &
  509. CPU_FTRS_7400_NOTAU & CPU_FTRS_7400 & CPU_FTRS_7450_20 &
  510. CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 &
  511. CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 &
  512. CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX &
  513. CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 &
  514. CPU_FTRS_CLASSIC32 &
  515. #else
  516. CPU_FTRS_GENERIC_32 &
  517. #endif
  518. #ifdef CONFIG_8xx
  519. CPU_FTRS_8XX &
  520. #endif
  521. #ifdef CONFIG_40x
  522. CPU_FTRS_40X &
  523. #endif
  524. #ifdef CONFIG_44x
  525. CPU_FTRS_44X & CPU_FTRS_440x6 &
  526. #endif
  527. #ifdef CONFIG_E200
  528. CPU_FTRS_E200 &
  529. #endif
  530. #ifdef CONFIG_E500
  531. CPU_FTRS_E500 & CPU_FTRS_E500_2 &
  532. #endif
  533. #ifdef CONFIG_PPC_E500MC
  534. CPU_FTRS_E500MC & CPU_FTRS_E5500 & CPU_FTRS_E6500 &
  535. #endif
  536. ~CPU_FTR_EMB_HV & /* can be removed at runtime */
  537. CPU_FTRS_POSSIBLE,
  538. };
  539. #endif /* __powerpc64__ */
  540. #define HBP_NUM 1
  541. #endif /* !__ASSEMBLY__ */
  542. #endif /* __ASM_POWERPC_CPUTABLE_H */