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 40x
47	bool "AMCC 40x"
48	select PPC_DCR_NATIVE
49	select PPC_UDBG_16550
50	select 4xx_SOC
51	select HAVE_PCI
52	select PPC_KUEP if PPC_KUAP
53
54config 44x
55	bool "AMCC 44x, 46x or 47x"
56	select PPC_DCR_NATIVE
57	select PPC_UDBG_16550
58	select 4xx_SOC
59	select HAVE_PCI
60	select PHYS_64BIT
61	select PPC_KUEP
62
63endchoice
64
65config PPC_BOOK3S_603
66	bool "Support for 603 SW loaded TLB"
67	depends on PPC_BOOK3S_32
68	default y
69	help
70	  Provide support for processors based on the 603 cores. Those
71	  processors don't have a HASH MMU and provide SW TLB loading.
72
73config PPC_BOOK3S_604
74	bool "Support for 604+ HASH MMU" if PPC_BOOK3S_603
75	depends on PPC_BOOK3S_32
76	default y
77	help
78	  Provide support for processors not based on the 603 cores.
79	  Those processors have a HASH MMU.
80
81choice
82	prompt "Processor Type"
83	depends on PPC64
84	help
85	  There are two families of 64 bit PowerPC chips supported.
86	  The most common ones are the desktop and server CPUs
87	  (POWER5, 970, POWER5+, POWER6, POWER7, POWER8, POWER9 ...)
88
89	  The other are the "embedded" processors compliant with the
90	  "Book 3E" variant of the architecture
91
92config PPC_BOOK3S_64
93	bool "Server processors"
94	select PPC_FPU
95	select PPC_HAVE_PMU_SUPPORT
96	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
97	select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
98	select ARCH_ENABLE_SPLIT_PMD_PTLOCK
99	select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
100	select ARCH_SUPPORTS_HUGETLBFS
101	select ARCH_SUPPORTS_NUMA_BALANCING
102	select HAVE_MOVE_PMD
103	select HAVE_MOVE_PUD
104	select IRQ_WORK
105	select PPC_64S_HASH_MMU if !PPC_RADIX_MMU
106	select KASAN_VMALLOC if KASAN
107
108config PPC_BOOK3E_64
109	bool "Embedded processors"
110	select PPC_E500
111	select PPC_E500MC
112	select PPC_FPU # Make it a choice ?
113	select PPC_SMP_MUXED_IPI
114	select PPC_DOORBELL
115	select ZONE_DMA
116
117endchoice
118
119choice
120	prompt "CPU selection"
121	default GENERIC_CPU
122	help
123	  This will create a kernel which is optimised for a particular CPU.
124	  The resulting kernel may not run on other CPUs, so use this with care.
125
126	  If unsure, select Generic.
127
128config GENERIC_CPU
129	bool "Generic (POWER5 and PowerPC 970 and above)"
130	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
131	select PPC_64S_HASH_MMU
132
133config GENERIC_CPU
134	bool "Generic (POWER8 and above)"
135	depends on PPC_BOOK3S_64 && CPU_LITTLE_ENDIAN
136	select ARCH_HAS_FAST_MULTIPLIER
137	select PPC_64S_HASH_MMU
138	select PPC_HAS_LBARX_LHARX
139
140config POWERPC_CPU
141	bool "Generic 32 bits powerpc"
142	depends on PPC_BOOK3S_32
143
144config CELL_CPU
145	bool "Cell Broadband Engine"
146	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
147	select PPC_64S_HASH_MMU
148
149config PPC_970_CPU
150	bool "PowerPC 970 (including PowerPC G5)"
151	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
152	select PPC_64S_HASH_MMU
153
154config POWER6_CPU
155	bool "POWER6"
156	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
157	select PPC_64S_HASH_MMU
158
159config POWER7_CPU
160	bool "POWER7"
161	depends on PPC_BOOK3S_64
162	select ARCH_HAS_FAST_MULTIPLIER
163	select PPC_64S_HASH_MMU
164	select PPC_HAS_LBARX_LHARX
165
166config POWER8_CPU
167	bool "POWER8"
168	depends on PPC_BOOK3S_64
169	select ARCH_HAS_FAST_MULTIPLIER
170	select PPC_64S_HASH_MMU
171	select PPC_HAS_LBARX_LHARX
172
173config POWER9_CPU
174	bool "POWER9"
175	depends on PPC_BOOK3S_64
176	select ARCH_HAS_FAST_MULTIPLIER
177	select PPC_HAS_LBARX_LHARX
178
179config POWER10_CPU
180	bool "POWER10"
181	depends on PPC_BOOK3S_64
182	select ARCH_HAS_FAST_MULTIPLIER
183
184config E5500_CPU
185	bool "Freescale e5500"
186	depends on PPC64 && PPC_E500
187
188config E6500_CPU
189	bool "Freescale e6500"
190	depends on PPC64 && PPC_E500
191	select PPC_HAS_LBARX_LHARX
192
193config 405_CPU
194	bool "40x family"
195	depends on 40x
196
197config 440_CPU
198	bool "440 (44x family)"
199	depends on 44x
200
201config 464_CPU
202	bool "464 (44x family)"
203	depends on 44x
204
205config 476_CPU
206	bool "476 (47x family)"
207	depends on PPC_47x
208
209config 860_CPU
210	bool "8xx family"
211	depends on PPC_8xx
212
213config E300C2_CPU
214	bool "e300c2 (832x)"
215	depends on PPC_BOOK3S_32
216
217config E300C3_CPU
218	bool "e300c3 (831x)"
219	depends on PPC_BOOK3S_32
220
221config G4_CPU
222	bool "G4 (74xx)"
223	depends on PPC_BOOK3S_32
224	select ALTIVEC
225
226config E500_CPU
227	bool "e500 (8540)"
228	depends on PPC_85xx && !PPC_E500MC
229
230config E500MC_CPU
231	bool "e500mc"
232	depends on PPC_85xx && PPC_E500MC
233
234config TOOLCHAIN_DEFAULT_CPU
235	bool "Rely on the toolchain's implicit default CPU"
236	depends on PPC32
237
238endchoice
239
240config TARGET_CPU_BOOL
241	bool
242	default !GENERIC_CPU && !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 "405" if 405_CPU
255	default "440" if 440_CPU
256	default "464" if 464_CPU
257	default "476" if 476_CPU
258	default "860" if 860_CPU
259	default "e300c2" if E300C2_CPU
260	default "e300c3" if E300C3_CPU
261	default "G4" if G4_CPU
262	default "8540" if E500_CPU
263	default "e500mc" if E500MC_CPU
264	default "powerpc" if POWERPC_CPU
265
266config PPC_BOOK3S
267	def_bool y
268	depends on PPC_BOOK3S_32 || PPC_BOOK3S_64
269
270config PPC_E500
271	select FSL_EMB_PERFMON
272	bool
273	select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
274	select PPC_SMP_MUXED_IPI
275	select PPC_DOORBELL
276	select PPC_KUEP
277
278config PPC_E500MC
279	bool "e500mc Support"
280	select PPC_FPU
281	select COMMON_CLK
282	depends on PPC_E500
283	help
284	  This must be enabled for running on e500mc (and derivatives
285	  such as e5500/e6500), and must be disabled for running on
286	  e500v1 or e500v2.
287
288config PPC_FPU_REGS
289	bool
290
291config PPC_FPU
292	bool "Support for Floating Point Unit (FPU)" if PPC_MPC832x
293	default y if PPC64
294	select PPC_FPU_REGS
295	help
296	  This must be enabled to support the Floating Point Unit
297	  Most 6xx have an FPU but e300c2 core (mpc832x) don't have
298	  an FPU, so when building an embedded kernel for that target
299	  you can disable FPU support.
300
301	  If unsure say Y.
302
303config FSL_EMB_PERFMON
304	bool "Freescale Embedded Perfmon"
305	depends on PPC_E500 || PPC_83xx
306	help
307	  This is the Performance Monitor support found on the e500 core
308	  and some e300 cores (c3 and c4).  Select this only if your
309	  core supports the Embedded Performance Monitor APU
310
311config FSL_EMB_PERF_EVENT
312	bool
313	depends on FSL_EMB_PERFMON && PERF_EVENTS && !PPC_PERF_CTRS
314	default y
315
316config FSL_EMB_PERF_EVENT_E500
317	bool
318	depends on FSL_EMB_PERF_EVENT && PPC_E500
319	default y
320
321config 4xx
322	bool
323	depends on 40x || 44x
324	default y
325
326config BOOKE
327	bool
328	depends on PPC_E500 || 44x
329	default y
330
331config BOOKE_OR_40x
332	bool
333	depends on BOOKE || 40x
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	select ARCH_HAS_GIGANTIC_PAGE
427	default y
428	help
429	  Enable support for the Power ISA 3.0 Radix style MMU. Currently this
430	  is only implemented by IBM Power9 CPUs, if you don't have one of them
431	  you can probably disable this.
432
433config PPC_RADIX_MMU_DEFAULT
434	bool "Default to using the Radix MMU when possible" if PPC_64S_HASH_MMU
435	depends on PPC_BOOK3S_64
436	depends on PPC_RADIX_MMU
437	default y
438	help
439	  When the hardware supports the Radix MMU, default to using it unless
440	  "disable_radix[=yes]" is specified on the kernel command line.
441
442	  If this option is disabled, the Hash MMU will be used by default,
443	  unless "disable_radix=no" is specified on the kernel command line.
444
445	  If you're unsure, say Y.
446
447config PPC_KUEP
448	bool "Kernel Userspace Execution Prevention" if !40x
449	default y if !40x
450	help
451	  Enable support for Kernel Userspace Execution Prevention (KUEP)
452
453	  If you're unsure, say Y.
454
455config PPC_KUAP
456	bool "Kernel Userspace Access Protection"
457	default y
458	help
459	  Enable support for Kernel Userspace Access Protection (KUAP)
460
461	  If you're unsure, say Y.
462
463config PPC_KUAP_DEBUG
464	bool "Extra debugging for Kernel Userspace Access Protection"
465	depends on PPC_KUAP
466	help
467	  Add extra debugging for Kernel Userspace Access Protection (KUAP)
468	  If you're unsure, say N.
469
470config PPC_PKEY
471	def_bool y
472	depends on PPC_BOOK3S_64
473	depends on PPC_MEM_KEYS || PPC_KUAP || PPC_KUEP
474
475
476config PPC_MMU_NOHASH
477	def_bool y
478	depends on !PPC_BOOK3S
479
480config PPC_HAVE_PMU_SUPPORT
481	bool
482
483config PMU_SYSFS
484	bool "Create PMU SPRs sysfs file"
485	default n
486	help
487	  This option enables sysfs file creation for PMU SPRs like MMCR* and PMC*.
488
489config PPC_PERF_CTRS
490	def_bool y
491	depends on PERF_EVENTS && PPC_HAVE_PMU_SUPPORT
492	help
493	 This enables the powerpc-specific perf_event back-end.
494
495config FORCE_SMP
496	# Allow platforms to force SMP=y by selecting this
497	bool
498	select SMP
499
500config SMP
501	depends on PPC_BOOK3S || PPC_E500 || PPC_47x
502	select GENERIC_IRQ_MIGRATION
503	bool "Symmetric multi-processing support" if !FORCE_SMP
504	help
505	  This enables support for systems with more than one CPU. If you have
506	  a system with only one CPU, say N. If you have a system with more
507	  than one CPU, say Y.  Note that the kernel does not currently
508	  support SMP machines with 603/603e/603ev or PPC750 ("G3") processors
509	  since they have inadequate hardware support for multiprocessor
510	  operation.
511
512	  If you say N here, the kernel will run on single and multiprocessor
513	  machines, but will use only one CPU of a multiprocessor machine. If
514	  you say Y here, the kernel will run on single-processor machines.
515	  On a single-processor machine, the kernel will run faster if you say
516	  N here.
517
518	  If you don't know what to do here, say N.
519
520config NR_CPUS
521	int "Maximum number of CPUs (2-8192)" if SMP
522	range 2 8192 if SMP
523	default "1" if !SMP
524	default "32" if PPC64
525	default "4"
526
527config NOT_COHERENT_CACHE
528	bool
529	depends on 4xx || PPC_8xx || PPC_MPC512x || \
530		GAMECUBE_COMMON || AMIGAONE
531	select ARCH_HAS_DMA_PREP_COHERENT
532	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
533	select ARCH_HAS_SYNC_DMA_FOR_CPU
534	select DMA_DIRECT_REMAP
535	default n if PPC_47x
536	default y
537
538config CHECK_CACHE_COHERENCY
539	bool
540
541config PPC_DOORBELL
542	bool
543
544endmenu
545
546config VDSO32
547	def_bool y
548	depends on PPC32 || COMPAT
549	help
550	  This symbol controls whether we build the 32-bit VDSO. We obviously
551	  want to do that if we're building a 32-bit kernel. If we're building
552	  a 64-bit kernel then we only want a 32-bit VDSO if we're also enabling
553	  COMPAT.
554
555choice
556	prompt "Endianness selection"
557	default CPU_BIG_ENDIAN
558	help
559	  This option selects whether a big endian or little endian kernel will
560	  be built.
561
562config CPU_BIG_ENDIAN
563	bool "Build big endian kernel"
564	help
565	  Build a big endian kernel.
566
567	  If unsure, select this option.
568
569config CPU_LITTLE_ENDIAN
570	bool "Build little endian kernel"
571	depends on PPC_BOOK3S_64
572	select PPC64_BOOT_WRAPPER
573	help
574	  Build a little endian kernel.
575
576	  Note that if cross compiling a little endian kernel,
577	  CROSS_COMPILE must point to a toolchain capable of targeting
578	  little endian powerpc.
579
580endchoice
581
582config PPC64_ELF_ABI_V1
583	def_bool PPC64 && (CPU_BIG_ENDIAN && !PPC64_BIG_ENDIAN_ELF_ABI_V2)
584
585config PPC64_ELF_ABI_V2
586	def_bool PPC64 && !PPC64_ELF_ABI_V1
587
588config PPC64_BOOT_WRAPPER
589	def_bool n
590	depends on CPU_LITTLE_ENDIAN
591