xref: /linux/arch/powerpc/include/asm/cputable.h (revision cbbc6f1b1433ef553d57826eee87a84ca49645ce)
1b8b572e1SStephen Rothwell #ifndef __ASM_POWERPC_CPUTABLE_H
2b8b572e1SStephen Rothwell #define __ASM_POWERPC_CPUTABLE_H
3b8b572e1SStephen Rothwell 
4b8b572e1SStephen Rothwell 
5b8b572e1SStephen Rothwell #include <asm/asm-compat.h>
6b8b572e1SStephen Rothwell #include <asm/feature-fixups.h>
7c3617f72SDavid Howells #include <uapi/asm/cputable.h>
8b8b572e1SStephen Rothwell 
9b8b572e1SStephen Rothwell #ifndef __ASSEMBLY__
10b8b572e1SStephen Rothwell 
11b8b572e1SStephen Rothwell /* This structure can grow, it's real size is used by head.S code
12b8b572e1SStephen Rothwell  * via the mkdefs mechanism.
13b8b572e1SStephen Rothwell  */
14b8b572e1SStephen Rothwell struct cpu_spec;
15b8b572e1SStephen Rothwell 
16b8b572e1SStephen Rothwell typedef	void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
17b8b572e1SStephen Rothwell typedef	void (*cpu_restore_t)(void);
18b8b572e1SStephen Rothwell 
19b8b572e1SStephen Rothwell enum powerpc_oprofile_type {
20b8b572e1SStephen Rothwell 	PPC_OPROFILE_INVALID = 0,
21b8b572e1SStephen Rothwell 	PPC_OPROFILE_RS64 = 1,
22b8b572e1SStephen Rothwell 	PPC_OPROFILE_POWER4 = 2,
23b8b572e1SStephen Rothwell 	PPC_OPROFILE_G4 = 3,
24b8b572e1SStephen Rothwell 	PPC_OPROFILE_FSL_EMB = 4,
25b8b572e1SStephen Rothwell 	PPC_OPROFILE_CELL = 5,
26b8b572e1SStephen Rothwell 	PPC_OPROFILE_PA6T = 6,
27b8b572e1SStephen Rothwell };
28b8b572e1SStephen Rothwell 
29b8b572e1SStephen Rothwell enum powerpc_pmc_type {
30b8b572e1SStephen Rothwell 	PPC_PMC_DEFAULT = 0,
31b8b572e1SStephen Rothwell 	PPC_PMC_IBM = 1,
32b8b572e1SStephen Rothwell 	PPC_PMC_PA6T = 2,
33b950bdd0SBenjamin Herrenschmidt 	PPC_PMC_G4 = 3,
34b8b572e1SStephen Rothwell };
35b8b572e1SStephen Rothwell 
36b8b572e1SStephen Rothwell struct pt_regs;
37b8b572e1SStephen Rothwell 
38b8b572e1SStephen Rothwell extern int machine_check_generic(struct pt_regs *regs);
39b8b572e1SStephen Rothwell extern int machine_check_4xx(struct pt_regs *regs);
40b8b572e1SStephen Rothwell extern int machine_check_440A(struct pt_regs *regs);
41fe04b112SScott Wood extern int machine_check_e500mc(struct pt_regs *regs);
42b8b572e1SStephen Rothwell extern int machine_check_e500(struct pt_regs *regs);
43b8b572e1SStephen Rothwell extern int machine_check_e200(struct pt_regs *regs);
44fc5e7097SDave Kleikamp extern int machine_check_47x(struct pt_regs *regs);
45b8b572e1SStephen Rothwell 
46b8b572e1SStephen Rothwell /* NOTE WELL: Update identify_cpu() if fields are added or removed! */
47b8b572e1SStephen Rothwell struct cpu_spec {
48b8b572e1SStephen Rothwell 	/* CPU is matched via (PVR & pvr_mask) == pvr_value */
49b8b572e1SStephen Rothwell 	unsigned int	pvr_mask;
50b8b572e1SStephen Rothwell 	unsigned int	pvr_value;
51b8b572e1SStephen Rothwell 
52b8b572e1SStephen Rothwell 	char		*cpu_name;
53b8b572e1SStephen Rothwell 	unsigned long	cpu_features;		/* Kernel features */
54b8b572e1SStephen Rothwell 	unsigned int	cpu_user_features;	/* Userland features */
552171364dSMichael Neuling 	unsigned int	cpu_user_features2;	/* Userland features v2 */
567c03d653SBenjamin Herrenschmidt 	unsigned int	mmu_features;		/* MMU features */
57b8b572e1SStephen Rothwell 
58b8b572e1SStephen Rothwell 	/* cache line sizes */
59b8b572e1SStephen Rothwell 	unsigned int	icache_bsize;
60b8b572e1SStephen Rothwell 	unsigned int	dcache_bsize;
61b8b572e1SStephen Rothwell 
62b8b572e1SStephen Rothwell 	/* number of performance monitor counters */
63b8b572e1SStephen Rothwell 	unsigned int	num_pmcs;
64b8b572e1SStephen Rothwell 	enum powerpc_pmc_type pmc_type;
65b8b572e1SStephen Rothwell 
66b8b572e1SStephen Rothwell 	/* this is called to initialize various CPU bits like L1 cache,
67b8b572e1SStephen Rothwell 	 * BHT, SPD, etc... from head.S before branching to identify_machine
68b8b572e1SStephen Rothwell 	 */
69b8b572e1SStephen Rothwell 	cpu_setup_t	cpu_setup;
70b8b572e1SStephen Rothwell 	/* Used to restore cpu setup on secondary processors and at resume */
71b8b572e1SStephen Rothwell 	cpu_restore_t	cpu_restore;
72b8b572e1SStephen Rothwell 
73b8b572e1SStephen Rothwell 	/* Used by oprofile userspace to select the right counters */
74b8b572e1SStephen Rothwell 	char		*oprofile_cpu_type;
75b8b572e1SStephen Rothwell 
76b8b572e1SStephen Rothwell 	/* Processor specific oprofile operations */
77b8b572e1SStephen Rothwell 	enum powerpc_oprofile_type oprofile_type;
78b8b572e1SStephen Rothwell 
79b8b572e1SStephen Rothwell 	/* Bit locations inside the mmcra change */
80b8b572e1SStephen Rothwell 	unsigned long	oprofile_mmcra_sihv;
81b8b572e1SStephen Rothwell 	unsigned long	oprofile_mmcra_sipr;
82b8b572e1SStephen Rothwell 
83b8b572e1SStephen Rothwell 	/* Bits to clear during an oprofile exception */
84b8b572e1SStephen Rothwell 	unsigned long	oprofile_mmcra_clear;
85b8b572e1SStephen Rothwell 
86b8b572e1SStephen Rothwell 	/* Name of processor class, for the ELF AT_PLATFORM entry */
87b8b572e1SStephen Rothwell 	char		*platform;
88b8b572e1SStephen Rothwell 
89b8b572e1SStephen Rothwell 	/* Processor specific machine check handling. Return negative
90b8b572e1SStephen Rothwell 	 * if the error is fatal, 1 if it was fully recovered and 0 to
91b8b572e1SStephen Rothwell 	 * pass up (not CPU originated) */
92b8b572e1SStephen Rothwell 	int		(*machine_check)(struct pt_regs *regs);
93b8b572e1SStephen Rothwell };
94b8b572e1SStephen Rothwell 
95b8b572e1SStephen Rothwell extern struct cpu_spec		*cur_cpu_spec;
96b8b572e1SStephen Rothwell 
97b8b572e1SStephen Rothwell extern unsigned int __start___ftr_fixup, __stop___ftr_fixup;
98b8b572e1SStephen Rothwell 
99b8b572e1SStephen Rothwell extern struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr);
100b8b572e1SStephen Rothwell extern void do_feature_fixups(unsigned long value, void *fixup_start,
101b8b572e1SStephen Rothwell 			      void *fixup_end);
102b8b572e1SStephen Rothwell 
103b8b572e1SStephen Rothwell extern const char *powerpc_base_platform;
104b8b572e1SStephen Rothwell 
105b8b572e1SStephen Rothwell #endif /* __ASSEMBLY__ */
106b8b572e1SStephen Rothwell 
107b8b572e1SStephen Rothwell /* CPU kernel features */
108b8b572e1SStephen Rothwell 
109b8b572e1SStephen Rothwell /* Retain the 32b definitions all use bottom half of word */
110cde4d494SMichael Neuling #define CPU_FTR_COHERENT_ICACHE		ASM_CONST(0x00000001)
111cde4d494SMichael Neuling #define CPU_FTR_L2CR			ASM_CONST(0x00000002)
112cde4d494SMichael Neuling #define CPU_FTR_SPEC7450		ASM_CONST(0x00000004)
113cde4d494SMichael Neuling #define CPU_FTR_ALTIVEC			ASM_CONST(0x00000008)
114cde4d494SMichael Neuling #define CPU_FTR_TAU			ASM_CONST(0x00000010)
115cde4d494SMichael Neuling #define CPU_FTR_CAN_DOZE		ASM_CONST(0x00000020)
116cde4d494SMichael Neuling #define CPU_FTR_USE_TB			ASM_CONST(0x00000040)
117cde4d494SMichael Neuling #define CPU_FTR_L2CSR			ASM_CONST(0x00000080)
118cde4d494SMichael Neuling #define CPU_FTR_601			ASM_CONST(0x00000100)
119cde4d494SMichael Neuling #define CPU_FTR_DBELL			ASM_CONST(0x00000200)
120cde4d494SMichael Neuling #define CPU_FTR_CAN_NAP			ASM_CONST(0x00000400)
121cde4d494SMichael Neuling #define CPU_FTR_L3CR			ASM_CONST(0x00000800)
122cde4d494SMichael Neuling #define CPU_FTR_L3_DISABLE_NAP		ASM_CONST(0x00001000)
123cde4d494SMichael Neuling #define CPU_FTR_NAP_DISABLE_L2_PR	ASM_CONST(0x00002000)
124cde4d494SMichael Neuling #define CPU_FTR_DUAL_PLL_750FX		ASM_CONST(0x00004000)
125cde4d494SMichael Neuling #define CPU_FTR_NO_DPM			ASM_CONST(0x00008000)
126cde4d494SMichael Neuling #define CPU_FTR_476_DD2			ASM_CONST(0x00010000)
127cde4d494SMichael Neuling #define CPU_FTR_NEED_COHERENT		ASM_CONST(0x00020000)
128cde4d494SMichael Neuling #define CPU_FTR_NO_BTIC			ASM_CONST(0x00040000)
129cde4d494SMichael Neuling #define CPU_FTR_DEBUG_LVL_EXC		ASM_CONST(0x00080000)
130cde4d494SMichael Neuling #define CPU_FTR_NODSISRALIGN		ASM_CONST(0x00100000)
131cde4d494SMichael Neuling #define CPU_FTR_PPC_LE			ASM_CONST(0x00200000)
132cde4d494SMichael Neuling #define CPU_FTR_REAL_LE			ASM_CONST(0x00400000)
133cde4d494SMichael Neuling #define CPU_FTR_FPU_UNAVAILABLE		ASM_CONST(0x00800000)
134cde4d494SMichael Neuling #define CPU_FTR_UNIFIED_ID_CACHE	ASM_CONST(0x01000000)
135cde4d494SMichael Neuling #define CPU_FTR_SPE			ASM_CONST(0x02000000)
136cde4d494SMichael Neuling #define CPU_FTR_NEED_PAIRED_STWCX	ASM_CONST(0x04000000)
137cde4d494SMichael Neuling #define CPU_FTR_LWSYNC			ASM_CONST(0x08000000)
138cde4d494SMichael Neuling #define CPU_FTR_NOEXECUTE		ASM_CONST(0x10000000)
139cde4d494SMichael Neuling #define CPU_FTR_INDEXED_DCR		ASM_CONST(0x20000000)
140cde4d494SMichael Neuling #define CPU_FTR_EMB_HV			ASM_CONST(0x40000000)
141b8b572e1SStephen Rothwell 
142b8b572e1SStephen Rothwell /*
143b8b572e1SStephen Rothwell  * Add the 64-bit processor unique features in the top half of the word;
144b8b572e1SStephen Rothwell  * on 32-bit, make the names available but defined to be 0.
145b8b572e1SStephen Rothwell  */
146b8b572e1SStephen Rothwell #ifdef __powerpc64__
147b8b572e1SStephen Rothwell #define LONG_ASM_CONST(x)		ASM_CONST(x)
148b8b572e1SStephen Rothwell #else
149b8b572e1SStephen Rothwell #define LONG_ASM_CONST(x)		0
150b8b572e1SStephen Rothwell #endif
151b8b572e1SStephen Rothwell 
1521580b3b8SMichael Neuling #define CPU_FTR_HVMODE			LONG_ASM_CONST(0x0000000100000000)
1531580b3b8SMichael Neuling #define CPU_FTR_ARCH_201		LONG_ASM_CONST(0x0000000200000000)
1541580b3b8SMichael Neuling #define CPU_FTR_ARCH_206		LONG_ASM_CONST(0x0000000400000000)
1551de2bd4eSMichael Ellerman #define CPU_FTR_ARCH_207S		LONG_ASM_CONST(0x0000000800000000)
1561580b3b8SMichael Neuling #define CPU_FTR_IABR			LONG_ASM_CONST(0x0000001000000000)
1571580b3b8SMichael Neuling #define CPU_FTR_MMCRA			LONG_ASM_CONST(0x0000002000000000)
1581580b3b8SMichael Neuling #define CPU_FTR_CTRL			LONG_ASM_CONST(0x0000004000000000)
1591580b3b8SMichael Neuling #define CPU_FTR_SMT			LONG_ASM_CONST(0x0000008000000000)
1601580b3b8SMichael Neuling #define CPU_FTR_PAUSE_ZERO		LONG_ASM_CONST(0x0000010000000000)
1611580b3b8SMichael Neuling #define CPU_FTR_PURR			LONG_ASM_CONST(0x0000020000000000)
1621580b3b8SMichael Neuling #define CPU_FTR_CELL_TB_BUG		LONG_ASM_CONST(0x0000040000000000)
1631580b3b8SMichael Neuling #define CPU_FTR_SPURR			LONG_ASM_CONST(0x0000080000000000)
1641580b3b8SMichael Neuling #define CPU_FTR_DSCR			LONG_ASM_CONST(0x0000100000000000)
1651580b3b8SMichael Neuling #define CPU_FTR_VSX			LONG_ASM_CONST(0x0000200000000000)
1661580b3b8SMichael Neuling #define CPU_FTR_SAO			LONG_ASM_CONST(0x0000400000000000)
1671580b3b8SMichael Neuling #define CPU_FTR_CP_USE_DCBTZ		LONG_ASM_CONST(0x0000800000000000)
1681580b3b8SMichael Neuling #define CPU_FTR_UNALIGNED_LD_STD	LONG_ASM_CONST(0x0001000000000000)
1691580b3b8SMichael Neuling #define CPU_FTR_ASYM_SMT		LONG_ASM_CONST(0x0002000000000000)
1701580b3b8SMichael Neuling #define CPU_FTR_STCX_CHECKS_ADDRESS	LONG_ASM_CONST(0x0004000000000000)
1711580b3b8SMichael Neuling #define CPU_FTR_POPCNTB			LONG_ASM_CONST(0x0008000000000000)
1721580b3b8SMichael Neuling #define CPU_FTR_POPCNTD			LONG_ASM_CONST(0x0010000000000000)
1731580b3b8SMichael Neuling #define CPU_FTR_ICSWX			LONG_ASM_CONST(0x0020000000000000)
1741580b3b8SMichael Neuling #define CPU_FTR_VMX_COPY		LONG_ASM_CONST(0x0040000000000000)
1751580b3b8SMichael Neuling #define CPU_FTR_TM			LONG_ASM_CONST(0x0080000000000000)
1761de2bd4eSMichael Ellerman #define CPU_FTR_CFAR			LONG_ASM_CONST(0x0100000000000000)
1771580b3b8SMichael Neuling #define	CPU_FTR_HAS_PPR			LONG_ASM_CONST(0x0200000000000000)
17879879c17SMichael Neuling #define CPU_FTR_DAWR			LONG_ASM_CONST(0x0400000000000000)
179b8b572e1SStephen Rothwell 
180b8b572e1SStephen Rothwell #ifndef __ASSEMBLY__
181b8b572e1SStephen Rothwell 
18244ae3ab3SMatt Evans #define CPU_FTR_PPCAS_ARCH_V2	(CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN)
18344ae3ab3SMatt Evans 
18444ae3ab3SMatt Evans #define MMU_FTR_PPCAS_ARCH_V2 	(MMU_FTR_SLB | MMU_FTR_TLBIEL | \
18544ae3ab3SMatt Evans 				 MMU_FTR_16M_PAGE)
186b8b572e1SStephen Rothwell 
187b8b572e1SStephen Rothwell /* We only set the altivec features if the kernel was compiled with altivec
188b8b572e1SStephen Rothwell  * support
189b8b572e1SStephen Rothwell  */
190b8b572e1SStephen Rothwell #ifdef CONFIG_ALTIVEC
191b8b572e1SStephen Rothwell #define CPU_FTR_ALTIVEC_COMP	CPU_FTR_ALTIVEC
192b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
193b8b572e1SStephen Rothwell #else
194b8b572e1SStephen Rothwell #define CPU_FTR_ALTIVEC_COMP	0
195b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_ALTIVEC_COMP    0
196b8b572e1SStephen Rothwell #endif
197b8b572e1SStephen Rothwell 
198b8b572e1SStephen Rothwell /* We only set the VSX features if the kernel was compiled with VSX
199b8b572e1SStephen Rothwell  * support
200b8b572e1SStephen Rothwell  */
201b8b572e1SStephen Rothwell #ifdef CONFIG_VSX
202b8b572e1SStephen Rothwell #define CPU_FTR_VSX_COMP	CPU_FTR_VSX
203b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_VSX_COMP PPC_FEATURE_HAS_VSX
204b8b572e1SStephen Rothwell #else
205b8b572e1SStephen Rothwell #define CPU_FTR_VSX_COMP	0
206b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_VSX_COMP    0
207b8b572e1SStephen Rothwell #endif
208b8b572e1SStephen Rothwell 
209b8b572e1SStephen Rothwell /* We only set the spe features if the kernel was compiled with spe
210b8b572e1SStephen Rothwell  * support
211b8b572e1SStephen Rothwell  */
212b8b572e1SStephen Rothwell #ifdef CONFIG_SPE
213b8b572e1SStephen Rothwell #define CPU_FTR_SPE_COMP	CPU_FTR_SPE
214b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_SPE_COMP PPC_FEATURE_HAS_SPE
215b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_SINGLE_COMP PPC_FEATURE_HAS_EFP_SINGLE
216b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_DOUBLE_COMP PPC_FEATURE_HAS_EFP_DOUBLE
217b8b572e1SStephen Rothwell #else
218b8b572e1SStephen Rothwell #define CPU_FTR_SPE_COMP	0
219b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_SPE_COMP    0
220b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_SINGLE_COMP 0
221b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_DOUBLE_COMP 0
222b8b572e1SStephen Rothwell #endif
223b8b572e1SStephen Rothwell 
2246a6d541fSMichael Neuling /* We only set the TM feature if the kernel was compiled with TM supprt */
2256a6d541fSMichael Neuling #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
2266a6d541fSMichael Neuling #define CPU_FTR_TM_COMP		CPU_FTR_TM
227*cbbc6f1bSNishanth Aravamudan #define PPC_FEATURE2_HTM_COMP	PPC_FEATURE2_HTM
2286a6d541fSMichael Neuling #else
2296a6d541fSMichael Neuling #define CPU_FTR_TM_COMP		0
230*cbbc6f1bSNishanth Aravamudan #define PPC_FEATURE2_HTM_COMP	0
2316a6d541fSMichael Neuling #endif
2326a6d541fSMichael Neuling 
233b8b572e1SStephen Rothwell /* We need to mark all pages as being coherent if we're SMP or we have a
234b8b572e1SStephen Rothwell  * 74[45]x and an MPC107 host bridge. Also 83xx and PowerQUICC II
235b8b572e1SStephen Rothwell  * require it for PCI "streaming/prefetch" to work properly.
236c9310920SPiotr Ziecik  * This is also required by 52xx family.
237b8b572e1SStephen Rothwell  */
238b8b572e1SStephen Rothwell #if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) \
239c9310920SPiotr Ziecik 	|| defined(CONFIG_PPC_83xx) || defined(CONFIG_8260) \
240c9310920SPiotr Ziecik 	|| defined(CONFIG_PPC_MPC52xx)
241b8b572e1SStephen Rothwell #define CPU_FTR_COMMON                  CPU_FTR_NEED_COHERENT
242b8b572e1SStephen Rothwell #else
243b8b572e1SStephen Rothwell #define CPU_FTR_COMMON                  0
244b8b572e1SStephen Rothwell #endif
245b8b572e1SStephen Rothwell 
246b8b572e1SStephen Rothwell /* The powersave features NAP & DOZE seems to confuse BDI when
247b8b572e1SStephen Rothwell    debugging. So if a BDI is used, disable theses
248b8b572e1SStephen Rothwell  */
249b8b572e1SStephen Rothwell #ifndef CONFIG_BDI_SWITCH
250b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_DOZE	CPU_FTR_CAN_DOZE
251b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_NAP	CPU_FTR_CAN_NAP
252b8b572e1SStephen Rothwell #else
253b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_DOZE	0
254b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_NAP	0
255b8b572e1SStephen Rothwell #endif
256b8b572e1SStephen Rothwell 
257b8b572e1SStephen Rothwell #define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \
258b8b572e1SStephen Rothwell 		     !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \
259b8b572e1SStephen Rothwell 		     !defined(CONFIG_BOOKE))
260b8b572e1SStephen Rothwell 
2617c03d653SBenjamin Herrenschmidt #define CPU_FTRS_PPC601	(CPU_FTR_COMMON | CPU_FTR_601 | \
262b8b572e1SStephen Rothwell 	CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE)
263b8b572e1SStephen Rothwell #define CPU_FTRS_603	(CPU_FTR_COMMON | \
264b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
265b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
266b8b572e1SStephen Rothwell #define CPU_FTRS_604	(CPU_FTR_COMMON | \
2677c03d653SBenjamin Herrenschmidt 	    CPU_FTR_USE_TB | CPU_FTR_PPC_LE)
268b8b572e1SStephen Rothwell #define CPU_FTRS_740_NOTAU	(CPU_FTR_COMMON | \
269b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
2707c03d653SBenjamin Herrenschmidt 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
271b8b572e1SStephen Rothwell #define CPU_FTRS_740	(CPU_FTR_COMMON | \
272b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
2737c03d653SBenjamin Herrenschmidt 	    CPU_FTR_TAU | CPU_FTR_MAYBE_CAN_NAP | \
274b8b572e1SStephen Rothwell 	    CPU_FTR_PPC_LE)
275b8b572e1SStephen Rothwell #define CPU_FTRS_750	(CPU_FTR_COMMON | \
276b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
2777c03d653SBenjamin Herrenschmidt 	    CPU_FTR_TAU | CPU_FTR_MAYBE_CAN_NAP | \
278b8b572e1SStephen Rothwell 	    CPU_FTR_PPC_LE)
2797c03d653SBenjamin Herrenschmidt #define CPU_FTRS_750CL	(CPU_FTRS_750)
280b8b572e1SStephen Rothwell #define CPU_FTRS_750FX1	(CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM)
281b8b572e1SStephen Rothwell #define CPU_FTRS_750FX2	(CPU_FTRS_750 | CPU_FTR_NO_DPM)
2827c03d653SBenjamin Herrenschmidt #define CPU_FTRS_750FX	(CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX)
283b8b572e1SStephen Rothwell #define CPU_FTRS_750GX	(CPU_FTRS_750FX)
284b8b572e1SStephen Rothwell #define CPU_FTRS_7400_NOTAU	(CPU_FTR_COMMON | \
285b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
2867c03d653SBenjamin Herrenschmidt 	    CPU_FTR_ALTIVEC_COMP | \
287b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
288b8b572e1SStephen Rothwell #define CPU_FTRS_7400	(CPU_FTR_COMMON | \
289b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
2907c03d653SBenjamin Herrenschmidt 	    CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | \
291b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
292b8b572e1SStephen Rothwell #define CPU_FTRS_7450_20	(CPU_FTR_COMMON | \
293b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
2947c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
295b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
296b8b572e1SStephen Rothwell #define CPU_FTRS_7450_21	(CPU_FTR_COMMON | \
297b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | \
298b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
2997c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
300b8b572e1SStephen Rothwell 	    CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
301b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
302b8b572e1SStephen Rothwell #define CPU_FTRS_7450_23	(CPU_FTR_COMMON | \
303b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
304b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3057c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
306b8b572e1SStephen Rothwell 	    CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
307b8b572e1SStephen Rothwell #define CPU_FTRS_7455_1	(CPU_FTR_COMMON | \
308b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
309b8b572e1SStephen Rothwell 	    CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \
3107c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPEC7450 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
311b8b572e1SStephen Rothwell #define CPU_FTRS_7455_20	(CPU_FTR_COMMON | \
312b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | CPU_FTR_NEED_PAIRED_STWCX | \
313b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3147c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
315b8b572e1SStephen Rothwell 	    CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
3167c03d653SBenjamin Herrenschmidt 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
317b8b572e1SStephen Rothwell #define CPU_FTRS_7455	(CPU_FTR_COMMON | \
318b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | \
319b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3207c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
321b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
322b8b572e1SStephen Rothwell #define CPU_FTRS_7447_10	(CPU_FTR_COMMON | \
323b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | \
324b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3257c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
326b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE | \
327b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_PAIRED_STWCX)
328b8b572e1SStephen Rothwell #define CPU_FTRS_7447	(CPU_FTR_COMMON | \
329b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | \
330b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3317c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
332b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
333b8b572e1SStephen Rothwell #define CPU_FTRS_7447A	(CPU_FTR_COMMON | \
334b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | \
335b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3367c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
337b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
338b8b572e1SStephen Rothwell #define CPU_FTRS_7448	(CPU_FTR_COMMON | \
339b8b572e1SStephen Rothwell 	    CPU_FTR_USE_TB | \
340b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3417c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
342b8b572e1SStephen Rothwell 	    CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
343b8b572e1SStephen Rothwell #define CPU_FTRS_82XX	(CPU_FTR_COMMON | \
344b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
345b8b572e1SStephen Rothwell #define CPU_FTRS_G2_LE	(CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
3467c03d653SBenjamin Herrenschmidt 	    CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP)
347b8b572e1SStephen Rothwell #define CPU_FTRS_E300	(CPU_FTR_MAYBE_CAN_DOZE | \
3487c03d653SBenjamin Herrenschmidt 	    CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | \
349b8b572e1SStephen Rothwell 	    CPU_FTR_COMMON)
350b8b572e1SStephen Rothwell #define CPU_FTRS_E300C2	(CPU_FTR_MAYBE_CAN_DOZE | \
3517c03d653SBenjamin Herrenschmidt 	    CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | \
352b8b572e1SStephen Rothwell 	    CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE)
3537c03d653SBenjamin Herrenschmidt #define CPU_FTRS_CLASSIC32	(CPU_FTR_COMMON | CPU_FTR_USE_TB)
354b8b572e1SStephen Rothwell #define CPU_FTRS_8XX	(CPU_FTR_USE_TB)
3558309ce72SBenjamin Herrenschmidt #define CPU_FTRS_40X	(CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
3568309ce72SBenjamin Herrenschmidt #define CPU_FTRS_44X	(CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
3576d2170beSBenjamin Herrenschmidt #define CPU_FTRS_440x6	(CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE | \
3586d2170beSBenjamin Herrenschmidt 	    CPU_FTR_INDEXED_DCR)
359e7f75ad0SDave Kleikamp #define CPU_FTRS_47X	(CPU_FTRS_440x6)
360b8b572e1SStephen Rothwell #define CPU_FTRS_E200	(CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
361b8b572e1SStephen Rothwell 	    CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \
36252b066faSScott Wood 	    CPU_FTR_UNIFIED_ID_CACHE | CPU_FTR_NOEXECUTE | \
36352b066faSScott Wood 	    CPU_FTR_DEBUG_LVL_EXC)
364b8b572e1SStephen Rothwell #define CPU_FTRS_E500	(CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
3658309ce72SBenjamin Herrenschmidt 	    CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \
3668309ce72SBenjamin Herrenschmidt 	    CPU_FTR_NOEXECUTE)
367b8b572e1SStephen Rothwell #define CPU_FTRS_E500_2	(CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
3687c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | \
3698309ce72SBenjamin Herrenschmidt 	    CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
370d51ad915SScott Wood #define CPU_FTRS_E500MC	(CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
371620165f9SKumar Gala 	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
37273196cd3SScott Wood 	    CPU_FTR_DBELL | CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV)
37311ed0db9SKumar Gala #define CPU_FTRS_E5500	(CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
37411ed0db9SKumar Gala 	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
375d36b4c4fSKumar Gala 	    CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
37673196cd3SScott Wood 	    CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV)
37710241842SKumar Gala #define CPU_FTRS_E6500	(CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
37810241842SKumar Gala 	    CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
37910241842SKumar Gala 	    CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
380cd66cc2eSKumar Gala 	    CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP)
381b8b572e1SStephen Rothwell #define CPU_FTRS_GENERIC_32	(CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
382b8b572e1SStephen Rothwell 
383b8b572e1SStephen Rothwell /* 64-bit CPUs */
3845a0e9b57SAnton Blanchard #define CPU_FTRS_POWER3	(CPU_FTR_USE_TB | \
3857c03d653SBenjamin Herrenschmidt 	    CPU_FTR_IABR | CPU_FTR_PPC_LE)
3865a0e9b57SAnton Blanchard #define CPU_FTRS_RS64	(CPU_FTR_USE_TB | \
3877c03d653SBenjamin Herrenschmidt 	    CPU_FTR_IABR | \
388b8b572e1SStephen Rothwell 	    CPU_FTR_MMCRA | CPU_FTR_CTRL)
389b8b572e1SStephen Rothwell #define CPU_FTRS_POWER4	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
3907c03d653SBenjamin Herrenschmidt 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
391f89451fbSAnton Blanchard 	    CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \
392f89451fbSAnton Blanchard 	    CPU_FTR_STCX_CHECKS_ADDRESS)
393b8b572e1SStephen Rothwell #define CPU_FTRS_PPC970	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
394969391c5SPaul Mackerras 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_201 | \
3952a929436SMark Nelson 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \
396969391c5SPaul Mackerras 	    CPU_FTR_CP_USE_DCBTZ | CPU_FTR_STCX_CHECKS_ADDRESS | \
397969391c5SPaul Mackerras 	    CPU_FTR_HVMODE)
398b8b572e1SStephen Rothwell #define CPU_FTRS_POWER5	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
3997c03d653SBenjamin Herrenschmidt 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
400b8b572e1SStephen Rothwell 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
40144ae3ab3SMatt Evans 	    CPU_FTR_COHERENT_ICACHE | CPU_FTR_PURR | \
40244ae3ab3SMatt Evans 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB)
403b8b572e1SStephen Rothwell #define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
4047c03d653SBenjamin Herrenschmidt 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
405b8b572e1SStephen Rothwell 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
40644ae3ab3SMatt Evans 	    CPU_FTR_COHERENT_ICACHE | \
407b8b572e1SStephen Rothwell 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
408f89451fbSAnton Blanchard 	    CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \
40948404f2eSPaul Mackerras 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_CFAR)
410b8b572e1SStephen Rothwell #define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
411969391c5SPaul Mackerras 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
412b8b572e1SStephen Rothwell 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
41344ae3ab3SMatt Evans 	    CPU_FTR_COHERENT_ICACHE | \
414b8b572e1SStephen Rothwell 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
415f89451fbSAnton Blanchard 	    CPU_FTR_DSCR | CPU_FTR_SAO  | CPU_FTR_ASYM_SMT | \
416851d2e2fSTseng-Hui (Frank) Lin 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
417d2613868SHaren Myneni 	    CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | \
418d2613868SHaren Myneni 	    CPU_FTR_VMX_COPY | CPU_FTR_HAS_PPR)
41971e18497SMichael Neuling #define CPU_FTRS_POWER8 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
42071e18497SMichael Neuling 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
42171e18497SMichael Neuling 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
42271e18497SMichael Neuling 	    CPU_FTR_COHERENT_ICACHE | \
42371e18497SMichael Neuling 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
42471e18497SMichael Neuling 	    CPU_FTR_DSCR | CPU_FTR_SAO  | \
42571e18497SMichael Neuling 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
426e5e84f0aSIan Munsie 	    CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
4271de2bd4eSMichael Ellerman 	    CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
4281de2bd4eSMichael Ellerman 	    CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP)
429b8b572e1SStephen Rothwell #define CPU_FTRS_CELL	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
4307c03d653SBenjamin Herrenschmidt 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
431b8b572e1SStephen Rothwell 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
43244ae3ab3SMatt Evans 	    CPU_FTR_PAUSE_ZERO  | CPU_FTR_CELL_TB_BUG | CPU_FTR_CP_USE_DCBTZ | \
4334ec577a2SMark Nelson 	    CPU_FTR_UNALIGNED_LD_STD)
434b8b572e1SStephen Rothwell #define CPU_FTRS_PA6T (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
43544ae3ab3SMatt Evans 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP | \
43644ae3ab3SMatt Evans 	    CPU_FTR_PURR | CPU_FTR_REAL_LE)
4377c03d653SBenjamin Herrenschmidt #define CPU_FTRS_COMPATIBLE	(CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2)
438b8b572e1SStephen Rothwell 
43976b4eda8SBenjamin Herrenschmidt #define CPU_FTRS_A2 (CPU_FTR_USE_TB | CPU_FTR_SMT | CPU_FTR_DBELL | \
440fac26ad4SJimi Xenidis 		     CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN | CPU_FTR_ICSWX)
44176b4eda8SBenjamin Herrenschmidt 
442b8b572e1SStephen Rothwell #ifdef __powerpc64__
44311ed0db9SKumar Gala #ifdef CONFIG_PPC_BOOK3E
44410241842SKumar Gala #define CPU_FTRS_POSSIBLE	(CPU_FTRS_E6500 | CPU_FTRS_E5500 | CPU_FTRS_A2)
44511ed0db9SKumar Gala #else
446b8b572e1SStephen Rothwell #define CPU_FTRS_POSSIBLE	\
447b8b572e1SStephen Rothwell 	    (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 |	\
448b8b572e1SStephen Rothwell 	    CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 |	\
44971e18497SMichael Neuling 	    CPU_FTRS_POWER7 | CPU_FTRS_POWER8 | CPU_FTRS_CELL |		\
45071e18497SMichael Neuling 	    CPU_FTRS_PA6T | CPU_FTR_VSX)
45111ed0db9SKumar Gala #endif
452b8b572e1SStephen Rothwell #else
453b8b572e1SStephen Rothwell enum {
454b8b572e1SStephen Rothwell 	CPU_FTRS_POSSIBLE =
455b8b572e1SStephen Rothwell #if CLASSIC_PPC
456b8b572e1SStephen Rothwell 	    CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU |
457b8b572e1SStephen Rothwell 	    CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 |
458b8b572e1SStephen Rothwell 	    CPU_FTRS_750FX2 | CPU_FTRS_750FX | CPU_FTRS_750GX |
459b8b572e1SStephen Rothwell 	    CPU_FTRS_7400_NOTAU | CPU_FTRS_7400 | CPU_FTRS_7450_20 |
460b8b572e1SStephen Rothwell 	    CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 |
461b8b572e1SStephen Rothwell 	    CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 |
462b8b572e1SStephen Rothwell 	    CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX |
463b8b572e1SStephen Rothwell 	    CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 |
464b8b572e1SStephen Rothwell 	    CPU_FTRS_CLASSIC32 |
465b8b572e1SStephen Rothwell #else
466b8b572e1SStephen Rothwell 	    CPU_FTRS_GENERIC_32 |
467b8b572e1SStephen Rothwell #endif
468b8b572e1SStephen Rothwell #ifdef CONFIG_8xx
469b8b572e1SStephen Rothwell 	    CPU_FTRS_8XX |
470b8b572e1SStephen Rothwell #endif
471b8b572e1SStephen Rothwell #ifdef CONFIG_40x
472b8b572e1SStephen Rothwell 	    CPU_FTRS_40X |
473b8b572e1SStephen Rothwell #endif
474b8b572e1SStephen Rothwell #ifdef CONFIG_44x
4756d2170beSBenjamin Herrenschmidt 	    CPU_FTRS_44X | CPU_FTRS_440x6 |
476b8b572e1SStephen Rothwell #endif
477e7f75ad0SDave Kleikamp #ifdef CONFIG_PPC_47x
478c48d0dbaSDave Kleikamp 	    CPU_FTRS_47X | CPU_FTR_476_DD2 |
479e7f75ad0SDave Kleikamp #endif
480b8b572e1SStephen Rothwell #ifdef CONFIG_E200
481b8b572e1SStephen Rothwell 	    CPU_FTRS_E200 |
482b8b572e1SStephen Rothwell #endif
483b8b572e1SStephen Rothwell #ifdef CONFIG_E500
48406aae867SScott Wood 	    CPU_FTRS_E500 | CPU_FTRS_E500_2 |
48506aae867SScott Wood #endif
48606aae867SScott Wood #ifdef CONFIG_PPC_E500MC
48706aae867SScott Wood 	    CPU_FTRS_E500MC | CPU_FTRS_E5500 | CPU_FTRS_E6500 |
488b8b572e1SStephen Rothwell #endif
489b8b572e1SStephen Rothwell 	    0,
490b8b572e1SStephen Rothwell };
491b8b572e1SStephen Rothwell #endif /* __powerpc64__ */
492b8b572e1SStephen Rothwell 
493b8b572e1SStephen Rothwell #ifdef __powerpc64__
49411ed0db9SKumar Gala #ifdef CONFIG_PPC_BOOK3E
49510241842SKumar Gala #define CPU_FTRS_ALWAYS		(CPU_FTRS_E6500 & CPU_FTRS_E5500 & CPU_FTRS_A2)
49611ed0db9SKumar Gala #else
497b8b572e1SStephen Rothwell #define CPU_FTRS_ALWAYS		\
498b8b572e1SStephen Rothwell 	    (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 &	\
499b8b572e1SStephen Rothwell 	    CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 &	\
500b8b572e1SStephen Rothwell 	    CPU_FTRS_POWER7 & CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE)
50111ed0db9SKumar Gala #endif
502b8b572e1SStephen Rothwell #else
503b8b572e1SStephen Rothwell enum {
504b8b572e1SStephen Rothwell 	CPU_FTRS_ALWAYS =
505b8b572e1SStephen Rothwell #if CLASSIC_PPC
506b8b572e1SStephen Rothwell 	    CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU &
507b8b572e1SStephen Rothwell 	    CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 &
508b8b572e1SStephen Rothwell 	    CPU_FTRS_750FX2 & CPU_FTRS_750FX & CPU_FTRS_750GX &
509b8b572e1SStephen Rothwell 	    CPU_FTRS_7400_NOTAU & CPU_FTRS_7400 & CPU_FTRS_7450_20 &
510b8b572e1SStephen Rothwell 	    CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 &
511b8b572e1SStephen Rothwell 	    CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 &
512b8b572e1SStephen Rothwell 	    CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX &
513b8b572e1SStephen Rothwell 	    CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 &
514b8b572e1SStephen Rothwell 	    CPU_FTRS_CLASSIC32 &
515b8b572e1SStephen Rothwell #else
516b8b572e1SStephen Rothwell 	    CPU_FTRS_GENERIC_32 &
517b8b572e1SStephen Rothwell #endif
518b8b572e1SStephen Rothwell #ifdef CONFIG_8xx
519b8b572e1SStephen Rothwell 	    CPU_FTRS_8XX &
520b8b572e1SStephen Rothwell #endif
521b8b572e1SStephen Rothwell #ifdef CONFIG_40x
522b8b572e1SStephen Rothwell 	    CPU_FTRS_40X &
523b8b572e1SStephen Rothwell #endif
524b8b572e1SStephen Rothwell #ifdef CONFIG_44x
5256d2170beSBenjamin Herrenschmidt 	    CPU_FTRS_44X & CPU_FTRS_440x6 &
526b8b572e1SStephen Rothwell #endif
527b8b572e1SStephen Rothwell #ifdef CONFIG_E200
528b8b572e1SStephen Rothwell 	    CPU_FTRS_E200 &
529b8b572e1SStephen Rothwell #endif
530b8b572e1SStephen Rothwell #ifdef CONFIG_E500
53106aae867SScott Wood 	    CPU_FTRS_E500 & CPU_FTRS_E500_2 &
53206aae867SScott Wood #endif
53306aae867SScott Wood #ifdef CONFIG_PPC_E500MC
53406aae867SScott Wood 	    CPU_FTRS_E500MC & CPU_FTRS_E5500 & CPU_FTRS_E6500 &
535b8b572e1SStephen Rothwell #endif
53673196cd3SScott Wood 	    ~CPU_FTR_EMB_HV &	/* can be removed at runtime */
537b8b572e1SStephen Rothwell 	    CPU_FTRS_POSSIBLE,
538b8b572e1SStephen Rothwell };
539b8b572e1SStephen Rothwell #endif /* __powerpc64__ */
540b8b572e1SStephen Rothwell 
541b8b572e1SStephen Rothwell static inline int cpu_has_feature(unsigned long feature)
542b8b572e1SStephen Rothwell {
543b8b572e1SStephen Rothwell 	return (CPU_FTRS_ALWAYS & feature) ||
544b8b572e1SStephen Rothwell 	       (CPU_FTRS_POSSIBLE
545b8b572e1SStephen Rothwell 		& cur_cpu_spec->cpu_features
546b8b572e1SStephen Rothwell 		& feature);
547b8b572e1SStephen Rothwell }
548b8b572e1SStephen Rothwell 
5495aae8a53SK.Prasad #define HBP_NUM 1
5505aae8a53SK.Prasad 
551b8b572e1SStephen Rothwell #endif /* !__ASSEMBLY__ */
552b8b572e1SStephen Rothwell 
553b8b572e1SStephen Rothwell #endif /* __ASM_POWERPC_CPUTABLE_H */
554