Skip to content

Commit 82b5df7

Browse files
author
Russell King
committed
Merge branch 'bl-cpuinfo' of git://linux-arm.org/linux-2.6-lp into devel-stable
2 parents e38eb34 + b4b8f77 commit 82b5df7

3 files changed

Lines changed: 37 additions & 35 deletions

File tree

‎arch/arm/include/asm/cpu.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
struct cpuinfo_arm {
1717
struct cpu cpu;
18+
u32 cpuid;
1819
#ifdef CONFIG_SMP
1920
unsigned int loops_per_jiffy;
2021
#endif

‎arch/arm/kernel/setup.c‎

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -843,58 +843,58 @@ static const char *hwcap_str[] = {
843843

844844
static int c_show(struct seq_file *m, void *v)
845845
{
846-
int i;
847-
848-
seq_printf(m, "Processor\t: %s rev %d (%s)\n",
849-
cpu_name, read_cpuid_id() & 15, elf_platform);
846+
int i, j;
847+
u32 cpuid;
850848

851-
#if defined(CONFIG_SMP)
852849
for_each_online_cpu(i) {
853850
/*
854851
* glibc reads /proc/cpuinfo to determine the number of
855852
* online processors, looking for lines beginning with
856853
* "processor". Give glibc what it expects.
857854
*/
858855
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",
860862
per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
861863
(per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
862-
}
863-
#else /* CONFIG_SMP */
864-
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
865-
loops_per_jiffy / (500000/HZ),
866-
(loops_per_jiffy / (5000/HZ)) % 100);
864+
#else
865+
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
866+
loops_per_jiffy / (500000/HZ),
867+
(loops_per_jiffy / (5000/HZ)) % 100);
867868
#endif
869+
/* dump out the processor features */
870+
seq_puts(m, "Features\t: ");
868871

869-
/* dump out the processor features */
870-
seq_puts(m, "Features\t: ");
871-
872-
for (i = 0; hwcap_str[i]; i++)
873-
if (elf_hwcap & (1 << i))
874-
seq_printf(m, "%s ", hwcap_str[i]);
872+
for (j = 0; hwcap_str[j]; j++)
873+
if (elf_hwcap & (1 << j))
874+
seq_printf(m, "%s ", hwcap_str[j]);
875875

876-
seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
877-
seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
876+
seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24);
877+
seq_printf(m, "CPU architecture: %s\n",
878+
proc_arch[cpu_architecture()]);
878879

879-
if ((read_cpuid_id() & 0x0008f000) == 0x00000000) {
880-
/* pre-ARM7 */
881-
seq_printf(m, "CPU part\t: %07x\n", read_cpuid_id() >> 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);
880+
if ((cpuid & 0x0008f000) == 0x00000000) {
881+
/* pre-ARM7 */
882+
seq_printf(m, "CPU part\t: %07x\n", cpuid >> 4);
887883
} else {
888-
/* post-ARM7 */
889-
seq_printf(m, "CPU variant\t: 0x%x\n",
890-
(read_cpuid_id() >> 20) & 15);
884+
if ((cpuid & 0x0008f000) == 0x00007000) {
885+
/* ARM7 */
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);
891895
}
892-
seq_printf(m, "CPU part\t: 0x%03x\n",
893-
(read_cpuid_id() >> 4) & 0xfff);
896+
seq_printf(m, "CPU revision\t: %d\n\n", cpuid & 15);
894897
}
895-
seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
896-
897-
seq_puts(m, "\n");
898898

899899
seq_printf(m, "Hardware\t: %s\n", machine_name);
900900
seq_printf(m, "Revision\t: %04x\n", system_rev);

‎arch/arm/kernel/smp.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
281281
struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
282282

283283
cpu_info->loops_per_jiffy = loops_per_jiffy;
284+
cpu_info->cpuid = read_cpuid_id();
284285

285286
store_cpu_topology(cpuid);
286287
}

0 commit comments

Comments
 (0)