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 44x 47 bool "AMCC 44x, 46x or 47x" 48 select PPC_DCR_NATIVE 49 select PPC_UDBG_16550 50 select HAVE_PCI 51 select PHYS_64BIT 52 select PPC_KUEP 53 54endchoice 55 56config PPC_BOOK3S_603 57 bool "Support for 603 SW loaded TLB" 58 depends on PPC_BOOK3S_32 59 default y 60 help 61 Provide support for processors based on the 603 cores. Those 62 processors don't have a HASH MMU and provide SW TLB loading. 63 64config PPC_BOOK3S_604 65 bool "Support for 604+ HASH MMU" if PPC_BOOK3S_603 66 depends on PPC_BOOK3S_32 67 default y 68 help 69 Provide support for processors not based on the 603 cores. 70 Those processors have a HASH MMU. 71 72choice 73 prompt "Processor Type" 74 depends on PPC64 75 help 76 There are two families of 64 bit PowerPC chips supported. 77 The most common ones are the desktop and server CPUs 78 (POWER5, 970, POWER5+, POWER6, POWER7, POWER8, POWER9 ...) 79 80 The other are the "embedded" processors compliant with the 81 "Book 3E" variant of the architecture 82 83config PPC_BOOK3S_64 84 bool "Server processors" 85 select PPC_FPU 86 select PPC_HAVE_PMU_SUPPORT 87 select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION 88 select ARCH_ENABLE_SPLIT_PMD_PTLOCK 89 select ARCH_SUPPORTS_HUGETLBFS 90 select ARCH_SUPPORTS_NUMA_BALANCING 91 select HAVE_MOVE_PMD 92 select HAVE_MOVE_PUD 93 select IRQ_WORK 94 select PPC_64S_HASH_MMU if !PPC_RADIX_MMU 95 select KASAN_VMALLOC if KASAN 96 select ARCH_HAS_LAZY_MMU_MODE 97 98config PPC_BOOK3E_64 99 bool "Embedded processors" 100 select PPC_E500 101 select PPC_E500MC 102 select PPC_FPU # Make it a choice ? 103 select PPC_SMP_MUXED_IPI 104 select PPC_DOORBELL 105 select ZONE_DMA 106 107endchoice 108 109config PPC_THP 110 def_bool y 111 depends on PPC_BOOK3S_64 112 depends on PPC_RADIX_MMU || (PPC_64S_HASH_MMU && PAGE_SIZE_64KB) 113 select HAVE_ARCH_TRANSPARENT_HUGEPAGE 114 select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD 115 select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE 116 117choice 118 prompt "CPU selection" 119 help 120 This will create a kernel which is optimised for a particular CPU. 121 The resulting kernel may not run on other CPUs, so use this with care. 122 123 If unsure, select Generic. 124 125config POWERPC64_CPU 126 bool "Generic 64 bits powerpc" 127 depends on PPC_BOOK3S_64 128 select ARCH_HAS_FAST_MULTIPLIER if CPU_LITTLE_ENDIAN 129 select PPC_64S_HASH_MMU 130 select PPC_HAS_LBARX_LHARX if CPU_LITTLE_ENDIAN 131 132config POWERPC_CPU 133 bool "Generic 32 bits powerpc" 134 depends on PPC_BOOK3S_32 135 136config CELL_CPU 137 bool "Cell Broadband Engine" 138 depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN 139 depends on !CC_IS_CLANG 140 select PPC_64S_HASH_MMU 141 142config PPC_970_CPU 143 bool "PowerPC 970 (including PowerPC G5)" 144 depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN 145 select PPC_64S_HASH_MMU 146 147config POWER6_CPU 148 bool "POWER6" 149 depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN 150 select PPC_64S_HASH_MMU 151 152config POWER7_CPU 153 bool "POWER7" 154 depends on PPC_BOOK3S_64 155 select ARCH_HAS_FAST_MULTIPLIER 156 select PPC_64S_HASH_MMU 157 select PPC_HAS_LBARX_LHARX 158 159config POWER8_CPU 160 bool "POWER8" 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 POWER9_CPU 167 bool "POWER9" 168 depends on PPC_BOOK3S_64 169 select ARCH_HAS_FAST_MULTIPLIER 170 select PPC_HAS_LBARX_LHARX 171 172config POWER10_CPU 173 bool "POWER10" 174 depends on PPC_BOOK3S_64 175 select ARCH_HAS_FAST_MULTIPLIER 176 select PPC_HAVE_PREFIXED_SUPPORT 177 select PPC_HAVE_PCREL_SUPPORT 178 179config E5500_CPU 180 bool "Freescale e5500" 181 depends on PPC64 && PPC_E500 182 183config E6500_CPU 184 bool "Freescale e6500" 185 depends on PPC64 && PPC_E500 186 depends on !CC_IS_CLANG 187 select PPC_HAS_LBARX_LHARX 188 189config 440_CPU 190 bool "440 (44x family)" 191 depends on 44x 192 193config 464_CPU 194 bool "464 (44x family)" 195 depends on 44x 196 depends on !CC_IS_CLANG 197 198config 476_CPU 199 bool "476 (47x family)" 200 depends on PPC_47x 201 depends on !CC_IS_CLANG 202 203config 860_CPU 204 bool "8xx family" 205 depends on PPC_8xx 206 depends on !CC_IS_CLANG 207 208config E300C2_CPU 209 bool "e300c2 (832x)" 210 depends on PPC_BOOK3S_32 211 depends on !CC_IS_CLANG 212 213config E300C3_CPU 214 bool "e300c3 (831x)" 215 depends on PPC_BOOK3S_32 216 depends on !CC_IS_CLANG 217 218config G4_CPU 219 bool "G4 (74xx)" 220 depends on PPC_BOOK3S_32 221 select ALTIVEC 222 223config E500_CPU 224 bool "e500 (8540)" 225 depends on PPC_85xx && !PPC_E500MC 226 227config E500MC_CPU 228 bool "e500mc" 229 depends on PPC_85xx && PPC_E500MC 230 231config TOOLCHAIN_DEFAULT_CPU 232 bool "Rely on the toolchain's implicit default CPU" 233 234endchoice 235 236config TARGET_CPU_BOOL 237 bool 238 default !TOOLCHAIN_DEFAULT_CPU 239 240config TARGET_CPU 241 string 242 depends on TARGET_CPU_BOOL 243 default "cell" if CELL_CPU 244 default "970" if PPC_970_CPU 245 default "power6" if POWER6_CPU 246 default "power7" if POWER7_CPU 247 default "power8" if POWER8_CPU 248 default "power9" if POWER9_CPU 249 default "power10" if POWER10_CPU 250 default "e5500" if E5500_CPU 251 default "e6500" if E6500_CPU 252 default "power4" if POWERPC64_CPU && !CPU_LITTLE_ENDIAN 253 default "power8" if POWERPC64_CPU && CPU_LITTLE_ENDIAN 254 default "440" if 440_CPU 255 default "464" if 464_CPU 256 default "476" if 476_CPU 257 default "860" if 860_CPU 258 default "e300c2" if E300C2_CPU 259 default "e300c3" if E300C3_CPU 260 default "G4" if G4_CPU 261 default "8540" if E500_CPU 262 default "e500mc" if E500MC_CPU 263 default "powerpc" if POWERPC_CPU 264 265config TUNE_CPU 266 string 267 depends on POWERPC64_CPU 268 default "-mtune=power10" if $(cc-option,-mtune=power10) 269 default "-mtune=power9" if $(cc-option,-mtune=power9) 270 default "-mtune=power8" if $(cc-option,-mtune=power8) 271 272config PPC_BOOK3S 273 def_bool y 274 depends on PPC_BOOK3S_32 || PPC_BOOK3S_64 275 276config PPC_E500 277 select FSL_EMB_PERFMON 278 bool 279 select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64 280 select PPC_SMP_MUXED_IPI 281 select PPC_DOORBELL 282 select PPC_KUEP 283 284config PPC_E500MC 285 bool "e500mc Support" 286 select PPC_FPU 287 select COMMON_CLK 288 depends on PPC_E500 289 help 290 This must be enabled for running on e500mc (and derivatives 291 such as e5500/e6500), and must be disabled for running on 292 e500v1 or e500v2. 293 294config PPC_FPU_REGS 295 bool 296 297config PPC_FPU 298 bool "Support for Floating Point Unit (FPU)" if PPC_MPC832x 299 default y if PPC64 300 select PPC_FPU_REGS 301 help 302 This must be enabled to support the Floating Point Unit 303 Most 6xx have an FPU but e300c2 core (mpc832x) don't have 304 an FPU, so when building an embedded kernel for that target 305 you can disable FPU support. 306 307 If unsure say Y. 308 309config FSL_EMB_PERFMON 310 bool "Freescale Embedded Perfmon" 311 depends on PPC_E500 || PPC_83xx 312 help 313 This is the Performance Monitor support found on the e500 core 314 and some e300 cores (c3 and c4). Select this only if your 315 core supports the Embedded Performance Monitor APU 316 317config FSL_EMB_PERF_EVENT 318 bool 319 depends on FSL_EMB_PERFMON && PERF_EVENTS && !PPC_PERF_CTRS 320 default y 321 322config FSL_EMB_PERF_EVENT_E500 323 bool 324 depends on FSL_EMB_PERF_EVENT && PPC_E500 325 default y 326 327config 4xx 328 bool 329 depends on 44x 330 default y 331 332config BOOKE 333 bool 334 depends on PPC_E500 || 44x 335 default y 336 337config PTE_64BIT 338 bool 339 depends on 44x || PPC_E500 || PPC_86xx 340 default y if PHYS_64BIT 341 342config PHYS_64BIT 343 bool 'Large physical address support' if PPC_E500 || PPC_86xx 344 depends on (44x || PPC_E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx 345 select PHYS_ADDR_T_64BIT 346 help 347 This option enables kernel support for larger than 32-bit physical 348 addresses. This feature may not be available on all cores. 349 350 If you have more than 3.5GB of RAM or so, you also need to enable 351 SWIOTLB under Kernel Options for this to work. The actual number 352 is platform-dependent. 353 354 If in doubt, say N here. 355 356config ALTIVEC 357 bool "AltiVec Support" 358 depends on PPC_BOOK3S || (PPC_E500MC && PPC64 && !E5500_CPU) 359 select PPC_FPU 360 help 361 This option enables kernel support for the Altivec extensions to the 362 PowerPC processor. The kernel currently supports saving and restoring 363 altivec registers, and turning on the 'altivec enable' bit so user 364 processes can execute altivec instructions. 365 366 This option is only usefully if you have a processor that supports 367 altivec (G4, otherwise known as 74xx series), but does not have 368 any affect on a non-altivec cpu (it does, however add code to the 369 kernel). 370 371 If in doubt, say Y here. 372 373config VSX 374 bool "VSX Support" 375 depends on PPC_BOOK3S_64 && ALTIVEC && PPC_FPU 376 help 377 378 This option enables kernel support for the Vector Scaler extensions 379 to the PowerPC processor. The kernel currently supports saving and 380 restoring VSX registers, and turning on the 'VSX enable' bit so user 381 processes can execute VSX instructions. 382 383 This option is only useful if you have a processor that supports 384 VSX (P7 and above), but does not have any affect on a non-VSX 385 CPUs (it does, however add code to the kernel). 386 387 If in doubt, say Y here. 388 389config SPE_POSSIBLE 390 def_bool y 391 depends on PPC_E500 && !PPC_E500MC 392 393config SPE 394 bool "SPE Support" 395 depends on SPE_POSSIBLE 396 default y 397 help 398 This option enables kernel support for the Signal Processing 399 Extensions (SPE) to the PowerPC processor. The kernel currently 400 supports saving and restoring SPE registers, and turning on the 401 'spe enable' bit so user processes can execute SPE instructions. 402 403 This option is only useful if you have a processor that supports 404 SPE (e500, otherwise known as 85xx series), but does not have any 405 effect on a non-spe cpu (it does, however add code to the kernel). 406 407 If in doubt, say Y here. 408 409config PPC_64S_HASH_MMU 410 bool "Hash MMU Support" 411 depends on PPC_BOOK3S_64 412 default y 413 help 414 Enable support for the Power ISA Hash style MMU. This is implemented 415 by all IBM Power and other 64-bit Book3S CPUs before ISA v3.0. The 416 OpenPOWER ISA does not mandate the hash MMU and some CPUs do not 417 implement it (e.g., Microwatt). 418 419 Note that POWER9 PowerVM platforms only support the hash 420 MMU. From POWER10 radix is also supported by PowerVM. 421 422 If you're unsure, say Y. 423 424config PPC_RADIX_MMU 425 bool "Radix MMU Support" 426 depends on PPC_BOOK3S_64 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_RADIX_BROADCAST_TLBIE 448 bool 449 depends on PPC_RADIX_MMU 450 help 451 Power ISA v3.0 and later implementations in the Linux Compliancy Subset 452 and lower are not required to implement broadcast TLBIE instructions. 453 Platforms with CPUs that do implement TLBIE broadcast, that is, where 454 a TLB invalidation instruction performed on one CPU operates on the 455 TLBs of all CPUs in the system, should select this option. If this 456 option is selected, the disable_tlbie kernel command line option can 457 be used to cause global TLB invalidations to be done via IPIs; without 458 it, IPIs will be used unconditionally. 459 460config PPC_KERNEL_PREFIXED 461 depends on PPC_HAVE_PREFIXED_SUPPORT 462 depends on CC_HAS_PREFIXED 463 default n 464 bool "Build Kernel with Prefixed Instructions" 465 help 466 POWER10 and later CPUs support prefixed instructions, 8 byte 467 instructions that include large immediate, pc relative addressing, 468 and various floating point, vector, MMA. 469 470 This option builds the kernel with prefixed instructions, and 471 allows a pc relative addressing option to be selected. 472 473 Kernel support for prefixed instructions in applications and guests 474 is not affected by this option. 475 476config PPC_KERNEL_PCREL 477 depends on PPC_HAVE_PCREL_SUPPORT 478 depends on PPC_HAVE_PREFIXED_SUPPORT 479 depends on CC_HAS_PCREL 480 default n 481 select PPC_KERNEL_PREFIXED 482 bool "Build Kernel with PC-Relative addressing model" 483 help 484 POWER10 and later CPUs support pc relative addressing. Recent 485 compilers have support for an ELF ABI extension for a pc relative 486 ABI. 487 488 This option builds the kernel with the pc relative ABI model. 489 490config PPC_KUEP 491 bool "Kernel Userspace Execution Prevention" 492 default y 493 help 494 Enable support for Kernel Userspace Execution Prevention (KUEP) 495 496 If you're unsure, say Y. 497 498config PPC_KUAP 499 bool "Kernel Userspace Access Protection" 500 default y 501 help 502 Enable support for Kernel Userspace Access Protection (KUAP) 503 504 If you're unsure, say Y. 505 506config PPC_KUAP_DEBUG 507 bool "Extra debugging for Kernel Userspace Access Protection" 508 depends on PPC_KUAP 509 help 510 Add extra debugging for Kernel Userspace Access Protection (KUAP) 511 If you're unsure, say N. 512 513config PPC_PKEY 514 def_bool y 515 depends on PPC_BOOK3S_64 516 depends on PPC_MEM_KEYS || PPC_KUAP || PPC_KUEP 517 518 519config PPC_MMU_NOHASH 520 def_bool y 521 depends on !PPC_BOOK3S 522 523config PPC_HAVE_PMU_SUPPORT 524 bool 525 526config PPC_HAVE_PREFIXED_SUPPORT 527 bool 528 529config PPC_HAVE_PCREL_SUPPORT 530 bool 531 532config PMU_SYSFS 533 bool "Create PMU SPRs sysfs file" 534 default n 535 help 536 This option enables sysfs file creation for PMU SPRs like MMCR* and PMC*. 537 538config PPC_PERF_CTRS 539 def_bool y 540 depends on PERF_EVENTS && PPC_HAVE_PMU_SUPPORT 541 help 542 This enables the powerpc-specific perf_event back-end. 543 544config FORCE_SMP 545 # Allow platforms to force SMP=y by selecting this 546 bool 547 select SMP 548 549config SMP 550 depends on PPC_BOOK3S || PPC_E500 || PPC_47x 551 select GENERIC_IRQ_MIGRATION 552 bool "Symmetric multi-processing support" if !FORCE_SMP 553 help 554 This enables support for systems with more than one CPU. If you have 555 a system with only one CPU, say N. If you have a system with more 556 than one CPU, say Y. Note that the kernel does not currently 557 support SMP machines with 603/603e/603ev or PPC750 ("G3") processors 558 since they have inadequate hardware support for multiprocessor 559 operation. 560 561 If you say N here, the kernel will run on single and multiprocessor 562 machines, but will use only one CPU of a multiprocessor machine. If 563 you say Y here, the kernel will run on single-processor machines. 564 On a single-processor machine, the kernel will run faster if you say 565 N here. 566 567 If you don't know what to do here, say N. 568 569config NR_CPUS 570 int "Maximum number of CPUs (2-8192)" if SMP 571 range 2 8192 if SMP 572 default "1" if !SMP 573 default "32" if PPC64 574 default "4" 575 576config NOT_COHERENT_CACHE 577 bool 578 depends on 44x || PPC_8xx || PPC_MPC512x || \ 579 GAMECUBE_COMMON || AMIGAONE 580 select ARCH_HAS_DMA_PREP_COHERENT 581 select ARCH_HAS_SYNC_DMA_FOR_DEVICE 582 select ARCH_HAS_SYNC_DMA_FOR_CPU 583 select DMA_DIRECT_REMAP 584 default n if PPC_47x 585 default y 586 587config CHECK_CACHE_COHERENCY 588 bool 589 590config PPC_DOORBELL 591 bool 592 593endmenu 594 595config VDSO32 596 def_bool y 597 depends on PPC32 || COMPAT 598 help 599 This symbol controls whether we build the 32-bit VDSO. We obviously 600 want to do that if we're building a 32-bit kernel. If we're building 601 a 64-bit kernel then we only want a 32-bit VDSO if we're also enabling 602 COMPAT. 603 604choice 605 prompt "Endianness selection" 606 default CPU_BIG_ENDIAN 607 help 608 This option selects whether a big endian or little endian kernel will 609 be built. 610 611config CPU_BIG_ENDIAN 612 bool "Build big endian kernel" 613 help 614 Build a big endian kernel. 615 616 If unsure, select this option. 617 618config CPU_LITTLE_ENDIAN 619 bool "Build little endian kernel" 620 depends on PPC_BOOK3S_64 621 select PPC64_BOOT_WRAPPER 622 help 623 Build a little endian kernel. 624 625 Note that if cross compiling a little endian kernel, 626 CROSS_COMPILE must point to a toolchain capable of targeting 627 little endian powerpc. 628 629endchoice 630 631config PPC64_ELF_ABI_V1 632 def_bool PPC64 && (CPU_BIG_ENDIAN && !PPC64_BIG_ENDIAN_ELF_ABI_V2) 633 634config PPC64_ELF_ABI_V2 635 def_bool PPC64 && !PPC64_ELF_ABI_V1 636 637config PPC64_BOOT_WRAPPER 638 def_bool n 639 depends on CPU_LITTLE_ENDIAN 640