diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-11-20 15:19:38 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-11-20 15:19:38 -0500 |
| commit | 82b5df7bf27ca6cf642499bc3bcae1c93b9ac4ba (patch) | |
| tree | 2534270745a4f4998eb099dd540780806250a4d7 /arch/arm/kernel | |
| parent | e38eb34aab13a81b91400c75c703252473100bc4 (diff) | |
| parent | b4b8f770eb10a1bccaf8aa0ec1956e2dd7ed1e0a (diff) | |
Merge branch 'bl-cpuinfo' of git://linux-arm.org/linux-2.6-lp into devel-stable
Diffstat (limited to 'arch/arm/kernel')
| -rw-r--r-- | arch/arm/kernel/setup.c | 70 | ||||
| -rw-r--r-- | arch/arm/kernel/smp.c | 1 |
2 files changed, 36 insertions, 35 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index d15f1c503f3..f739fb1d217 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
| @@ -843,12 +843,9 @@ static const char *hwcap_str[] = { | |||
| 843 | 843 | ||
| 844 | static int c_show(struct seq_file *m, void *v) | 844 | static int c_show(struct seq_file *m, void *v) |
| 845 | { | 845 | { |
| 846 | int i; | 846 | int i, j; |
| 847 | 847 | u32 cpuid; | |
| 848 | seq_printf(m, "Processor\t: %s rev %d (%s)\n", | ||
| 849 | cpu_name, read_cpuid_id() & 15, elf_platform); | ||
| 850 | 848 | ||
| 851 | #if defined(CONFIG_SMP) | ||
| 852 | for_each_online_cpu(i) { | 849 | for_each_online_cpu(i) { |
| 853 | /* | 850 | /* |
| 854 | * glibc reads /proc/cpuinfo to determine the number of | 851 | * glibc reads /proc/cpuinfo to determine the number of |
| @@ -856,45 +853,48 @@ static int c_show(struct seq_file *m, void *v) | |||
| 856 | * "processor". Give glibc what it expects. | 853 | * "processor". Give glibc what it expects. |
| 857 | */ | 854 | */ |
| 858 | seq_printf(m, "processor\t: %d\n", i); | 855 | seq_printf(m, "processor\t: %d\n", i); |
| 859 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n", | 856 | cpuid = is_smp() ? per_cpu(cpu_data, i).cpuid : read_cpuid_id(); |
| 857 | seq_printf(m, "model name\t: %s rev %d (%s)\n", | ||
| 858 | cpu_name, cpuid & 15, elf_platform); | ||
| 859 | |||
| 860 | #if defined(CONFIG_SMP) | ||
| 861 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", | ||
| 860 | per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), | 862 | per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), |
| 861 | (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); | 863 | (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); |
| 862 | } | 864 | #else |
| 863 | #else /* CONFIG_SMP */ | 865 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", |
| 864 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", | 866 | loops_per_jiffy / (500000/HZ), |
| 865 | loops_per_jiffy / (500000/HZ), | 867 | (loops_per_jiffy / (5000/HZ)) % 100); |
| 866 | (loops_per_jiffy / (5000/HZ)) % 100); | ||
| 867 | #endif | 868 | #endif |
| 869 | /* dump out the processor features */ | ||
| 870 | seq_puts(m, "Features\t: "); | ||
| 868 | 871 | ||
| 869 | /* dump out the processor features */ | 872 | for (j = 0; hwcap_str[j]; j++) |
| 870 | seq_puts(m, "Features\t: "); | 873 | if (elf_hwcap & (1 << j)) |
| 871 | 874 | seq_printf(m, "%s ", hwcap_str[j]); | |
| 872 | for (i = 0; hwcap_str[i]; i++) | ||
| 873 | if (elf_hwcap & (1 << i)) | ||
| 874 | seq_printf(m, "%s ", hwcap_str[i]); | ||
| 875 | 875 | ||
| 876 | seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24); | 876 | seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24); |
| 877 | seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]); | 877 | seq_printf(m, "CPU architecture: %s\n", |
| 878 | proc_arch[cpu_architecture()]); | ||
| 878 | 879 | ||
| 879 | if ((read_cpuid_id() & 0x0008f000) == 0x00000000) { | 880 | if ((cpuid & 0x0008f000) == 0x00000000) { |
| 880 | /* pre-ARM7 */ | 881 | /* pre-ARM7 */ |
| 881 | seq_printf(m, "CPU part\t: %07x\n", read_cpuid_id() >> 4); | 882 | seq_printf(m, "CPU part\t: %07x\n", cpuid >> 4); |
| 882 | } else { | ||
| 883 | if ((read_cpuid_id() & 0x0008f000) == 0x00007000) { | ||
| 884 | /* ARM7 */ | ||
| 885 | seq_printf(m, "CPU variant\t: 0x%02x\n", | ||
| 886 | (read_cpuid_id() >> 16) & 127); | ||
| 887 | } else { | 883 | } else { |
| 888 | /* post-ARM7 */ | 884 | if ((cpuid & 0x0008f000) == 0x00007000) { |
| 889 | seq_printf(m, "CPU variant\t: 0x%x\n", | 885 | /* ARM7 */ |
| 890 | (read_cpuid_id() >> 20) & 15); | 886 | seq_printf(m, "CPU variant\t: 0x%02x\n", |
| 887 | (cpuid >> 16) & 127); | ||
| 888 | } else { | ||
| 889 | /* post-ARM7 */ | ||
| 890 | seq_printf(m, "CPU variant\t: 0x%x\n", | ||
| 891 | (cpuid >> 20) & 15); | ||
| 892 | } | ||
| 893 | seq_printf(m, "CPU part\t: 0x%03x\n", | ||
| 894 | (cpuid >> 4) & 0xfff); | ||
| 891 | } | 895 | } |
| 892 | seq_printf(m, "CPU part\t: 0x%03x\n", | 896 | seq_printf(m, "CPU revision\t: %d\n\n", cpuid & 15); |
| 893 | (read_cpuid_id() >> 4) & 0xfff); | ||
| 894 | } | 897 | } |
| 895 | seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15); | ||
| 896 | |||
| 897 | seq_puts(m, "\n"); | ||
| 898 | 898 | ||
| 899 | seq_printf(m, "Hardware\t: %s\n", machine_name); | 899 | seq_printf(m, "Hardware\t: %s\n", machine_name); |
| 900 | seq_printf(m, "Revision\t: %04x\n", system_rev); | 900 | seq_printf(m, "Revision\t: %04x\n", system_rev); |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index fbc8b2623d8..7eacd84cdc9 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
| @@ -281,6 +281,7 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid) | |||
| 281 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); | 281 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); |
| 282 | 282 | ||
| 283 | cpu_info->loops_per_jiffy = loops_per_jiffy; | 283 | cpu_info->loops_per_jiffy = loops_per_jiffy; |
| 284 | cpu_info->cpuid = read_cpuid_id(); | ||
| 284 | 285 | ||
| 285 | store_cpu_topology(cpuid); | 286 | store_cpu_topology(cpuid); |
| 286 | } | 287 | } |
