1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 3 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) 4 * 5 * Modifications for ppc64: 6 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com> 7 */ 8 9 /* NOTE: 10 * Unlike ppc32, ppc64 will only call cpu_setup() for the boot CPU, it's 11 * the responsibility of the appropriate CPU save/restore functions to 12 * eventually copy these settings over. Those save/restore aren't yet 13 * part of the cputable though. That has to be fixed for both ppc32 14 * and ppc64 15 */ 16 #define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \ 17 PPC_FEATURE_HAS_MMU | PPC_FEATURE_64) 18 #define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4) 19 #define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\ 20 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP) 21 #define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\ 22 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP) 23 #define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\ 24 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ 25 PPC_FEATURE_TRUE_LE | \ 26 PPC_FEATURE_PSERIES_PERFMON_COMPAT) 27 #define COMMON_USER_POWER7 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ 28 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ 29 PPC_FEATURE_TRUE_LE | \ 30 PPC_FEATURE_PSERIES_PERFMON_COMPAT) 31 #define COMMON_USER2_POWER7 (PPC_FEATURE2_DSCR) 32 #define COMMON_USER_POWER8 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ 33 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ 34 PPC_FEATURE_TRUE_LE | \ 35 PPC_FEATURE_PSERIES_PERFMON_COMPAT) 36 #define COMMON_USER2_POWER8 (PPC_FEATURE2_ARCH_2_07 | \ 37 PPC_FEATURE2_HTM_COMP | \ 38 PPC_FEATURE2_HTM_NOSC_COMP | \ 39 PPC_FEATURE2_DSCR | \ 40 PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \ 41 PPC_FEATURE2_VEC_CRYPTO) 42 #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ 43 PPC_FEATURE_TRUE_LE | \ 44 PPC_FEATURE_HAS_ALTIVEC_COMP) 45 #define COMMON_USER_POWER9 COMMON_USER_POWER8 46 #define COMMON_USER2_POWER9 (COMMON_USER2_POWER8 | \ 47 PPC_FEATURE2_ARCH_3_00 | \ 48 PPC_FEATURE2_HAS_IEEE128 | \ 49 PPC_FEATURE2_DARN | \ 50 PPC_FEATURE2_SCV) 51 #define COMMON_USER_POWER10 COMMON_USER_POWER9 52 #define COMMON_USER2_POWER10 (PPC_FEATURE2_ARCH_3_1 | \ 53 PPC_FEATURE2_MMA | \ 54 PPC_FEATURE2_ARCH_3_00 | \ 55 PPC_FEATURE2_HAS_IEEE128 | \ 56 PPC_FEATURE2_DARN | \ 57 PPC_FEATURE2_SCV | \ 58 PPC_FEATURE2_ARCH_2_07 | \ 59 PPC_FEATURE2_DSCR | \ 60 PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \ 61 PPC_FEATURE2_VEC_CRYPTO) 62 63 static struct cpu_spec cpu_specs[] __initdata = { 64 { /* PPC970 */ 65 .pvr_mask = 0xffff0000, 66 .pvr_value = 0x00390000, 67 .cpu_name = "PPC970", 68 .cpu_features = CPU_FTRS_PPC970, 69 .cpu_user_features = COMMON_USER_POWER4 | PPC_FEATURE_HAS_ALTIVEC_COMP, 70 .mmu_features = MMU_FTRS_PPC970, 71 .icache_bsize = 128, 72 .dcache_bsize = 128, 73 .num_pmcs = 8, 74 .pmc_type = PPC_PMC_IBM, 75 .cpu_setup = __setup_cpu_ppc970, 76 .cpu_restore = __restore_cpu_ppc970, 77 .platform = "ppc970", 78 }, 79 { /* PPC970FX */ 80 .pvr_mask = 0xffff0000, 81 .pvr_value = 0x003c0000, 82 .cpu_name = "PPC970FX", 83 .cpu_features = CPU_FTRS_PPC970, 84 .cpu_user_features = COMMON_USER_POWER4 | PPC_FEATURE_HAS_ALTIVEC_COMP, 85 .mmu_features = MMU_FTRS_PPC970, 86 .icache_bsize = 128, 87 .dcache_bsize = 128, 88 .num_pmcs = 8, 89 .pmc_type = PPC_PMC_IBM, 90 .cpu_setup = __setup_cpu_ppc970, 91 .cpu_restore = __restore_cpu_ppc970, 92 .platform = "ppc970", 93 }, 94 { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */ 95 .pvr_mask = 0xffffffff, 96 .pvr_value = 0x00440100, 97 .cpu_name = "PPC970MP", 98 .cpu_features = CPU_FTRS_PPC970, 99 .cpu_user_features = COMMON_USER_POWER4 | PPC_FEATURE_HAS_ALTIVEC_COMP, 100 .mmu_features = MMU_FTRS_PPC970, 101 .icache_bsize = 128, 102 .dcache_bsize = 128, 103 .num_pmcs = 8, 104 .pmc_type = PPC_PMC_IBM, 105 .cpu_setup = __setup_cpu_ppc970, 106 .cpu_restore = __restore_cpu_ppc970, 107 .platform = "ppc970", 108 }, 109 { /* PPC970MP */ 110 .pvr_mask = 0xffff0000, 111 .pvr_value = 0x00440000, 112 .cpu_name = "PPC970MP", 113 .cpu_features = CPU_FTRS_PPC970, 114 .cpu_user_features = COMMON_USER_POWER4 | PPC_FEATURE_HAS_ALTIVEC_COMP, 115 .mmu_features = MMU_FTRS_PPC970, 116 .icache_bsize = 128, 117 .dcache_bsize = 128, 118 .num_pmcs = 8, 119 .pmc_type = PPC_PMC_IBM, 120 .cpu_setup = __setup_cpu_ppc970MP, 121 .cpu_restore = __restore_cpu_ppc970, 122 .platform = "ppc970", 123 }, 124 { /* PPC970GX */ 125 .pvr_mask = 0xffff0000, 126 .pvr_value = 0x00450000, 127 .cpu_name = "PPC970GX", 128 .cpu_features = CPU_FTRS_PPC970, 129 .cpu_user_features = COMMON_USER_POWER4 | PPC_FEATURE_HAS_ALTIVEC_COMP, 130 .mmu_features = MMU_FTRS_PPC970, 131 .icache_bsize = 128, 132 .dcache_bsize = 128, 133 .num_pmcs = 8, 134 .pmc_type = PPC_PMC_IBM, 135 .cpu_setup = __setup_cpu_ppc970, 136 .platform = "ppc970", 137 }, 138 { /* Power5 GR */ 139 .pvr_mask = 0xffff0000, 140 .pvr_value = 0x003a0000, 141 .cpu_name = "POWER5 (gr)", 142 .cpu_features = CPU_FTRS_POWER5, 143 .cpu_user_features = COMMON_USER_POWER5, 144 .mmu_features = MMU_FTRS_POWER5, 145 .icache_bsize = 128, 146 .dcache_bsize = 128, 147 .num_pmcs = 6, 148 .pmc_type = PPC_PMC_IBM, 149 .platform = "power5", 150 }, 151 { /* Power5++ */ 152 .pvr_mask = 0xffffff00, 153 .pvr_value = 0x003b0300, 154 .cpu_name = "POWER5+ (gs)", 155 .cpu_features = CPU_FTRS_POWER5, 156 .cpu_user_features = COMMON_USER_POWER5_PLUS, 157 .mmu_features = MMU_FTRS_POWER5, 158 .icache_bsize = 128, 159 .dcache_bsize = 128, 160 .num_pmcs = 6, 161 .platform = "power5+", 162 }, 163 { /* Power5 GS */ 164 .pvr_mask = 0xffff0000, 165 .pvr_value = 0x003b0000, 166 .cpu_name = "POWER5+ (gs)", 167 .cpu_features = CPU_FTRS_POWER5, 168 .cpu_user_features = COMMON_USER_POWER5_PLUS, 169 .mmu_features = MMU_FTRS_POWER5, 170 .icache_bsize = 128, 171 .dcache_bsize = 128, 172 .num_pmcs = 6, 173 .pmc_type = PPC_PMC_IBM, 174 .platform = "power5+", 175 }, 176 { /* POWER6 in P5+ mode; 2.04-compliant processor */ 177 .pvr_mask = 0xffffffff, 178 .pvr_value = 0x0f000001, 179 .cpu_name = "POWER5+", 180 .cpu_features = CPU_FTRS_POWER5, 181 .cpu_user_features = COMMON_USER_POWER5_PLUS, 182 .mmu_features = MMU_FTRS_POWER5, 183 .icache_bsize = 128, 184 .dcache_bsize = 128, 185 .platform = "power5+", 186 }, 187 { /* Power6 */ 188 .pvr_mask = 0xffff0000, 189 .pvr_value = 0x003e0000, 190 .cpu_name = "POWER6 (raw)", 191 .cpu_features = CPU_FTRS_POWER6, 192 .cpu_user_features = COMMON_USER_POWER6 | PPC_FEATURE_POWER6_EXT, 193 .mmu_features = MMU_FTRS_POWER6, 194 .icache_bsize = 128, 195 .dcache_bsize = 128, 196 .num_pmcs = 6, 197 .pmc_type = PPC_PMC_IBM, 198 .platform = "power6x", 199 }, 200 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */ 201 .pvr_mask = 0xffffffff, 202 .pvr_value = 0x0f000002, 203 .cpu_name = "POWER6 (architected)", 204 .cpu_features = CPU_FTRS_POWER6, 205 .cpu_user_features = COMMON_USER_POWER6, 206 .mmu_features = MMU_FTRS_POWER6, 207 .icache_bsize = 128, 208 .dcache_bsize = 128, 209 .platform = "power6", 210 }, 211 { /* 2.06-compliant processor, i.e. Power7 "architected" mode */ 212 .pvr_mask = 0xffffffff, 213 .pvr_value = 0x0f000003, 214 .cpu_name = "POWER7 (architected)", 215 .cpu_features = CPU_FTRS_POWER7, 216 .cpu_user_features = COMMON_USER_POWER7, 217 .cpu_user_features2 = COMMON_USER2_POWER7, 218 .mmu_features = MMU_FTRS_POWER7, 219 .icache_bsize = 128, 220 .dcache_bsize = 128, 221 .cpu_setup = __setup_cpu_power7, 222 .cpu_restore = __restore_cpu_power7, 223 .machine_check_early = __machine_check_early_realmode_p7, 224 .platform = "power7", 225 }, 226 { /* 2.07-compliant processor, i.e. Power8 "architected" mode */ 227 .pvr_mask = 0xffffffff, 228 .pvr_value = 0x0f000004, 229 .cpu_name = "POWER8 (architected)", 230 .cpu_features = CPU_FTRS_POWER8, 231 .cpu_user_features = COMMON_USER_POWER8, 232 .cpu_user_features2 = COMMON_USER2_POWER8, 233 .mmu_features = MMU_FTRS_POWER8, 234 .icache_bsize = 128, 235 .dcache_bsize = 128, 236 .cpu_setup = __setup_cpu_power8, 237 .cpu_restore = __restore_cpu_power8, 238 .machine_check_early = __machine_check_early_realmode_p8, 239 .platform = "power8", 240 }, 241 { /* 2.07-compliant processor, HeXin C2000 processor */ 242 .pvr_mask = 0xffff0000, 243 .pvr_value = 0x00660000, 244 .cpu_name = "HX-C2000", 245 .cpu_features = CPU_FTRS_POWER8, 246 .cpu_user_features = COMMON_USER_POWER8, 247 .cpu_user_features2 = COMMON_USER2_POWER8, 248 .mmu_features = MMU_FTRS_POWER8, 249 .icache_bsize = 128, 250 .dcache_bsize = 128, 251 .cpu_setup = __setup_cpu_power8, 252 .cpu_restore = __restore_cpu_power8, 253 .machine_check_early = __machine_check_early_realmode_p8, 254 .platform = "power8", 255 }, 256 { /* 3.00-compliant processor, i.e. Power9 "architected" mode */ 257 .pvr_mask = 0xffffffff, 258 .pvr_value = 0x0f000005, 259 .cpu_name = "POWER9 (architected)", 260 .cpu_features = CPU_FTRS_POWER9, 261 .cpu_user_features = COMMON_USER_POWER9, 262 .cpu_user_features2 = COMMON_USER2_POWER9, 263 .mmu_features = MMU_FTRS_POWER9, 264 .icache_bsize = 128, 265 .dcache_bsize = 128, 266 .cpu_setup = __setup_cpu_power9, 267 .cpu_restore = __restore_cpu_power9, 268 .platform = "power9", 269 }, 270 { /* 3.1-compliant processor, i.e. Power10 "architected" mode */ 271 .pvr_mask = 0xffffffff, 272 .pvr_value = 0x0f000006, 273 .cpu_name = "POWER10 (architected)", 274 .cpu_features = CPU_FTRS_POWER10, 275 .cpu_user_features = COMMON_USER_POWER10, 276 .cpu_user_features2 = COMMON_USER2_POWER10, 277 .mmu_features = MMU_FTRS_POWER10, 278 .icache_bsize = 128, 279 .dcache_bsize = 128, 280 .cpu_setup = __setup_cpu_power10, 281 .cpu_restore = __restore_cpu_power10, 282 .platform = "power10", 283 }, 284 { /* Power7 */ 285 .pvr_mask = 0xffff0000, 286 .pvr_value = 0x003f0000, 287 .cpu_name = "POWER7 (raw)", 288 .cpu_features = CPU_FTRS_POWER7, 289 .cpu_user_features = COMMON_USER_POWER7, 290 .cpu_user_features2 = COMMON_USER2_POWER7, 291 .mmu_features = MMU_FTRS_POWER7, 292 .icache_bsize = 128, 293 .dcache_bsize = 128, 294 .num_pmcs = 6, 295 .pmc_type = PPC_PMC_IBM, 296 .cpu_setup = __setup_cpu_power7, 297 .cpu_restore = __restore_cpu_power7, 298 .machine_check_early = __machine_check_early_realmode_p7, 299 .platform = "power7", 300 }, 301 { /* Power7+ */ 302 .pvr_mask = 0xffff0000, 303 .pvr_value = 0x004A0000, 304 .cpu_name = "POWER7+ (raw)", 305 .cpu_features = CPU_FTRS_POWER7, 306 .cpu_user_features = COMMON_USER_POWER7, 307 .cpu_user_features2 = COMMON_USER2_POWER7, 308 .mmu_features = MMU_FTRS_POWER7, 309 .icache_bsize = 128, 310 .dcache_bsize = 128, 311 .num_pmcs = 6, 312 .pmc_type = PPC_PMC_IBM, 313 .cpu_setup = __setup_cpu_power7, 314 .cpu_restore = __restore_cpu_power7, 315 .machine_check_early = __machine_check_early_realmode_p7, 316 .platform = "power7+", 317 }, 318 { /* Power8E */ 319 .pvr_mask = 0xffff0000, 320 .pvr_value = 0x004b0000, 321 .cpu_name = "POWER8E (raw)", 322 .cpu_features = CPU_FTRS_POWER8E, 323 .cpu_user_features = COMMON_USER_POWER8, 324 .cpu_user_features2 = COMMON_USER2_POWER8, 325 .mmu_features = MMU_FTRS_POWER8, 326 .icache_bsize = 128, 327 .dcache_bsize = 128, 328 .num_pmcs = 6, 329 .pmc_type = PPC_PMC_IBM, 330 .cpu_setup = __setup_cpu_power8, 331 .cpu_restore = __restore_cpu_power8, 332 .machine_check_early = __machine_check_early_realmode_p8, 333 .platform = "power8", 334 }, 335 { /* Power8NVL */ 336 .pvr_mask = 0xffff0000, 337 .pvr_value = 0x004c0000, 338 .cpu_name = "POWER8NVL (raw)", 339 .cpu_features = CPU_FTRS_POWER8, 340 .cpu_user_features = COMMON_USER_POWER8, 341 .cpu_user_features2 = COMMON_USER2_POWER8, 342 .mmu_features = MMU_FTRS_POWER8, 343 .icache_bsize = 128, 344 .dcache_bsize = 128, 345 .num_pmcs = 6, 346 .pmc_type = PPC_PMC_IBM, 347 .cpu_setup = __setup_cpu_power8, 348 .cpu_restore = __restore_cpu_power8, 349 .machine_check_early = __machine_check_early_realmode_p8, 350 .platform = "power8", 351 }, 352 { /* Power8 */ 353 .pvr_mask = 0xffff0000, 354 .pvr_value = 0x004d0000, 355 .cpu_name = "POWER8 (raw)", 356 .cpu_features = CPU_FTRS_POWER8, 357 .cpu_user_features = COMMON_USER_POWER8, 358 .cpu_user_features2 = COMMON_USER2_POWER8, 359 .mmu_features = MMU_FTRS_POWER8, 360 .icache_bsize = 128, 361 .dcache_bsize = 128, 362 .num_pmcs = 6, 363 .pmc_type = PPC_PMC_IBM, 364 .cpu_setup = __setup_cpu_power8, 365 .cpu_restore = __restore_cpu_power8, 366 .machine_check_early = __machine_check_early_realmode_p8, 367 .platform = "power8", 368 }, 369 { /* Power9 DD2.0 */ 370 .pvr_mask = 0xffffefff, 371 .pvr_value = 0x004e0200, 372 .cpu_name = "POWER9 (raw)", 373 .cpu_features = CPU_FTRS_POWER9_DD2_0, 374 .cpu_user_features = COMMON_USER_POWER9, 375 .cpu_user_features2 = COMMON_USER2_POWER9, 376 .mmu_features = MMU_FTRS_POWER9, 377 .icache_bsize = 128, 378 .dcache_bsize = 128, 379 .num_pmcs = 6, 380 .pmc_type = PPC_PMC_IBM, 381 .cpu_setup = __setup_cpu_power9, 382 .cpu_restore = __restore_cpu_power9, 383 .machine_check_early = __machine_check_early_realmode_p9, 384 .platform = "power9", 385 }, 386 { /* Power9 DD 2.1 */ 387 .pvr_mask = 0xffffefff, 388 .pvr_value = 0x004e0201, 389 .cpu_name = "POWER9 (raw)", 390 .cpu_features = CPU_FTRS_POWER9_DD2_1, 391 .cpu_user_features = COMMON_USER_POWER9, 392 .cpu_user_features2 = COMMON_USER2_POWER9, 393 .mmu_features = MMU_FTRS_POWER9, 394 .icache_bsize = 128, 395 .dcache_bsize = 128, 396 .num_pmcs = 6, 397 .pmc_type = PPC_PMC_IBM, 398 .cpu_setup = __setup_cpu_power9, 399 .cpu_restore = __restore_cpu_power9, 400 .machine_check_early = __machine_check_early_realmode_p9, 401 .platform = "power9", 402 }, 403 { /* Power9 DD2.2 */ 404 .pvr_mask = 0xffffefff, 405 .pvr_value = 0x004e0202, 406 .cpu_name = "POWER9 (raw)", 407 .cpu_features = CPU_FTRS_POWER9_DD2_2, 408 .cpu_user_features = COMMON_USER_POWER9, 409 .cpu_user_features2 = COMMON_USER2_POWER9, 410 .mmu_features = MMU_FTRS_POWER9, 411 .icache_bsize = 128, 412 .dcache_bsize = 128, 413 .num_pmcs = 6, 414 .pmc_type = PPC_PMC_IBM, 415 .cpu_setup = __setup_cpu_power9, 416 .cpu_restore = __restore_cpu_power9, 417 .machine_check_early = __machine_check_early_realmode_p9, 418 .platform = "power9", 419 }, 420 { /* Power9 DD2.3 or later */ 421 .pvr_mask = 0xffff0000, 422 .pvr_value = 0x004e0000, 423 .cpu_name = "POWER9 (raw)", 424 .cpu_features = CPU_FTRS_POWER9_DD2_3, 425 .cpu_user_features = COMMON_USER_POWER9, 426 .cpu_user_features2 = COMMON_USER2_POWER9, 427 .mmu_features = MMU_FTRS_POWER9, 428 .icache_bsize = 128, 429 .dcache_bsize = 128, 430 .num_pmcs = 6, 431 .pmc_type = PPC_PMC_IBM, 432 .cpu_setup = __setup_cpu_power9, 433 .cpu_restore = __restore_cpu_power9, 434 .machine_check_early = __machine_check_early_realmode_p9, 435 .platform = "power9", 436 }, 437 { /* Power10 */ 438 .pvr_mask = 0xffff0000, 439 .pvr_value = 0x00800000, 440 .cpu_name = "POWER10 (raw)", 441 .cpu_features = CPU_FTRS_POWER10, 442 .cpu_user_features = COMMON_USER_POWER10, 443 .cpu_user_features2 = COMMON_USER2_POWER10, 444 .mmu_features = MMU_FTRS_POWER10, 445 .icache_bsize = 128, 446 .dcache_bsize = 128, 447 .num_pmcs = 6, 448 .pmc_type = PPC_PMC_IBM, 449 .cpu_setup = __setup_cpu_power10, 450 .cpu_restore = __restore_cpu_power10, 451 .machine_check_early = __machine_check_early_realmode_p10, 452 .platform = "power10", 453 }, 454 { /* Cell Broadband Engine */ 455 .pvr_mask = 0xffff0000, 456 .pvr_value = 0x00700000, 457 .cpu_name = "Cell Broadband Engine", 458 .cpu_features = CPU_FTRS_CELL, 459 .cpu_user_features = COMMON_USER_PPC64 | PPC_FEATURE_CELL | 460 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_SMT, 461 .mmu_features = MMU_FTRS_CELL, 462 .icache_bsize = 128, 463 .dcache_bsize = 128, 464 .num_pmcs = 4, 465 .pmc_type = PPC_PMC_IBM, 466 .platform = "ppc-cell-be", 467 }, 468 { /* PA Semi PA6T */ 469 .pvr_mask = 0x7fff0000, 470 .pvr_value = 0x00900000, 471 .cpu_name = "PA6T", 472 .cpu_features = CPU_FTRS_PA6T, 473 .cpu_user_features = COMMON_USER_PA6T, 474 .mmu_features = MMU_FTRS_PA6T, 475 .icache_bsize = 64, 476 .dcache_bsize = 64, 477 .num_pmcs = 6, 478 .pmc_type = PPC_PMC_PA6T, 479 .cpu_setup = __setup_cpu_pa6t, 480 .cpu_restore = __restore_cpu_pa6t, 481 .platform = "pa6t", 482 }, 483 { /* default match */ 484 .pvr_mask = 0x00000000, 485 .pvr_value = 0x00000000, 486 .cpu_name = "POWER5 (compatible)", 487 .cpu_features = CPU_FTRS_COMPATIBLE, 488 .cpu_user_features = COMMON_USER_PPC64, 489 .mmu_features = MMU_FTRS_POWER, 490 .icache_bsize = 128, 491 .dcache_bsize = 128, 492 .num_pmcs = 6, 493 .pmc_type = PPC_PMC_IBM, 494 .platform = "power5", 495 } 496 }; 497