xref: /linux/arch/powerpc/platforms/Kconfig.cputype (revision 7ba45f15049b4442c932ca2499aec739bb6bdbcf)
1# SPDX-License-Identifier: GPL-2.0
2config PPC32
3	bool
4	default y if !PPC64
5
6config PPC64
7	bool "64-bit kernel"
8	select ZLIB_DEFLATE
9	help
10	  This option selects whether a 32-bit or a 64-bit kernel
11	  will be built.
12
13menu "Processor support"
14choice
15	prompt "Processor Type"
16	depends on PPC32
17	help
18	  There are five families of 32 bit PowerPC chips supported.
19	  The most common ones are the desktop and server CPUs (603,
20	  604, 740, 750, 74xx) CPUs from Freescale and IBM, with their
21	  embedded 512x/52xx/82xx/83xx/86xx counterparts.
22	  The other embedded parts, namely 4xx, 8xx and e500
23	  (85xx) each form a family of their own that is not compatible
24	  with the others.
25
26	  If unsure, select 52xx/6xx/7xx/74xx/82xx/83xx/86xx.
27
28config PPC_BOOK3S_32
29	bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx"
30	imply PPC_FPU
31	select PPC_HAVE_PMU_SUPPORT
32	select HAVE_ARCH_VMAP_STACK
33
34config PPC_85xx
35	bool "Freescale 85xx"
36	select PPC_E500
37
38config PPC_8xx
39	bool "Freescale 8xx"
40	select ARCH_SUPPORTS_HUGETLBFS
41	select FSL_SOC
42	select PPC_KUEP
43	select HAVE_ARCH_VMAP_STACK
44	select HUGETLBFS
45
46config 44x
47	bool "AMCC 44x, 46x or 47x"
48	select PPC_DCR_NATIVE
49	select PPC_UDBG_16550
50	select HAVE_PCI
51	select PHYS_64BIT
52	select PPC_KUEP
53
54endchoice
55
56config PPC_BOOK3S_603
57	bool "Support for 603 SW loaded TLB"
58	depends on PPC_BOOK3S_32
59	default y
60	help
61	  Provide support for processors based on the 603 cores. Those
62	  processors don't have a HASH MMU and provide SW TLB loading.
63
64config PPC_BOOK3S_604
65	bool "Support for 604+ HASH MMU" if PPC_BOOK3S_603
66	depends on PPC_BOOK3S_32
67	default y
68	help
69	  Provide support for processors not based on the 603 cores.
70	  Those processors have a HASH MMU.
71
72choice
73	prompt "Processor Type"
74	depends on PPC64
75	help
76	  There are two families of 64 bit PowerPC chips supported.
77	  The most common ones are the desktop and server CPUs
78	  (POWER5, 970, POWER5+, POWER6, POWER7, POWER8, POWER9 ...)
79
80	  The other are the "embedded" processors compliant with the
81	  "Book 3E" variant of the architecture
82
83config PPC_BOOK3S_64
84	bool "Server processors"
85	select PPC_FPU
86	select PPC_HAVE_PMU_SUPPORT
87	select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
88	select ARCH_ENABLE_SPLIT_PMD_PTLOCK
89	select ARCH_SUPPORTS_HUGETLBFS
90	select ARCH_SUPPORTS_NUMA_BALANCING
91	select HAVE_MOVE_PMD
92	select HAVE_MOVE_PUD
93	select IRQ_WORK
94	select PPC_64S_HASH_MMU if !PPC_RADIX_MMU
95	select KASAN_VMALLOC if KASAN
96
97config PPC_BOOK3E_64
98	bool "Embedded processors"
99	select PPC_E500
100	select PPC_E500MC
101	select PPC_FPU # Make it a choice ?
102	select PPC_SMP_MUXED_IPI
103	select PPC_DOORBELL
104	select ZONE_DMA
105
106endchoice
107
108config PPC_THP
109       def_bool y
110       depends on PPC_BOOK3S_64
111       depends on PPC_RADIX_MMU || (PPC_64S_HASH_MMU && PAGE_SIZE_64KB)
112       select HAVE_ARCH_TRANSPARENT_HUGEPAGE
113       select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
114       select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
115
116choice
117	prompt "CPU selection"
118	help
119	  This will create a kernel which is optimised for a particular CPU.
120	  The resulting kernel may not run on other CPUs, so use this with care.
121
122	  If unsure, select Generic.
123
124config POWERPC64_CPU
125	bool "Generic 64 bits powerpc"
126	depends on PPC_BOOK3S_64
127	select ARCH_HAS_FAST_MULTIPLIER if CPU_LITTLE_ENDIAN
128	select PPC_64S_HASH_MMU
129	select PPC_HAS_LBARX_LHARX if CPU_LITTLE_ENDIAN
130
131config POWERPC_CPU
132	bool "Generic 32 bits powerpc"
133	depends on PPC_BOOK3S_32
134
135config CELL_CPU
136	bool "Cell Broadband Engine"
137	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
138	depends on !CC_IS_CLANG
139	select PPC_64S_HASH_MMU
140
141config PPC_970_CPU
142	bool "PowerPC 970 (including PowerPC G5)"
143	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
144	select PPC_64S_HASH_MMU
145
146config POWER6_CPU
147	bool "POWER6"
148	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
149	select PPC_64S_HASH_MMU
150
151config POWER7_CPU
152	bool "POWER7"
153	depends on PPC_BOOK3S_64
154	select ARCH_HAS_FAST_MULTIPLIER
155	select PPC_64S_HASH_MMU
156	select PPC_HAS_LBARX_LHARX
157
158config POWER8_CPU
159	bool "POWER8"
160	depends on PPC_BOOK3S_64
161	select ARCH_HAS_FAST_MULTIPLIER
162	select PPC_64S_HASH_MMU
163	select PPC_HAS_LBARX_LHARX
164
165config POWER9_CPU
166	bool "POWER9"
167	depends on PPC_BOOK3S_64
168	select ARCH_HAS_FAST_MULTIPLIER
169	select PPC_HAS_LBARX_LHARX
170
171config POWER10_CPU
172	bool "POWER10"
173	depends on PPC_BOOK3S_64
174	select ARCH_HAS_FAST_MULTIPLIER
175	select PPC_HAVE_PREFIXED_SUPPORT
176	select PPC_HAVE_PCREL_SUPPORT
177
178config E5500_CPU
179	bool "Freescale e5500"
180	depends on PPC64 && PPC_E500
181
182config E6500_CPU
183	bool "Freescale e6500"
184	depends on PPC64 && PPC_E500
185	depends on !CC_IS_CLANG
186	select PPC_HAS_LBARX_LHARX
187
188config 440_CPU
189	bool "440 (44x family)"
190	depends on 44x
191
192config 464_CPU
193	bool "464 (44x family)"
194	depends on 44x
195	depends on !CC_IS_CLANG
196
197config 476_CPU
198	bool "476 (47x family)"
199	depends on PPC_47x
200	depends on !CC_IS_CLANG
201
202config 860_CPU
203	bool "8xx family"
204	depends on PPC_8xx
205	depends on !CC_IS_CLANG
206
207config E300C2_CPU
208	bool "e300c2 (832x)"
209	depends on PPC_BOOK3S_32
210	depends on !CC_IS_CLANG
211
212config E300C3_CPU
213	bool "e300c3 (831x)"
214	depends on PPC_BOOK3S_32
215	depends on !CC_IS_CLANG
216
217config G4_CPU
218	bool "G4 (74xx)"
219	depends on PPC_BOOK3S_32
220	select ALTIVEC
221
222config E500_CPU
223	bool "e500 (8540)"
224	depends on PPC_85xx && !PPC_E500MC
225
226config E500MC_CPU
227	bool "e500mc"
228	depends on PPC_85xx && PPC_E500MC
229
230config TOOLCHAIN_DEFAULT_CPU
231	bool "Rely on the toolchain's implicit default CPU"
232
233endchoice
234
235config TARGET_CPU_BOOL
236	bool
237	default !TOOLCHAIN_DEFAULT_CPU
238
239config TARGET_CPU
240	string
241	depends on TARGET_CPU_BOOL
242	default "cell" if CELL_CPU
243	default "970" if PPC_970_CPU
244	default "power6" if POWER6_CPU
245	default "power7" if POWER7_CPU
246	default "power8" if POWER8_CPU
247	default "power9" if POWER9_CPU
248	default "power10" if POWER10_CPU
249	default "e5500" if E5500_CPU
250	default "e6500" if E6500_CPU
251	default "power4" if POWERPC64_CPU && !CPU_LITTLE_ENDIAN
252	default "power8" if POWERPC64_CPU && CPU_LITTLE_ENDIAN
253	default "440" if 440_CPU
254	default "464" if 464_CPU
255	default "476" if 476_CPU
256	default "860" if 860_CPU
257	default "e300c2" if E300C2_CPU
258	default "e300c3" if E300C3_CPU
259	default "G4" if G4_CPU
260	default "8540" if E500_CPU
261	default "e500mc" if E500MC_CPU
262	default "powerpc" if POWERPC_CPU
263
264config TUNE_CPU
265	string
266	depends on POWERPC64_CPU
267	default "-mtune=power10" if $(cc-option,-mtune=power10)
268	default "-mtune=power9"  if $(cc-option,-mtune=power9)
269	default "-mtune=power8"  if $(cc-option,-mtune=power8)
270
271config PPC_BOOK3S
272	def_bool y
273	depends on PPC_BOOK3S_32 || PPC_BOOK3S_64
274
275config PPC_E500
276	select FSL_EMB_PERFMON
277	bool
278	select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
279	select PPC_SMP_MUXED_IPI
280	select PPC_DOORBELL
281	select PPC_KUEP
282
283config PPC_E500MC
284	bool "e500mc Support"
285	select PPC_FPU
286	select COMMON_CLK
287	depends on PPC_E500
288	help
289	  This must be enabled for running on e500mc (and derivatives
290	  such as e5500/e6500), and must be disabled for running on
291	  e500v1 or e500v2.
292
293config PPC_FPU_REGS
294	bool
295
296config PPC_FPU
297	bool "Support for Floating Point Unit (FPU)" if PPC_MPC832x
298	default y if PPC64
299	select PPC_FPU_REGS
300	help
301	  This must be enabled to support the Floating Point Unit
302	  Most 6xx have an FPU but e300c2 core (mpc832x) don't have
303	  an FPU, so when building an embedded kernel for that target
304	  you can disable FPU support.
305
306	  If unsure say Y.
307
308config FSL_EMB_PERFMON
309	bool "Freescale Embedded Perfmon"
310	depends on PPC_E500 || PPC_83xx
311	help
312	  This is the Performance Monitor support found on the e500 core
313	  and some e300 cores (c3 and c4).  Select this only if your
314	  core supports the Embedded Performance Monitor APU
315
316config FSL_EMB_PERF_EVENT
317	bool
318	depends on FSL_EMB_PERFMON && PERF_EVENTS && !PPC_PERF_CTRS
319	default y
320
321config FSL_EMB_PERF_EVENT_E500
322	bool
323	depends on FSL_EMB_PERF_EVENT && PPC_E500
324	default y
325
326config 4xx
327	bool
328	depends on 44x
329	default y
330
331config BOOKE
332	bool
333	depends on PPC_E500 || 44x
334	default y
335
336config PTE_64BIT
337	bool
338	depends on 44x || PPC_E500 || PPC_86xx
339	default y if PHYS_64BIT
340
341config PHYS_64BIT
342	bool 'Large physical address support' if PPC_E500 || PPC_86xx
343	depends on (44x || PPC_E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx
344	select PHYS_ADDR_T_64BIT
345	help
346	  This option enables kernel support for larger than 32-bit physical
347	  addresses.  This feature may not be available on all cores.
348
349	  If you have more than 3.5GB of RAM or so, you also need to enable
350	  SWIOTLB under Kernel Options for this to work.  The actual number
351	  is platform-dependent.
352
353	  If in doubt, say N here.
354
355config ALTIVEC
356	bool "AltiVec Support"
357	depends on PPC_BOOK3S || (PPC_E500MC && PPC64 && !E5500_CPU)
358	select PPC_FPU
359	help
360	  This option enables kernel support for the Altivec extensions to the
361	  PowerPC processor. The kernel currently supports saving and restoring
362	  altivec registers, and turning on the 'altivec enable' bit so user
363	  processes can execute altivec instructions.
364
365	  This option is only usefully if you have a processor that supports
366	  altivec (G4, otherwise known as 74xx series), but does not have
367	  any affect on a non-altivec cpu (it does, however add code to the
368	  kernel).
369
370	  If in doubt, say Y here.
371
372config VSX
373	bool "VSX Support"
374	depends on PPC_BOOK3S_64 && ALTIVEC && PPC_FPU
375	help
376
377	  This option enables kernel support for the Vector Scaler extensions
378	  to the PowerPC processor. The kernel currently supports saving and
379	  restoring VSX registers, and turning on the 'VSX enable' bit so user
380	  processes can execute VSX instructions.
381
382	  This option is only useful if you have a processor that supports
383	  VSX (P7 and above), but does not have any affect on a non-VSX
384	  CPUs (it does, however add code to the kernel).
385
386	  If in doubt, say Y here.
387
388config SPE_POSSIBLE
389	def_bool y
390	depends on PPC_E500 && !PPC_E500MC
391
392config SPE
393	bool "SPE Support"
394	depends on SPE_POSSIBLE
395	default y
396	help
397	  This option enables kernel support for the Signal Processing
398	  Extensions (SPE) to the PowerPC processor. The kernel currently
399	  supports saving and restoring SPE registers, and turning on the
400	  'spe enable' bit so user processes can execute SPE instructions.
401
402	  This option is only useful if you have a processor that supports
403	  SPE (e500, otherwise known as 85xx series), but does not have any
404	  effect on a non-spe cpu (it does, however add code to the kernel).
405
406	  If in doubt, say Y here.
407
408config PPC_64S_HASH_MMU
409	bool "Hash MMU Support"
410	depends on PPC_BOOK3S_64
411	default y
412	help
413	  Enable support for the Power ISA Hash style MMU. This is implemented
414	  by all IBM Power and other 64-bit Book3S CPUs before ISA v3.0. The
415	  OpenPOWER ISA does not mandate the hash MMU and some CPUs do not
416	  implement it (e.g., Microwatt).
417
418	  Note that POWER9 PowerVM platforms only support the hash
419	  MMU. From POWER10 radix is also supported by PowerVM.
420
421	  If you're unsure, say Y.
422
423config PPC_RADIX_MMU
424	bool "Radix MMU Support"
425	depends on PPC_BOOK3S_64
426	default y
427	help
428	  Enable support for the Power ISA 3.0 Radix style MMU. Currently this
429	  is only implemented by IBM Power9 CPUs, if you don't have one of them
430	  you can probably disable this.
431
432config PPC_RADIX_MMU_DEFAULT
433	bool "Default to using the Radix MMU when possible" if PPC_64S_HASH_MMU
434	depends on PPC_BOOK3S_64
435	depends on PPC_RADIX_MMU
436	default y
437	help
438	  When the hardware supports the Radix MMU, default to using it unless
439	  "disable_radix[=yes]" is specified on the kernel command line.
440
441	  If this option is disabled, the Hash MMU will be used by default,
442	  unless "disable_radix=no" is specified on the kernel command line.
443
444	  If you're unsure, say Y.
445
446config PPC_RADIX_BROADCAST_TLBIE
447	bool
448	depends on PPC_RADIX_MMU
449	help
450	  Power ISA v3.0 and later implementations in the Linux Compliancy Subset
451	  and lower are not required to implement broadcast TLBIE instructions.
452	  Platforms with CPUs that do implement TLBIE broadcast, that is, where
453	  a TLB invalidation instruction performed on one CPU operates on the
454	  TLBs of all CPUs in the system, should select this option.  If this
455	  option is selected, the disable_tlbie kernel command line option can
456	  be used to cause global TLB invalidations to be done via IPIs; without
457	  it, IPIs will be used unconditionally.
458
459config PPC_KERNEL_PREFIXED
460	depends on PPC_HAVE_PREFIXED_SUPPORT
461	depends on CC_HAS_PREFIXED
462	default n
463	bool "Build Kernel with Prefixed Instructions"
464	help
465	  POWER10 and later CPUs support prefixed instructions, 8 byte
466	  instructions that include large immediate, pc relative addressing,
467	  and various floating point, vector, MMA.
468
469	  This option builds the kernel with prefixed instructions, and
470	  allows a pc relative addressing option to be selected.
471
472	  Kernel support for prefixed instructions in applications and guests
473	  is not affected by this option.
474
475config PPC_KERNEL_PCREL
476	depends on PPC_HAVE_PCREL_SUPPORT
477	depends on PPC_HAVE_PREFIXED_SUPPORT
478	depends on CC_HAS_PCREL
479	default n
480	select PPC_KERNEL_PREFIXED
481	bool "Build Kernel with PC-Relative addressing model"
482	help
483	  POWER10 and later CPUs support pc relative addressing. Recent
484	  compilers have support for an ELF ABI extension for a pc relative
485	  ABI.
486
487	  This option builds the kernel with the pc relative ABI model.
488
489config PPC_KUEP
490	bool "Kernel Userspace Execution Prevention"
491	default y
492	help
493	  Enable support for Kernel Userspace Execution Prevention (KUEP)
494
495	  If you're unsure, say Y.
496
497config PPC_KUAP
498	bool "Kernel Userspace Access Protection"
499	default y
500	help
501	  Enable support for Kernel Userspace Access Protection (KUAP)
502
503	  If you're unsure, say Y.
504
505config PPC_KUAP_DEBUG
506	bool "Extra debugging for Kernel Userspace Access Protection"
507	depends on PPC_KUAP
508	help
509	  Add extra debugging for Kernel Userspace Access Protection (KUAP)
510	  If you're unsure, say N.
511
512config PPC_PKEY
513	def_bool y
514	depends on PPC_BOOK3S_64
515	depends on PPC_MEM_KEYS || PPC_KUAP || PPC_KUEP
516
517
518config PPC_MMU_NOHASH
519	def_bool y
520	depends on !PPC_BOOK3S
521
522config PPC_HAVE_PMU_SUPPORT
523	bool
524
525config PPC_HAVE_PREFIXED_SUPPORT
526	bool
527
528config PPC_HAVE_PCREL_SUPPORT
529	bool
530
531config PMU_SYSFS
532	bool "Create PMU SPRs sysfs file"
533	default n
534	help
535	  This option enables sysfs file creation for PMU SPRs like MMCR* and PMC*.
536
537config PPC_PERF_CTRS
538	def_bool y
539	depends on PERF_EVENTS && PPC_HAVE_PMU_SUPPORT
540	help
541	 This enables the powerpc-specific perf_event back-end.
542
543config FORCE_SMP
544	# Allow platforms to force SMP=y by selecting this
545	bool
546	select SMP
547
548config SMP
549	depends on PPC_BOOK3S || PPC_E500 || PPC_47x
550	select GENERIC_IRQ_MIGRATION
551	bool "Symmetric multi-processing support" if !FORCE_SMP
552	help
553	  This enables support for systems with more than one CPU. If you have
554	  a system with only one CPU, say N. If you have a system with more
555	  than one CPU, say Y.  Note that the kernel does not currently
556	  support SMP machines with 603/603e/603ev or PPC750 ("G3") processors
557	  since they have inadequate hardware support for multiprocessor
558	  operation.
559
560	  If you say N here, the kernel will run on single and multiprocessor
561	  machines, but will use only one CPU of a multiprocessor machine. If
562	  you say Y here, the kernel will run on single-processor machines.
563	  On a single-processor machine, the kernel will run faster if you say
564	  N here.
565
566	  If you don't know what to do here, say N.
567
568config NR_CPUS
569	int "Maximum number of CPUs (2-8192)" if SMP
570	range 2 8192 if SMP
571	default "1" if !SMP
572	default "32" if PPC64
573	default "4"
574
575config NOT_COHERENT_CACHE
576	bool
577	depends on 44x || PPC_8xx || PPC_MPC512x || \
578		GAMECUBE_COMMON || AMIGAONE
579	select ARCH_HAS_DMA_PREP_COHERENT
580	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
581	select ARCH_HAS_SYNC_DMA_FOR_CPU
582	select DMA_DIRECT_REMAP
583	default n if PPC_47x
584	default y
585
586config CHECK_CACHE_COHERENCY
587	bool
588
589config PPC_DOORBELL
590	bool
591
592endmenu
593
594config VDSO32
595	def_bool y
596	depends on PPC32 || COMPAT
597	help
598	  This symbol controls whether we build the 32-bit VDSO. We obviously
599	  want to do that if we're building a 32-bit kernel. If we're building
600	  a 64-bit kernel then we only want a 32-bit VDSO if we're also enabling
601	  COMPAT.
602
603choice
604	prompt "Endianness selection"
605	default CPU_BIG_ENDIAN
606	help
607	  This option selects whether a big endian or little endian kernel will
608	  be built.
609
610config CPU_BIG_ENDIAN
611	bool "Build big endian kernel"
612	help
613	  Build a big endian kernel.
614
615	  If unsure, select this option.
616
617config CPU_LITTLE_ENDIAN
618	bool "Build little endian kernel"
619	depends on PPC_BOOK3S_64
620	select PPC64_BOOT_WRAPPER
621	help
622	  Build a little endian kernel.
623
624	  Note that if cross compiling a little endian kernel,
625	  CROSS_COMPILE must point to a toolchain capable of targeting
626	  little endian powerpc.
627
628endchoice
629
630config PPC64_ELF_ABI_V1
631	def_bool PPC64 && (CPU_BIG_ENDIAN && !PPC64_BIG_ENDIAN_ELF_ABI_V2)
632
633config PPC64_ELF_ABI_V2
634	def_bool PPC64 && !PPC64_ELF_ABI_V1
635
636config PPC64_BOOT_WRAPPER
637	def_bool n
638	depends on CPU_LITTLE_ENDIAN
639