xref: /linux/arch/powerpc/include/asm/cputable.h (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2b8b572e1SStephen Rothwell #ifndef __ASM_POWERPC_CPUTABLE_H
3b8b572e1SStephen Rothwell #define __ASM_POWERPC_CPUTABLE_H
4b8b572e1SStephen Rothwell 
5b8b572e1SStephen Rothwell 
66574ba95SMichael Ellerman #include <linux/types.h>
7c3617f72SDavid Howells #include <uapi/asm/cputable.h>
8ec0c464cSChristophe Leroy #include <asm/asm-const.h>
9b8b572e1SStephen Rothwell 
10b8b572e1SStephen Rothwell #ifndef __ASSEMBLY__
11b8b572e1SStephen Rothwell 
12b8b572e1SStephen Rothwell /* This structure can grow, it's real size is used by head.S code
13b8b572e1SStephen Rothwell  * via the mkdefs mechanism.
14b8b572e1SStephen Rothwell  */
15b8b572e1SStephen Rothwell struct cpu_spec;
16b8b572e1SStephen Rothwell 
17b8b572e1SStephen Rothwell typedef	void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
18b8b572e1SStephen Rothwell typedef	void (*cpu_restore_t)(void);
19b8b572e1SStephen Rothwell 
20b8b572e1SStephen Rothwell enum powerpc_pmc_type {
21b8b572e1SStephen Rothwell 	PPC_PMC_DEFAULT = 0,
22b8b572e1SStephen Rothwell 	PPC_PMC_IBM = 1,
23b8b572e1SStephen Rothwell 	PPC_PMC_PA6T = 2,
24b950bdd0SBenjamin Herrenschmidt 	PPC_PMC_G4 = 3,
25b8b572e1SStephen Rothwell };
26b8b572e1SStephen Rothwell 
27b8b572e1SStephen Rothwell struct pt_regs;
28b8b572e1SStephen Rothwell 
29b8b572e1SStephen Rothwell extern int machine_check_generic(struct pt_regs *regs);
30b8b572e1SStephen Rothwell extern int machine_check_4xx(struct pt_regs *regs);
31b8b572e1SStephen Rothwell extern int machine_check_440A(struct pt_regs *regs);
32fe04b112SScott Wood extern int machine_check_e500mc(struct pt_regs *regs);
33b8b572e1SStephen Rothwell extern int machine_check_e500(struct pt_regs *regs);
34fc5e7097SDave Kleikamp extern int machine_check_47x(struct pt_regs *regs);
35e627f8dcSChristophe Leroy int machine_check_8xx(struct pt_regs *regs);
360deae39cSChristophe Leroy int machine_check_83xx(struct pt_regs *regs);
37b8b572e1SStephen Rothwell 
38e7affb1dSchenhui zhao extern void cpu_down_flush_e500v2(void);
39e7affb1dSchenhui zhao extern void cpu_down_flush_e500mc(void);
40e7affb1dSchenhui zhao extern void cpu_down_flush_e5500(void);
41e7affb1dSchenhui zhao extern void cpu_down_flush_e6500(void);
42e7affb1dSchenhui zhao 
43b8b572e1SStephen Rothwell /* NOTE WELL: Update identify_cpu() if fields are added or removed! */
44b8b572e1SStephen Rothwell struct cpu_spec {
45b8b572e1SStephen Rothwell 	/* CPU is matched via (PVR & pvr_mask) == pvr_value */
46b8b572e1SStephen Rothwell 	unsigned int	pvr_mask;
47b8b572e1SStephen Rothwell 	unsigned int	pvr_value;
48b8b572e1SStephen Rothwell 
49b8b572e1SStephen Rothwell 	char		*cpu_name;
50b8b572e1SStephen Rothwell 	unsigned long	cpu_features;		/* Kernel features */
51b8b572e1SStephen Rothwell 	unsigned int	cpu_user_features;	/* Userland features */
522171364dSMichael Neuling 	unsigned int	cpu_user_features2;	/* Userland features v2 */
537c03d653SBenjamin Herrenschmidt 	unsigned int	mmu_features;		/* MMU features */
54b8b572e1SStephen Rothwell 
55b8b572e1SStephen Rothwell 	/* cache line sizes */
56b8b572e1SStephen Rothwell 	unsigned int	icache_bsize;
57b8b572e1SStephen Rothwell 	unsigned int	dcache_bsize;
58b8b572e1SStephen Rothwell 
59e7affb1dSchenhui zhao 	/* flush caches inside the current cpu */
60e7affb1dSchenhui zhao 	void (*cpu_down_flush)(void);
61e7affb1dSchenhui zhao 
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 	/* Name of processor class, for the ELF AT_PLATFORM entry */
74b8b572e1SStephen Rothwell 	char		*platform;
75b8b572e1SStephen Rothwell 
76b8b572e1SStephen Rothwell 	/* Processor specific machine check handling. Return negative
77b8b572e1SStephen Rothwell 	 * if the error is fatal, 1 if it was fully recovered and 0 to
78b8b572e1SStephen Rothwell 	 * pass up (not CPU originated) */
79b8b572e1SStephen Rothwell 	int		(*machine_check)(struct pt_regs *regs);
804c703416SMahesh Salgaonkar 
814c703416SMahesh Salgaonkar 	/*
824c703416SMahesh Salgaonkar 	 * Processor specific early machine check handler which is
834c703416SMahesh Salgaonkar 	 * called in real mode to handle SLB and TLB errors.
844c703416SMahesh Salgaonkar 	 */
854c703416SMahesh Salgaonkar 	long		(*machine_check_early)(struct pt_regs *regs);
86b8b572e1SStephen Rothwell };
87b8b572e1SStephen Rothwell 
88b8b572e1SStephen Rothwell extern struct cpu_spec		*cur_cpu_spec;
89b8b572e1SStephen Rothwell 
90b8b572e1SStephen Rothwell extern unsigned int __start___ftr_fixup, __stop___ftr_fixup;
91b8b572e1SStephen Rothwell 
925a61ef74SNicholas Piggin extern void set_cur_cpu_spec(struct cpu_spec *s);
93b8b572e1SStephen Rothwell extern struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr);
945a61ef74SNicholas Piggin extern void identify_cpu_name(unsigned int pvr);
95b8b572e1SStephen Rothwell extern void do_feature_fixups(unsigned long value, void *fixup_start,
96b8b572e1SStephen Rothwell 			      void *fixup_end);
97b8b572e1SStephen Rothwell 
98b8b572e1SStephen Rothwell extern const char *powerpc_base_platform;
99b8b572e1SStephen Rothwell 
1004db73271SKevin Hao #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS
1014db73271SKevin Hao extern void cpu_feature_keys_init(void);
1024db73271SKevin Hao #else
cpu_feature_keys_init(void)1034db73271SKevin Hao static inline void cpu_feature_keys_init(void) { }
1044db73271SKevin Hao #endif
1054db73271SKevin Hao 
106b8b572e1SStephen Rothwell #endif /* __ASSEMBLY__ */
107b8b572e1SStephen Rothwell 
108b8b572e1SStephen Rothwell /* CPU kernel features */
109b8b572e1SStephen Rothwell 
1109bbf0b57SPaul Mackerras /* Definitions for features that we have on both 32-bit and 64-bit chips */
111cde4d494SMichael Neuling #define CPU_FTR_COHERENT_ICACHE		ASM_CONST(0x00000001)
1129bbf0b57SPaul Mackerras #define CPU_FTR_ALTIVEC			ASM_CONST(0x00000002)
1139bbf0b57SPaul Mackerras #define CPU_FTR_DBELL			ASM_CONST(0x00000004)
1149bbf0b57SPaul Mackerras #define CPU_FTR_CAN_NAP			ASM_CONST(0x00000008)
1159bbf0b57SPaul Mackerras #define CPU_FTR_DEBUG_LVL_EXC		ASM_CONST(0x00000010)
1167d470345SChristophe Leroy // ASM_CONST(0x00000020) Free
1179bbf0b57SPaul Mackerras #define CPU_FTR_FPU_UNAVAILABLE		ASM_CONST(0x00000040)
1189bbf0b57SPaul Mackerras #define CPU_FTR_LWSYNC			ASM_CONST(0x00000080)
1199bbf0b57SPaul Mackerras #define CPU_FTR_NOEXECUTE		ASM_CONST(0x00000100)
1209bbf0b57SPaul Mackerras #define CPU_FTR_EMB_HV			ASM_CONST(0x00000200)
1219bbf0b57SPaul Mackerras 
1229bbf0b57SPaul Mackerras /* Definitions for features that only exist on 32-bit chips */
1239bbf0b57SPaul Mackerras #ifdef CONFIG_PPC32
1249bbf0b57SPaul Mackerras #define CPU_FTR_L2CR			ASM_CONST(0x00002000)
1259bbf0b57SPaul Mackerras #define CPU_FTR_SPEC7450		ASM_CONST(0x00004000)
1269bbf0b57SPaul Mackerras #define CPU_FTR_TAU			ASM_CONST(0x00008000)
1279bbf0b57SPaul Mackerras #define CPU_FTR_CAN_DOZE		ASM_CONST(0x00010000)
1289bbf0b57SPaul Mackerras #define CPU_FTR_L3CR			ASM_CONST(0x00040000)
1299bbf0b57SPaul Mackerras #define CPU_FTR_L3_DISABLE_NAP		ASM_CONST(0x00080000)
1309bbf0b57SPaul Mackerras #define CPU_FTR_NAP_DISABLE_L2_PR	ASM_CONST(0x00100000)
1319bbf0b57SPaul Mackerras #define CPU_FTR_DUAL_PLL_750FX		ASM_CONST(0x00200000)
1329bbf0b57SPaul Mackerras #define CPU_FTR_NO_DPM			ASM_CONST(0x00400000)
1339bbf0b57SPaul Mackerras #define CPU_FTR_476_DD2			ASM_CONST(0x00800000)
1349bbf0b57SPaul Mackerras #define CPU_FTR_NEED_COHERENT		ASM_CONST(0x01000000)
1359bbf0b57SPaul Mackerras #define CPU_FTR_NO_BTIC			ASM_CONST(0x02000000)
1369bbf0b57SPaul Mackerras #define CPU_FTR_PPC_LE			ASM_CONST(0x04000000)
1379bbf0b57SPaul Mackerras #define CPU_FTR_SPE			ASM_CONST(0x10000000)
1389bbf0b57SPaul Mackerras #define CPU_FTR_NEED_PAIRED_STWCX	ASM_CONST(0x20000000)
1399bbf0b57SPaul Mackerras #define CPU_FTR_INDEXED_DCR		ASM_CONST(0x40000000)
1409bbf0b57SPaul Mackerras 
1419bbf0b57SPaul Mackerras #else	/* CONFIG_PPC32 */
1429bbf0b57SPaul Mackerras /* Define these to 0 for the sake of tests in common code */
1439bbf0b57SPaul Mackerras #define CPU_FTR_PPC_LE			(0)
144532ed190SChristophe Leroy #define CPU_FTR_SPE			(0)
1459bbf0b57SPaul Mackerras #endif
146b8b572e1SStephen Rothwell 
147b8b572e1SStephen Rothwell /*
1489bbf0b57SPaul Mackerras  * Definitions for the 64-bit processor unique features;
149b8b572e1SStephen Rothwell  * on 32-bit, make the names available but defined to be 0.
150b8b572e1SStephen Rothwell  */
151b8b572e1SStephen Rothwell #ifdef __powerpc64__
152b8b572e1SStephen Rothwell #define LONG_ASM_CONST(x)		ASM_CONST(x)
153b8b572e1SStephen Rothwell #else
154b8b572e1SStephen Rothwell #define LONG_ASM_CONST(x)		0
155b8b572e1SStephen Rothwell #endif
156b8b572e1SStephen Rothwell 
1579bbf0b57SPaul Mackerras #define CPU_FTR_REAL_LE			LONG_ASM_CONST(0x0000000000001000)
1589bbf0b57SPaul Mackerras #define CPU_FTR_HVMODE			LONG_ASM_CONST(0x0000000000002000)
1599bbf0b57SPaul Mackerras #define CPU_FTR_ARCH_206		LONG_ASM_CONST(0x0000000000008000)
1609bbf0b57SPaul Mackerras #define CPU_FTR_ARCH_207S		LONG_ASM_CONST(0x0000000000010000)
1619bbf0b57SPaul Mackerras #define CPU_FTR_ARCH_300		LONG_ASM_CONST(0x0000000000020000)
1629bbf0b57SPaul Mackerras #define CPU_FTR_MMCRA			LONG_ASM_CONST(0x0000000000040000)
1639bbf0b57SPaul Mackerras #define CPU_FTR_CTRL			LONG_ASM_CONST(0x0000000000080000)
1649bbf0b57SPaul Mackerras #define CPU_FTR_SMT			LONG_ASM_CONST(0x0000000000100000)
1659bbf0b57SPaul Mackerras #define CPU_FTR_PAUSE_ZERO		LONG_ASM_CONST(0x0000000000200000)
1669bbf0b57SPaul Mackerras #define CPU_FTR_PURR			LONG_ASM_CONST(0x0000000000400000)
1679bbf0b57SPaul Mackerras #define CPU_FTR_CELL_TB_BUG		LONG_ASM_CONST(0x0000000000800000)
1689bbf0b57SPaul Mackerras #define CPU_FTR_SPURR			LONG_ASM_CONST(0x0000000001000000)
1699bbf0b57SPaul Mackerras #define CPU_FTR_DSCR			LONG_ASM_CONST(0x0000000002000000)
1709bbf0b57SPaul Mackerras #define CPU_FTR_VSX			LONG_ASM_CONST(0x0000000004000000)
17112564485SShawn Anastasio #define CPU_FTR_SAO			LONG_ASM_CONST(0x0000000008000000)
1729bbf0b57SPaul Mackerras #define CPU_FTR_CP_USE_DCBTZ		LONG_ASM_CONST(0x0000000010000000)
1739bbf0b57SPaul Mackerras #define CPU_FTR_UNALIGNED_LD_STD	LONG_ASM_CONST(0x0000000020000000)
1749bbf0b57SPaul Mackerras #define CPU_FTR_ASYM_SMT		LONG_ASM_CONST(0x0000000040000000)
1759bbf0b57SPaul Mackerras #define CPU_FTR_STCX_CHECKS_ADDRESS	LONG_ASM_CONST(0x0000000080000000)
1769bbf0b57SPaul Mackerras #define CPU_FTR_POPCNTB			LONG_ASM_CONST(0x0000000100000000)
1779bbf0b57SPaul Mackerras #define CPU_FTR_POPCNTD			LONG_ASM_CONST(0x0000000200000000)
178a24204c3SAneesh Kumar K.V /* LONG_ASM_CONST(0x0000000400000000) Free */
1799bbf0b57SPaul Mackerras #define CPU_FTR_VMX_COPY		LONG_ASM_CONST(0x0000000800000000)
1809bbf0b57SPaul Mackerras #define CPU_FTR_TM			LONG_ASM_CONST(0x0000001000000000)
1819bbf0b57SPaul Mackerras #define CPU_FTR_CFAR			LONG_ASM_CONST(0x0000002000000000)
1829bbf0b57SPaul Mackerras #define	CPU_FTR_HAS_PPR			LONG_ASM_CONST(0x0000004000000000)
1839bbf0b57SPaul Mackerras #define CPU_FTR_DAWR			LONG_ASM_CONST(0x0000008000000000)
1849bbf0b57SPaul Mackerras #define CPU_FTR_DABRX			LONG_ASM_CONST(0x0000010000000000)
1859bbf0b57SPaul Mackerras #define CPU_FTR_PMAO_BUG		LONG_ASM_CONST(0x0000020000000000)
1869bbf0b57SPaul Mackerras #define CPU_FTR_POWER9_DD2_1		LONG_ASM_CONST(0x0000080000000000)
187b5af4f27SPaul Mackerras #define CPU_FTR_P9_TM_HV_ASSIST		LONG_ASM_CONST(0x0000100000000000)
188b5af4f27SPaul Mackerras #define CPU_FTR_P9_TM_XER_SO_BUG	LONG_ASM_CONST(0x0000200000000000)
18909ce98caSAneesh Kumar K.V #define CPU_FTR_P9_TLBIE_STQ_BUG	LONG_ASM_CONST(0x0000400000000000)
19081984428SAlastair D'Silva #define CPU_FTR_P9_TIDR			LONG_ASM_CONST(0x0000800000000000)
191047e6575SAneesh Kumar K.V #define CPU_FTR_P9_TLBIE_ERAT_BUG	LONG_ASM_CONST(0x0001000000000000)
192736bcdd3SJordan Niethe #define CPU_FTR_P9_RADIX_PREFETCH_BUG	LONG_ASM_CONST(0x0002000000000000)
1933fd5836eSAlistair Popple #define CPU_FTR_ARCH_31			LONG_ASM_CONST(0x0004000000000000)
194dc1cedcaSRavi Bangoria #define CPU_FTR_DAWR1			LONG_ASM_CONST(0x0008000000000000)
1950ffd60b7SBenjamin Gray #define CPU_FTR_DEXCR_NPHIE		LONG_ASM_CONST(0x0010000000000000)
196b8b572e1SStephen Rothwell 
197b8b572e1SStephen Rothwell #ifndef __ASSEMBLY__
198b8b572e1SStephen Rothwell 
1997d470345SChristophe Leroy #define CPU_FTR_PPCAS_ARCH_V2	(CPU_FTR_NOEXECUTE)
20044ae3ab3SMatt Evans 
201b8b572e1SStephen Rothwell /* We only set the altivec features if the kernel was compiled with altivec
202b8b572e1SStephen Rothwell  * support
203b8b572e1SStephen Rothwell  */
204b8b572e1SStephen Rothwell #ifdef CONFIG_ALTIVEC
205b8b572e1SStephen Rothwell #define CPU_FTR_ALTIVEC_COMP	CPU_FTR_ALTIVEC
206b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
207b8b572e1SStephen Rothwell #else
208b8b572e1SStephen Rothwell #define CPU_FTR_ALTIVEC_COMP	0
209b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_ALTIVEC_COMP    0
210b8b572e1SStephen Rothwell #endif
211b8b572e1SStephen Rothwell 
212b8b572e1SStephen Rothwell /* We only set the VSX features if the kernel was compiled with VSX
213b8b572e1SStephen Rothwell  * support
214b8b572e1SStephen Rothwell  */
215b8b572e1SStephen Rothwell #ifdef CONFIG_VSX
216b8b572e1SStephen Rothwell #define CPU_FTR_VSX_COMP	CPU_FTR_VSX
217b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_VSX_COMP PPC_FEATURE_HAS_VSX
218b8b572e1SStephen Rothwell #else
219b8b572e1SStephen Rothwell #define CPU_FTR_VSX_COMP	0
220b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_VSX_COMP    0
221b8b572e1SStephen Rothwell #endif
222b8b572e1SStephen Rothwell 
223b8b572e1SStephen Rothwell /* We only set the spe features if the kernel was compiled with spe
224b8b572e1SStephen Rothwell  * support
225b8b572e1SStephen Rothwell  */
226b8b572e1SStephen Rothwell #ifdef CONFIG_SPE
227b8b572e1SStephen Rothwell #define CPU_FTR_SPE_COMP	CPU_FTR_SPE
228b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_SPE_COMP PPC_FEATURE_HAS_SPE
229b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_SINGLE_COMP PPC_FEATURE_HAS_EFP_SINGLE
230b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_DOUBLE_COMP PPC_FEATURE_HAS_EFP_DOUBLE
231b8b572e1SStephen Rothwell #else
232b8b572e1SStephen Rothwell #define CPU_FTR_SPE_COMP	0
233b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_SPE_COMP    0
234b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_SINGLE_COMP 0
235b8b572e1SStephen Rothwell #define PPC_FEATURE_HAS_EFP_DOUBLE_COMP 0
236b8b572e1SStephen Rothwell #endif
237b8b572e1SStephen Rothwell 
2386a6d541fSMichael Neuling /* We only set the TM feature if the kernel was compiled with TM supprt */
2396a6d541fSMichael Neuling #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
2406a6d541fSMichael Neuling #define CPU_FTR_TM_COMP			CPU_FTR_TM
241cbbc6f1bSNishanth Aravamudan #define PPC_FEATURE2_HTM_COMP		PPC_FEATURE2_HTM
242b4b56f9eSSam bobroff #define PPC_FEATURE2_HTM_NOSC_COMP	PPC_FEATURE2_HTM_NOSC
2436a6d541fSMichael Neuling #else
2446a6d541fSMichael Neuling #define CPU_FTR_TM_COMP			0
245cbbc6f1bSNishanth Aravamudan #define PPC_FEATURE2_HTM_COMP		0
246b4b56f9eSSam bobroff #define PPC_FEATURE2_HTM_NOSC_COMP	0
2476a6d541fSMichael Neuling #endif
2486a6d541fSMichael Neuling 
249b8b572e1SStephen Rothwell /* We need to mark all pages as being coherent if we're SMP or we have a
250b8b572e1SStephen Rothwell  * 74[45]x and an MPC107 host bridge. Also 83xx and PowerQUICC II
251b8b572e1SStephen Rothwell  * require it for PCI "streaming/prefetch" to work properly.
252c9310920SPiotr Ziecik  * This is also required by 52xx family.
253b8b572e1SStephen Rothwell  */
254b8b572e1SStephen Rothwell #if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) \
255eb5aa213SChristophe Leroy 	|| defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_82xx) \
256c9310920SPiotr Ziecik 	|| defined(CONFIG_PPC_MPC52xx)
257b8b572e1SStephen Rothwell #define CPU_FTR_COMMON                  CPU_FTR_NEED_COHERENT
258b8b572e1SStephen Rothwell #else
259b8b572e1SStephen Rothwell #define CPU_FTR_COMMON                  0
260b8b572e1SStephen Rothwell #endif
261b8b572e1SStephen Rothwell 
262b8b572e1SStephen Rothwell /* The powersave features NAP & DOZE seems to confuse BDI when
263b8b572e1SStephen Rothwell    debugging. So if a BDI is used, disable theses
264b8b572e1SStephen Rothwell  */
265b8b572e1SStephen Rothwell #ifndef CONFIG_BDI_SWITCH
266b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_DOZE	CPU_FTR_CAN_DOZE
267b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_NAP	CPU_FTR_CAN_NAP
268b8b572e1SStephen Rothwell #else
269b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_DOZE	0
270b8b572e1SStephen Rothwell #define CPU_FTR_MAYBE_CAN_NAP	0
271b8b572e1SStephen Rothwell #endif
272b8b572e1SStephen Rothwell 
273c0d64cf9SPaul Mackerras #define CPU_FTRS_603	(CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
274385e89d5SChristophe Leroy 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE | CPU_FTR_NOEXECUTE)
275c0d64cf9SPaul Mackerras #define CPU_FTRS_604	(CPU_FTR_COMMON | CPU_FTR_PPC_LE)
276b8b572e1SStephen Rothwell #define CPU_FTRS_740_NOTAU	(CPU_FTR_COMMON | \
277c0d64cf9SPaul Mackerras 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_L2CR | \
2787c03d653SBenjamin Herrenschmidt 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
279b8b572e1SStephen Rothwell #define CPU_FTRS_740	(CPU_FTR_COMMON | \
280c0d64cf9SPaul Mackerras 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_L2CR | \
2817c03d653SBenjamin Herrenschmidt 	    CPU_FTR_TAU | CPU_FTR_MAYBE_CAN_NAP | \
282b8b572e1SStephen Rothwell 	    CPU_FTR_PPC_LE)
283b8b572e1SStephen Rothwell #define CPU_FTRS_750	(CPU_FTR_COMMON | \
284c0d64cf9SPaul Mackerras 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_L2CR | \
2857c03d653SBenjamin Herrenschmidt 	    CPU_FTR_TAU | CPU_FTR_MAYBE_CAN_NAP | \
286b8b572e1SStephen Rothwell 	    CPU_FTR_PPC_LE)
2877c03d653SBenjamin Herrenschmidt #define CPU_FTRS_750CL	(CPU_FTRS_750)
288b8b572e1SStephen Rothwell #define CPU_FTRS_750FX1	(CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM)
289b8b572e1SStephen Rothwell #define CPU_FTRS_750FX2	(CPU_FTRS_750 | CPU_FTR_NO_DPM)
2907c03d653SBenjamin Herrenschmidt #define CPU_FTRS_750FX	(CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX)
291b8b572e1SStephen Rothwell #define CPU_FTRS_750GX	(CPU_FTRS_750FX)
292b8b572e1SStephen Rothwell #define CPU_FTRS_7400_NOTAU	(CPU_FTR_COMMON | \
293c0d64cf9SPaul Mackerras 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_L2CR | \
2947c03d653SBenjamin Herrenschmidt 	    CPU_FTR_ALTIVEC_COMP | \
295b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
296b8b572e1SStephen Rothwell #define CPU_FTRS_7400	(CPU_FTR_COMMON | \
297c0d64cf9SPaul Mackerras 	    CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_L2CR | \
2987c03d653SBenjamin Herrenschmidt 	    CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | \
299b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
300b8b572e1SStephen Rothwell #define CPU_FTRS_7450_20	(CPU_FTR_COMMON | \
301c0d64cf9SPaul Mackerras 	    CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3027c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
303b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
304b8b572e1SStephen Rothwell #define CPU_FTRS_7450_21	(CPU_FTR_COMMON | \
305b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3067c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
307b8b572e1SStephen Rothwell 	    CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
308b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
309b8b572e1SStephen Rothwell #define CPU_FTRS_7450_23	(CPU_FTR_COMMON | \
310c0d64cf9SPaul Mackerras 	    CPU_FTR_NEED_PAIRED_STWCX | \
311b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3127c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
313b8b572e1SStephen Rothwell 	    CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
314b8b572e1SStephen Rothwell #define CPU_FTRS_7455_1	(CPU_FTR_COMMON | \
315c0d64cf9SPaul Mackerras 	    CPU_FTR_NEED_PAIRED_STWCX | \
316b8b572e1SStephen Rothwell 	    CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \
3177c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPEC7450 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
318b8b572e1SStephen Rothwell #define CPU_FTRS_7455_20	(CPU_FTR_COMMON | \
319c0d64cf9SPaul Mackerras 	    CPU_FTR_NEED_PAIRED_STWCX | \
320b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3217c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | \
322b8b572e1SStephen Rothwell 	    CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
3237c03d653SBenjamin Herrenschmidt 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
324b8b572e1SStephen Rothwell #define CPU_FTRS_7455	(CPU_FTR_COMMON | \
325b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3267c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
327b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
328b8b572e1SStephen Rothwell #define CPU_FTRS_7447_10	(CPU_FTR_COMMON | \
329b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3307c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
331b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE | \
332b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_PAIRED_STWCX)
333b8b572e1SStephen Rothwell #define CPU_FTRS_7447	(CPU_FTR_COMMON | \
334b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3357c03d653SBenjamin Herrenschmidt 	    CPU_FTR_L3CR | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
336b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
337b8b572e1SStephen Rothwell #define CPU_FTRS_7447A	(CPU_FTR_COMMON | \
338b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3397c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
340b8b572e1SStephen Rothwell 	    CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
341b8b572e1SStephen Rothwell #define CPU_FTRS_7448	(CPU_FTR_COMMON | \
342b8b572e1SStephen Rothwell 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
3437c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | \
344b8b572e1SStephen Rothwell 	    CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
345385e89d5SChristophe Leroy #define CPU_FTRS_82XX	(CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_NOEXECUTE)
346b8b572e1SStephen Rothwell #define CPU_FTRS_G2_LE	(CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
347197493afSChristophe Leroy 	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NOEXECUTE)
348b8b572e1SStephen Rothwell #define CPU_FTRS_E300	(CPU_FTR_MAYBE_CAN_DOZE | \
349c0d64cf9SPaul Mackerras 	    CPU_FTR_MAYBE_CAN_NAP | \
350385e89d5SChristophe Leroy 	    CPU_FTR_COMMON  | CPU_FTR_NOEXECUTE)
351b8b572e1SStephen Rothwell #define CPU_FTRS_E300C2	(CPU_FTR_MAYBE_CAN_DOZE | \
352c0d64cf9SPaul Mackerras 	    CPU_FTR_MAYBE_CAN_NAP | \
353385e89d5SChristophe Leroy 	    CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE  | CPU_FTR_NOEXECUTE)
354c0d64cf9SPaul Mackerras #define CPU_FTRS_CLASSIC32	(CPU_FTR_COMMON)
355c0d64cf9SPaul Mackerras #define CPU_FTRS_8XX	(CPU_FTR_NOEXECUTE)
3567d470345SChristophe Leroy #define CPU_FTRS_44X	(CPU_FTR_NOEXECUTE)
3577d470345SChristophe Leroy #define CPU_FTRS_440x6	(CPU_FTR_NOEXECUTE | \
3586d2170beSBenjamin Herrenschmidt 	    CPU_FTR_INDEXED_DCR)
359e7f75ad0SDave Kleikamp #define CPU_FTRS_47X	(CPU_FTRS_440x6)
360c0d64cf9SPaul Mackerras #define CPU_FTRS_E500	(CPU_FTR_MAYBE_CAN_DOZE | \
3617d470345SChristophe Leroy 	    CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | \
3628309ce72SBenjamin Herrenschmidt 	    CPU_FTR_NOEXECUTE)
363c0d64cf9SPaul Mackerras #define CPU_FTRS_E500_2	(CPU_FTR_MAYBE_CAN_DOZE | \
3647c03d653SBenjamin Herrenschmidt 	    CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | \
3657d470345SChristophe Leroy 	    CPU_FTR_NOEXECUTE)
3667d470345SChristophe Leroy #define CPU_FTRS_E500MC	( \
367dd0efb3fSPaul Mackerras 	    CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
36873196cd3SScott Wood 	    CPU_FTR_DBELL | CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV)
369d52459caSScott Wood /*
370d52459caSScott Wood  * e5500/e6500 erratum A-006958 is a timebase bug that can use the
371d52459caSScott Wood  * same workaround as CPU_FTR_CELL_TB_BUG.
372d52459caSScott Wood  */
3737d470345SChristophe Leroy #define CPU_FTRS_E5500	( \
374dd0efb3fSPaul Mackerras 	    CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
375d36b4c4fSKumar Gala 	    CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
376d52459caSScott Wood 	    CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_CELL_TB_BUG)
3777d470345SChristophe Leroy #define CPU_FTRS_E6500	( \
378dd0efb3fSPaul Mackerras 	    CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
37910241842SKumar Gala 	    CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
380d52459caSScott Wood 	    CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \
381e16c8765SAndy Fleming 	    CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT)
382b8b572e1SStephen Rothwell 
383b8b572e1SStephen Rothwell /* 64-bit CPUs */
384c0d64cf9SPaul Mackerras #define CPU_FTRS_PPC970	(CPU_FTR_LWSYNC | \
3853735eb85SNicholas Piggin 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
3862a929436SMark Nelson 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \
387969391c5SPaul Mackerras 	    CPU_FTR_CP_USE_DCBTZ | CPU_FTR_STCX_CHECKS_ADDRESS | \
38882a9f16aSMichael Neuling 	    CPU_FTR_HVMODE | CPU_FTR_DABRX)
389c0d64cf9SPaul Mackerras #define CPU_FTRS_POWER5	(CPU_FTR_LWSYNC | \
3907c03d653SBenjamin Herrenschmidt 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
391b8b572e1SStephen Rothwell 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
39244ae3ab3SMatt Evans 	    CPU_FTR_COHERENT_ICACHE | CPU_FTR_PURR | \
39382a9f16aSMichael Neuling 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_DABRX)
394c0d64cf9SPaul Mackerras #define CPU_FTRS_POWER6 (CPU_FTR_LWSYNC | \
3957c03d653SBenjamin Herrenschmidt 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
396b8b572e1SStephen Rothwell 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
39744ae3ab3SMatt Evans 	    CPU_FTR_COHERENT_ICACHE | \
398b8b572e1SStephen Rothwell 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
399f89451fbSAnton Blanchard 	    CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \
40082a9f16aSMichael Neuling 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_CFAR | \
40182a9f16aSMichael Neuling 	    CPU_FTR_DABRX)
402c0d64cf9SPaul Mackerras #define CPU_FTRS_POWER7 (CPU_FTR_LWSYNC | \
403969391c5SPaul Mackerras 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
404b8b572e1SStephen Rothwell 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
40544ae3ab3SMatt Evans 	    CPU_FTR_COHERENT_ICACHE | \
406b8b572e1SStephen Rothwell 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
40712564485SShawn Anastasio 	    CPU_FTR_DSCR | CPU_FTR_SAO  | CPU_FTR_ASYM_SMT | \
408851d2e2fSTseng-Hui (Frank) Lin 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
409c1807e3fSMichael Ellerman 	    CPU_FTR_CFAR | CPU_FTR_HVMODE | \
410a24204c3SAneesh Kumar K.V 	    CPU_FTR_VMX_COPY | CPU_FTR_HAS_PPR | CPU_FTR_DABRX )
411c0d64cf9SPaul Mackerras #define CPU_FTRS_POWER8 (CPU_FTR_LWSYNC | \
41271e18497SMichael Neuling 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
41371e18497SMichael Neuling 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
41471e18497SMichael Neuling 	    CPU_FTR_COHERENT_ICACHE | \
41571e18497SMichael Neuling 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
41612564485SShawn Anastasio 	    CPU_FTR_DSCR | CPU_FTR_SAO  | \
41771e18497SMichael Neuling 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
418c1807e3fSMichael Ellerman 	    CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
4191de2bd4eSMichael Ellerman 	    CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
420a24204c3SAneesh Kumar K.V 	    CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP )
42168f2f0d4SMichael Ellerman #define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG)
422c0d64cf9SPaul Mackerras #define CPU_FTRS_POWER9 (CPU_FTR_LWSYNC | \
423c3ab300eSMichael Neuling 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
424c3ab300eSMichael Neuling 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
425c3ab300eSMichael Neuling 	    CPU_FTR_COHERENT_ICACHE | \
426c3ab300eSMichael Neuling 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
42712564485SShawn Anastasio 	    CPU_FTR_DSCR | CPU_FTR_SAO  | \
428c3ab300eSMichael Neuling 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
4292384d2d7SNicholas Piggin 	    CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
43096541531SMichael Neuling 	    CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \
431a24204c3SAneesh Kumar K.V 	    CPU_FTR_TM_COMP | CPU_FTR_ARCH_300 | CPU_FTR_P9_TLBIE_STQ_BUG | \
432a24204c3SAneesh Kumar K.V 	    CPU_FTR_P9_TLBIE_ERAT_BUG | CPU_FTR_P9_TIDR)
433736bcdd3SJordan Niethe #define CPU_FTRS_POWER9_DD2_0 (CPU_FTRS_POWER9 | CPU_FTR_P9_RADIX_PREFETCH_BUG)
434736bcdd3SJordan Niethe #define CPU_FTRS_POWER9_DD2_1 (CPU_FTRS_POWER9 | \
435736bcdd3SJordan Niethe 			       CPU_FTR_P9_RADIX_PREFETCH_BUG | \
436736bcdd3SJordan Niethe 			       CPU_FTR_POWER9_DD2_1)
4373a52f601SNicholas Piggin #define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
4383a52f601SNicholas Piggin 			       CPU_FTR_P9_TM_HV_ASSIST | \
439b5af4f27SPaul Mackerras 			       CPU_FTR_P9_TM_XER_SO_BUG)
44026b78c81SReza Arbab #define CPU_FTRS_POWER9_DD2_3 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
44126b78c81SReza Arbab 			       CPU_FTR_P9_TM_HV_ASSIST | \
44226b78c81SReza Arbab 			       CPU_FTR_P9_TM_XER_SO_BUG | \
44326b78c81SReza Arbab 			       CPU_FTR_DAWR)
444a3ea40d5SAlistair Popple #define CPU_FTRS_POWER10 (CPU_FTR_LWSYNC | \
445a3ea40d5SAlistair Popple 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
446a3ea40d5SAlistair Popple 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
447a3ea40d5SAlistair Popple 	    CPU_FTR_COHERENT_ICACHE | \
448a3ea40d5SAlistair Popple 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
44912564485SShawn Anastasio 	    CPU_FTR_DSCR | CPU_FTR_SAO  | \
450a3ea40d5SAlistair Popple 	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
451a3ea40d5SAlistair Popple 	    CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
452a3ea40d5SAlistair Popple 	    CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \
453ec613a57SJordan Niethe 	    CPU_FTR_ARCH_300 | CPU_FTR_ARCH_31 | \
4540ffd60b7SBenjamin Gray 	    CPU_FTR_DAWR | CPU_FTR_DAWR1 | \
4550ffd60b7SBenjamin Gray 	    CPU_FTR_DEXCR_NPHIE)
456c2ed087eSMadhavan Srinivasan 
457c2ed087eSMadhavan Srinivasan #define CPU_FTRS_POWER11	CPU_FTRS_POWER10
458c2ed087eSMadhavan Srinivasan 
459c0d64cf9SPaul Mackerras #define CPU_FTRS_CELL	(CPU_FTR_LWSYNC | \
4607c03d653SBenjamin Herrenschmidt 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
461b8b572e1SStephen Rothwell 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
46244ae3ab3SMatt Evans 	    CPU_FTR_PAUSE_ZERO  | CPU_FTR_CELL_TB_BUG | CPU_FTR_CP_USE_DCBTZ | \
46382a9f16aSMichael Neuling 	    CPU_FTR_UNALIGNED_LD_STD | CPU_FTR_DABRX)
464c0d64cf9SPaul Mackerras #define CPU_FTRS_PA6T (CPU_FTR_LWSYNC | \
46544ae3ab3SMatt Evans 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP | \
46682a9f16aSMichael Neuling 	    CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_DABRX)
467c0d64cf9SPaul Mackerras #define CPU_FTRS_COMPATIBLE	(CPU_FTR_PPCAS_ARCH_V2)
468b8b572e1SStephen Rothwell 
4698d1eeabfSChristophe Leroy #ifdef CONFIG_PPC64
470e0d68273SChristophe Leroy #ifdef CONFIG_PPC_BOOK3E_64
47190029640SMichael Ellerman #define CPU_FTRS_POSSIBLE	(CPU_FTRS_E6500 | CPU_FTRS_E5500)
47211ed0db9SKumar Gala #else
473db5ae1c1SNicholas Piggin #ifdef CONFIG_CPU_LITTLE_ENDIAN
474db5ae1c1SNicholas Piggin #define CPU_FTRS_POSSIBLE	\
475db5ae1c1SNicholas Piggin 	    (CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \
476e11b64b1SJoel Stanley 	     CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | CPU_FTRS_POWER9 | \
47726b78c81SReza Arbab 	     CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
47826b78c81SReza Arbab 	     CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
479db5ae1c1SNicholas Piggin #else
480b8b572e1SStephen Rothwell #define CPU_FTRS_POSSIBLE	\
481471d7ff8SNicholas Piggin 	    (CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \
482468a3302SMichael Ellerman 	     CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
483e11b64b1SJoel Stanley 	     CPU_FTRS_POWER8 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \
484e11b64b1SJoel Stanley 	     CPU_FTR_VSX_COMP | CPU_FTR_ALTIVEC_COMP | CPU_FTRS_POWER9 | \
48526b78c81SReza Arbab 	     CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
48626b78c81SReza Arbab 	     CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
487db5ae1c1SNicholas Piggin #endif /* CONFIG_CPU_LITTLE_ENDIAN */
48811ed0db9SKumar Gala #endif
489b8b572e1SStephen Rothwell #else
490b8b572e1SStephen Rothwell enum {
491b8b572e1SStephen Rothwell 	CPU_FTRS_POSSIBLE =
49244e9754dSChristophe Leroy #ifdef CONFIG_PPC_BOOK3S_604
493ad510e37SChristophe Leroy 	    CPU_FTRS_604 | CPU_FTRS_740_NOTAU |
494b8b572e1SStephen Rothwell 	    CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 |
495b8b572e1SStephen Rothwell 	    CPU_FTRS_750FX2 | CPU_FTRS_750FX | CPU_FTRS_750GX |
496b8b572e1SStephen Rothwell 	    CPU_FTRS_7400_NOTAU | CPU_FTRS_7400 | CPU_FTRS_7450_20 |
497b8b572e1SStephen Rothwell 	    CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 |
498b8b572e1SStephen Rothwell 	    CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 |
499ad510e37SChristophe Leroy 	    CPU_FTRS_7447 | CPU_FTRS_7447A |
500b8b572e1SStephen Rothwell 	    CPU_FTRS_CLASSIC32 |
50144e9754dSChristophe Leroy #endif
50244e9754dSChristophe Leroy #ifdef CONFIG_PPC_BOOK3S_603
503ad510e37SChristophe Leroy 	    CPU_FTRS_603 | CPU_FTRS_82XX |
504ad510e37SChristophe Leroy 	    CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 |
505b8b572e1SStephen Rothwell #endif
506968159c0SChristophe Leroy #ifdef CONFIG_PPC_8xx
507b8b572e1SStephen Rothwell 	    CPU_FTRS_8XX |
508b8b572e1SStephen Rothwell #endif
509e7f75ad0SDave Kleikamp #ifdef CONFIG_PPC_47x
510c48d0dbaSDave Kleikamp 	    CPU_FTRS_47X | CPU_FTR_476_DD2 |
5118b8319b1SChristophe Leroy #elif defined(CONFIG_44x)
5128b8319b1SChristophe Leroy 	    CPU_FTRS_44X | CPU_FTRS_440x6 |
513e7f75ad0SDave Kleikamp #endif
514688de017SChristophe Leroy #ifdef CONFIG_PPC_E500
51506aae867SScott Wood 	    CPU_FTRS_E500 | CPU_FTRS_E500_2 |
51606aae867SScott Wood #endif
51706aae867SScott Wood #ifdef CONFIG_PPC_E500MC
51806aae867SScott Wood 	    CPU_FTRS_E500MC | CPU_FTRS_E5500 | CPU_FTRS_E6500 |
519b8b572e1SStephen Rothwell #endif
520b8b572e1SStephen Rothwell 	    0,
521b8b572e1SStephen Rothwell };
522b8b572e1SStephen Rothwell #endif /* __powerpc64__ */
523b8b572e1SStephen Rothwell 
5248d1eeabfSChristophe Leroy #ifdef CONFIG_PPC64
525e0d68273SChristophe Leroy #ifdef CONFIG_PPC_BOOK3E_64
52690029640SMichael Ellerman #define CPU_FTRS_ALWAYS		(CPU_FTRS_E6500 & CPU_FTRS_E5500)
52711ed0db9SKumar Gala #else
52881b654c2SMichael Ellerman 
52981b654c2SMichael Ellerman #ifdef CONFIG_PPC_DT_CPU_FTRS
53081b654c2SMichael Ellerman #define CPU_FTRS_DT_CPU_BASE			\
53181b654c2SMichael Ellerman 	(CPU_FTR_LWSYNC |			\
53281b654c2SMichael Ellerman 	 CPU_FTR_FPU_UNAVAILABLE |		\
53381b654c2SMichael Ellerman 	 CPU_FTR_NOEXECUTE |			\
53481b654c2SMichael Ellerman 	 CPU_FTR_COHERENT_ICACHE |		\
53581b654c2SMichael Ellerman 	 CPU_FTR_STCX_CHECKS_ADDRESS |		\
53681b654c2SMichael Ellerman 	 CPU_FTR_POPCNTB | CPU_FTR_POPCNTD |	\
53781b654c2SMichael Ellerman 	 CPU_FTR_DAWR |				\
53881b654c2SMichael Ellerman 	 CPU_FTR_ARCH_206 |			\
53981b654c2SMichael Ellerman 	 CPU_FTR_ARCH_207S)
54081b654c2SMichael Ellerman #else
54181b654c2SMichael Ellerman #define CPU_FTRS_DT_CPU_BASE	(~0ul)
54281b654c2SMichael Ellerman #endif
54381b654c2SMichael Ellerman 
544*6e9de205SNicholas Piggin /* pseries may disable DBELL with ibm,pi-features */
545db5ae1c1SNicholas Piggin #ifdef CONFIG_CPU_LITTLE_ENDIAN
546db5ae1c1SNicholas Piggin #define CPU_FTRS_ALWAYS \
547*6e9de205SNicholas Piggin 	    (CPU_FTRS_POSSIBLE & ~CPU_FTR_HVMODE & ~CPU_FTR_DBELL & \
548*6e9de205SNicholas Piggin 	     CPU_FTRS_POWER7 & CPU_FTRS_POWER8E & CPU_FTRS_POWER8 & \
549*6e9de205SNicholas Piggin 	     CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD2_1 & CPU_FTRS_POWER9_DD2_2 & \
550b4d9cc75SMichael Ellerman 	     CPU_FTRS_POWER10 & CPU_FTRS_DT_CPU_BASE)
551db5ae1c1SNicholas Piggin #else
552b8b572e1SStephen Rothwell #define CPU_FTRS_ALWAYS		\
553471d7ff8SNicholas Piggin 	    (CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \
554468a3302SMichael Ellerman 	     CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \
5553609e09fSMichael Ellerman 	     CPU_FTRS_PA6T & CPU_FTRS_POWER8 & CPU_FTRS_POWER8E & \
556*6e9de205SNicholas Piggin 	     ~CPU_FTR_HVMODE & ~CPU_FTR_DBELL & CPU_FTRS_POSSIBLE & \
557*6e9de205SNicholas Piggin 	     CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD2_1 & CPU_FTRS_POWER9_DD2_2 & \
558b4d9cc75SMichael Ellerman 	     CPU_FTRS_POWER10 & CPU_FTRS_DT_CPU_BASE)
559db5ae1c1SNicholas Piggin #endif /* CONFIG_CPU_LITTLE_ENDIAN */
56011ed0db9SKumar Gala #endif
561b8b572e1SStephen Rothwell #else
562b8b572e1SStephen Rothwell enum {
563b8b572e1SStephen Rothwell 	CPU_FTRS_ALWAYS =
56444e9754dSChristophe Leroy #ifdef CONFIG_PPC_BOOK3S_604
565ad510e37SChristophe Leroy 	    CPU_FTRS_604 & CPU_FTRS_740_NOTAU &
566b8b572e1SStephen Rothwell 	    CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 &
567b8b572e1SStephen Rothwell 	    CPU_FTRS_750FX2 & CPU_FTRS_750FX & CPU_FTRS_750GX &
568b8b572e1SStephen Rothwell 	    CPU_FTRS_7400_NOTAU & CPU_FTRS_7400 & CPU_FTRS_7450_20 &
569b8b572e1SStephen Rothwell 	    CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 &
570b8b572e1SStephen Rothwell 	    CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 &
571ad510e37SChristophe Leroy 	    CPU_FTRS_7447 & CPU_FTRS_7447A &
572b8b572e1SStephen Rothwell 	    CPU_FTRS_CLASSIC32 &
57344e9754dSChristophe Leroy #endif
57444e9754dSChristophe Leroy #ifdef CONFIG_PPC_BOOK3S_603
575ad510e37SChristophe Leroy 	    CPU_FTRS_603 & CPU_FTRS_82XX &
576ad510e37SChristophe Leroy 	    CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 &
577b8b572e1SStephen Rothwell #endif
578968159c0SChristophe Leroy #ifdef CONFIG_PPC_8xx
579b8b572e1SStephen Rothwell 	    CPU_FTRS_8XX &
580b8b572e1SStephen Rothwell #endif
5818b8319b1SChristophe Leroy #ifdef CONFIG_PPC_47x
5828b8319b1SChristophe Leroy 	    CPU_FTRS_47X &
5838b8319b1SChristophe Leroy #elif defined(CONFIG_44x)
5846d2170beSBenjamin Herrenschmidt 	    CPU_FTRS_44X & CPU_FTRS_440x6 &
585b8b572e1SStephen Rothwell #endif
586688de017SChristophe Leroy #ifdef CONFIG_PPC_E500
58706aae867SScott Wood 	    CPU_FTRS_E500 & CPU_FTRS_E500_2 &
58806aae867SScott Wood #endif
58906aae867SScott Wood #ifdef CONFIG_PPC_E500MC
59006aae867SScott Wood 	    CPU_FTRS_E500MC & CPU_FTRS_E5500 & CPU_FTRS_E6500 &
591b8b572e1SStephen Rothwell #endif
59273196cd3SScott Wood 	    ~CPU_FTR_EMB_HV &	/* can be removed at runtime */
593b8b572e1SStephen Rothwell 	    CPU_FTRS_POSSIBLE,
594b8b572e1SStephen Rothwell };
595b8b572e1SStephen Rothwell #endif /* __powerpc64__ */
596b8b572e1SStephen Rothwell 
597a6ba44e8SRavi Bangoria /*
598a6ba44e8SRavi Bangoria  * Maximum number of hw breakpoint supported on powerpc. Number of
599deb2bd9bSRavi Bangoria  * breakpoints supported by actual hw might be less than this, which
600deb2bd9bSRavi Bangoria  * is decided at run time in nr_wp_slots().
601a6ba44e8SRavi Bangoria  */
602deb2bd9bSRavi Bangoria #define HBP_NUM_MAX	2
6035aae8a53SK.Prasad 
604b8b572e1SStephen Rothwell #endif /* !__ASSEMBLY__ */
605b8b572e1SStephen Rothwell 
606b8b572e1SStephen Rothwell #endif /* __ASM_POWERPC_CPUTABLE_H */
607