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