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