aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c84
1 files changed, 46 insertions, 38 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index da1d1aa20ad9..9a89bf4aefe1 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -383,6 +383,12 @@ void cpu_init(void)
383 BUG(); 383 BUG();
384 } 384 }
385 385
386 /*
387 * This only works on resume and secondary cores. For booting on the
388 * boot cpu, smp_prepare_boot_cpu is called after percpu area setup.
389 */
390 set_my_cpu_offset(per_cpu_offset(cpu));
391
386 cpu_proc_init(); 392 cpu_proc_init();
387 393
388 /* 394 /*
@@ -426,13 +432,14 @@ int __cpu_logical_map[NR_CPUS];
426void __init smp_setup_processor_id(void) 432void __init smp_setup_processor_id(void)
427{ 433{
428 int i; 434 int i;
429 u32 cpu = is_smp() ? read_cpuid_mpidr() & 0xff : 0; 435 u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0;
436 u32 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
430 437
431 cpu_logical_map(0) = cpu; 438 cpu_logical_map(0) = cpu;
432 for (i = 1; i < NR_CPUS; ++i) 439 for (i = 1; i < nr_cpu_ids; ++i)
433 cpu_logical_map(i) = i == cpu ? 0 : i; 440 cpu_logical_map(i) = i == cpu ? 0 : i;
434 441
435 printk(KERN_INFO "Booting Linux on physical CPU %d\n", cpu); 442 printk(KERN_INFO "Booting Linux on physical CPU 0x%x\n", mpidr);
436} 443}
437 444
438static void __init setup_processor(void) 445static void __init setup_processor(void)
@@ -758,6 +765,7 @@ void __init setup_arch(char **cmdline_p)
758 765
759 unflatten_device_tree(); 766 unflatten_device_tree();
760 767
768 arm_dt_init_cpu_maps();
761#ifdef CONFIG_SMP 769#ifdef CONFIG_SMP
762 if (is_smp()) { 770 if (is_smp()) {
763 smp_set_ops(mdesc->smp); 771 smp_set_ops(mdesc->smp);
@@ -841,12 +849,9 @@ static const char *hwcap_str[] = {
841 849
842static int c_show(struct seq_file *m, void *v) 850static int c_show(struct seq_file *m, void *v)
843{ 851{
844 int i; 852 int i, j;
853 u32 cpuid;
845 854
846 seq_printf(m, "Processor\t: %s rev %d (%s)\n",
847 cpu_name, read_cpuid_id() & 15, elf_platform);
848
849#if defined(CONFIG_SMP)
850 for_each_online_cpu(i) { 855 for_each_online_cpu(i) {
851 /* 856 /*
852 * glibc reads /proc/cpuinfo to determine the number of 857 * glibc reads /proc/cpuinfo to determine the number of
@@ -854,45 +859,48 @@ static int c_show(struct seq_file *m, void *v)
854 * "processor". Give glibc what it expects. 859 * "processor". Give glibc what it expects.
855 */ 860 */
856 seq_printf(m, "processor\t: %d\n", i); 861 seq_printf(m, "processor\t: %d\n", i);
857 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n", 862 cpuid = is_smp() ? per_cpu(cpu_data, i).cpuid : read_cpuid_id();
863 seq_printf(m, "model name\t: %s rev %d (%s)\n",
864 cpu_name, cpuid & 15, elf_platform);
865
866#if defined(CONFIG_SMP)
867 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
858 per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), 868 per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
859 (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); 869 (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
860 } 870#else
861#else /* CONFIG_SMP */ 871 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
862 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", 872 loops_per_jiffy / (500000/HZ),
863 loops_per_jiffy / (500000/HZ), 873 (loops_per_jiffy / (5000/HZ)) % 100);
864 (loops_per_jiffy / (5000/HZ)) % 100);
865#endif 874#endif
875 /* dump out the processor features */
876 seq_puts(m, "Features\t: ");
866 877
867 /* dump out the processor features */ 878 for (j = 0; hwcap_str[j]; j++)
868 seq_puts(m, "Features\t: "); 879 if (elf_hwcap & (1 << j))
869 880 seq_printf(m, "%s ", hwcap_str[j]);
870 for (i = 0; hwcap_str[i]; i++)
871 if (elf_hwcap & (1 << i))
872 seq_printf(m, "%s ", hwcap_str[i]);
873 881
874 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24); 882 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24);
875 seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]); 883 seq_printf(m, "CPU architecture: %s\n",
884 proc_arch[cpu_architecture()]);
876 885
877 if ((read_cpuid_id() & 0x0008f000) == 0x00000000) { 886 if ((cpuid & 0x0008f000) == 0x00000000) {
878 /* pre-ARM7 */ 887 /* pre-ARM7 */
879 seq_printf(m, "CPU part\t: %07x\n", read_cpuid_id() >> 4); 888 seq_printf(m, "CPU part\t: %07x\n", cpuid >> 4);
880 } else {
881 if ((read_cpuid_id() & 0x0008f000) == 0x00007000) {
882 /* ARM7 */
883 seq_printf(m, "CPU variant\t: 0x%02x\n",
884 (read_cpuid_id() >> 16) & 127);
885 } else { 889 } else {
886 /* post-ARM7 */ 890 if ((cpuid & 0x0008f000) == 0x00007000) {
887 seq_printf(m, "CPU variant\t: 0x%x\n", 891 /* ARM7 */
888 (read_cpuid_id() >> 20) & 15); 892 seq_printf(m, "CPU variant\t: 0x%02x\n",
893 (cpuid >> 16) & 127);
894 } else {
895 /* post-ARM7 */
896 seq_printf(m, "CPU variant\t: 0x%x\n",
897 (cpuid >> 20) & 15);
898 }
899 seq_printf(m, "CPU part\t: 0x%03x\n",
900 (cpuid >> 4) & 0xfff);
889 } 901 }
890 seq_printf(m, "CPU part\t: 0x%03x\n", 902 seq_printf(m, "CPU revision\t: %d\n\n", cpuid & 15);
891 (read_cpuid_id() >> 4) & 0xfff);
892 } 903 }
893 seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
894
895 seq_puts(m, "\n");
896 904
897 seq_printf(m, "Hardware\t: %s\n", machine_name); 905 seq_printf(m, "Hardware\t: %s\n", machine_name);
898 seq_printf(m, "Revision\t: %04x\n", system_rev); 906 seq_printf(m, "Revision\t: %04x\n", system_rev);