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