Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc: Probe PMU type and record in sparc_pmu_type.

Signed-off-by: David S. Miller <davem@davemloft.net>

+25 -11
+22 -11
arch/sparc/kernel/cpu.c
··· 26 26 struct cpu_info { 27 27 int psr_vers; 28 28 const char *name; 29 + const char *pmu_name; 29 30 }; 30 31 31 32 struct fpu_info { ··· 45 44 46 45 #define CPU(ver, _name) \ 47 46 { .psr_vers = ver, .name = _name } 47 + 48 + #define CPU_PMU(ver, _name, _pmu_name) \ 49 + { .psr_vers = ver, .name = _name, .pmu_name = _pmu_name } 48 50 49 51 #define FPU(ver, _name) \ 50 52 { .fp_vers = ver, .name = _name } ··· 187 183 },{ 188 184 0x17, 189 185 .cpu_info = { 190 - CPU(0x10, "TI UltraSparc I (SpitFire)"), 191 - CPU(0x11, "TI UltraSparc II (BlackBird)"), 192 - CPU(0x12, "TI UltraSparc IIi (Sabre)"), 193 - CPU(0x13, "TI UltraSparc IIe (Hummingbird)"), 186 + CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"), 187 + CPU_PMU(0x11, "TI UltraSparc II (BlackBird)", "ultra12"), 188 + CPU_PMU(0x12, "TI UltraSparc IIi (Sabre)", "ultra12"), 189 + CPU_PMU(0x13, "TI UltraSparc IIe (Hummingbird)", "ultra12"), 194 190 CPU(-1, NULL) 195 191 }, 196 192 .fpu_info = { ··· 203 199 },{ 204 200 0x22, 205 201 .cpu_info = { 206 - CPU(0x10, "TI UltraSparc I (SpitFire)"), 202 + CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"), 207 203 CPU(-1, NULL) 208 204 }, 209 205 .fpu_info = { ··· 213 209 },{ 214 210 0x3e, 215 211 .cpu_info = { 216 - CPU(0x14, "TI UltraSparc III (Cheetah)"), 217 - CPU(0x15, "TI UltraSparc III+ (Cheetah+)"), 218 - CPU(0x16, "TI UltraSparc IIIi (Jalapeno)"), 219 - CPU(0x18, "TI UltraSparc IV (Jaguar)"), 220 - CPU(0x19, "TI UltraSparc IV+ (Panther)"), 221 - CPU(0x22, "TI UltraSparc IIIi+ (Serrano)"), 212 + CPU_PMU(0x14, "TI UltraSparc III (Cheetah)", "ultra3"), 213 + CPU_PMU(0x15, "TI UltraSparc III+ (Cheetah+)", "ultra3+"), 214 + CPU_PMU(0x16, "TI UltraSparc IIIi (Jalapeno)", "ultra3i"), 215 + CPU_PMU(0x18, "TI UltraSparc IV (Jaguar)", "ultra3+"), 216 + CPU_PMU(0x19, "TI UltraSparc IV+ (Panther)", "ultra4+"), 217 + CPU_PMU(0x22, "TI UltraSparc IIIi+ (Serrano)", "ultra3i"), 222 218 CPU(-1, NULL) 223 219 }, 224 220 .fpu_info = { ··· 238 234 239 235 const char *sparc_cpu_type; 240 236 const char *sparc_fpu_type; 237 + const char *sparc_pmu_type; 241 238 242 239 unsigned int fsr_storage; 243 240 ··· 249 244 250 245 sparc_cpu_type = NULL; 251 246 sparc_fpu_type = NULL; 247 + sparc_pmu_type = NULL; 252 248 manuf = NULL; 253 249 254 250 for (i = 0; i < ARRAY_SIZE(manufacturer_info); i++) ··· 269 263 { 270 264 if (cpu->psr_vers == psr_vers) { 271 265 sparc_cpu_type = cpu->name; 266 + sparc_pmu_type = cpu->pmu_name; 272 267 sparc_fpu_type = "No FPU"; 273 268 break; 274 269 } ··· 297 290 psr_impl, fpu_vers); 298 291 sparc_fpu_type = "Unknown FPU"; 299 292 } 293 + if (sparc_pmu_type == NULL) 294 + sparc_pmu_type = "Unknown PMU"; 300 295 } 301 296 302 297 #ifdef CONFIG_SPARC32 ··· 324 315 case SUN4V_CHIP_NIAGARA1: 325 316 sparc_cpu_type = "UltraSparc T1 (Niagara)"; 326 317 sparc_fpu_type = "UltraSparc T1 integrated FPU"; 318 + sparc_pmu_type = "niagara"; 327 319 break; 328 320 329 321 case SUN4V_CHIP_NIAGARA2: 330 322 sparc_cpu_type = "UltraSparc T2 (Niagara2)"; 331 323 sparc_fpu_type = "UltraSparc T2 integrated FPU"; 324 + sparc_pmu_type = "niagara2"; 332 325 break; 333 326 334 327 default:
+1
arch/sparc/kernel/kernel.h
··· 5 5 6 6 /* cpu.c */ 7 7 extern const char *sparc_cpu_type; 8 + extern const char *sparc_pmu_type; 8 9 extern const char *sparc_fpu_type; 9 10 10 11 extern unsigned int fsr_storage;
+2
arch/sparc/kernel/setup_64.c
··· 354 354 seq_printf(m, 355 355 "cpu\t\t: %s\n" 356 356 "fpu\t\t: %s\n" 357 + "pmu\t\t: %s\n" 357 358 "prom\t\t: %s\n" 358 359 "type\t\t: %s\n" 359 360 "ncpus probed\t: %d\n" ··· 367 366 , 368 367 sparc_cpu_type, 369 368 sparc_fpu_type, 369 + sparc_pmu_type, 370 370 prom_version, 371 371 ((tlb_type == hypervisor) ? 372 372 "sun4v" :