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