diff options
Diffstat (limited to 'arch/arm64/kernel/setup.c')
-rw-r--r-- | arch/arm64/kernel/setup.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index f6f0ccf35ae6..edb146d01857 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
@@ -78,6 +78,7 @@ unsigned int compat_elf_hwcap2 __read_mostly; | |||
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | static const char *cpu_name; | 80 | static const char *cpu_name; |
81 | static const char *machine_name; | ||
81 | phys_addr_t __fdt_pointer __initdata; | 82 | phys_addr_t __fdt_pointer __initdata; |
82 | 83 | ||
83 | /* | 84 | /* |
@@ -309,6 +310,8 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys) | |||
309 | while (true) | 310 | while (true) |
310 | cpu_relax(); | 311 | cpu_relax(); |
311 | } | 312 | } |
313 | |||
314 | machine_name = of_flat_dt_get_machine_name(); | ||
312 | } | 315 | } |
313 | 316 | ||
314 | /* | 317 | /* |
@@ -447,21 +450,10 @@ static int c_show(struct seq_file *m, void *v) | |||
447 | { | 450 | { |
448 | int i; | 451 | int i; |
449 | 452 | ||
450 | /* | 453 | seq_printf(m, "Processor\t: %s rev %d (%s)\n", |
451 | * Dump out the common processor features in a single line. Userspace | 454 | cpu_name, read_cpuid_id() & 15, ELF_PLATFORM); |
452 | * should read the hwcaps with getauxval(AT_HWCAP) rather than | ||
453 | * attempting to parse this. | ||
454 | */ | ||
455 | seq_puts(m, "features\t:"); | ||
456 | for (i = 0; hwcap_str[i]; i++) | ||
457 | if (elf_hwcap & (1 << i)) | ||
458 | seq_printf(m, " %s", hwcap_str[i]); | ||
459 | seq_puts(m, "\n\n"); | ||
460 | 455 | ||
461 | for_each_online_cpu(i) { | 456 | for_each_online_cpu(i) { |
462 | struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i); | ||
463 | u32 midr = cpuinfo->reg_midr; | ||
464 | |||
465 | /* | 457 | /* |
466 | * glibc reads /proc/cpuinfo to determine the number of | 458 | * glibc reads /proc/cpuinfo to determine the number of |
467 | * online processors, looking for lines beginning with | 459 | * online processors, looking for lines beginning with |
@@ -470,13 +462,25 @@ static int c_show(struct seq_file *m, void *v) | |||
470 | #ifdef CONFIG_SMP | 462 | #ifdef CONFIG_SMP |
471 | seq_printf(m, "processor\t: %d\n", i); | 463 | seq_printf(m, "processor\t: %d\n", i); |
472 | #endif | 464 | #endif |
473 | seq_printf(m, "implementer\t: 0x%02x\n", | ||
474 | MIDR_IMPLEMENTOR(midr)); | ||
475 | seq_printf(m, "variant\t\t: 0x%x\n", MIDR_VARIANT(midr)); | ||
476 | seq_printf(m, "partnum\t\t: 0x%03x\n", MIDR_PARTNUM(midr)); | ||
477 | seq_printf(m, "revision\t: 0x%x\n\n", MIDR_REVISION(midr)); | ||
478 | } | 465 | } |
479 | 466 | ||
467 | /* dump out the processor features */ | ||
468 | seq_puts(m, "Features\t: "); | ||
469 | |||
470 | for (i = 0; hwcap_str[i]; i++) | ||
471 | if (elf_hwcap & (1 << i)) | ||
472 | seq_printf(m, "%s ", hwcap_str[i]); | ||
473 | |||
474 | seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24); | ||
475 | seq_printf(m, "CPU architecture: AArch64\n"); | ||
476 | seq_printf(m, "CPU variant\t: 0x%x\n", (read_cpuid_id() >> 20) & 15); | ||
477 | seq_printf(m, "CPU part\t: 0x%03x\n", (read_cpuid_id() >> 4) & 0xfff); | ||
478 | seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15); | ||
479 | |||
480 | seq_puts(m, "\n"); | ||
481 | |||
482 | seq_printf(m, "Hardware\t: %s\n", machine_name); | ||
483 | |||
480 | return 0; | 484 | return 0; |
481 | } | 485 | } |
482 | 486 | ||