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