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