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.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index ac7e08886863..375b13f7e780 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -114,6 +114,11 @@ EXPORT_SYMBOL(elf_hwcap2);
114 114
115#ifdef MULTI_CPU 115#ifdef MULTI_CPU
116struct processor processor __ro_after_init; 116struct processor processor __ro_after_init;
117#if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR)
118struct processor *cpu_vtable[NR_CPUS] = {
119 [0] = &processor,
120};
121#endif
117#endif 122#endif
118#ifdef MULTI_TLB 123#ifdef MULTI_TLB
119struct cpu_tlb_fns cpu_tlb __ro_after_init; 124struct cpu_tlb_fns cpu_tlb __ro_after_init;
@@ -666,28 +671,33 @@ static void __init smp_build_mpidr_hash(void)
666} 671}
667#endif 672#endif
668 673
669static void __init setup_processor(void) 674/*
675 * locate processor in the list of supported processor types. The linker
676 * builds this table for us from the entries in arch/arm/mm/proc-*.S
677 */
678struct proc_info_list *lookup_processor(u32 midr)
670{ 679{
671 struct proc_info_list *list; 680 struct proc_info_list *list = lookup_processor_type(midr);
672 681
673 /*
674 * locate processor in the list of supported processor
675 * types. The linker builds this table for us from the
676 * entries in arch/arm/mm/proc-*.S
677 */
678 list = lookup_processor_type(read_cpuid_id());
679 if (!list) { 682 if (!list) {
680 pr_err("CPU configuration botched (ID %08x), unable to continue.\n", 683 pr_err("CPU%u: configuration botched (ID %08x), CPU halted\n",
681 read_cpuid_id()); 684 smp_processor_id(), midr);
682 while (1); 685 while (1)
686 /* can't use cpu_relax() here as it may require MMU setup */;
683 } 687 }
684 688
689 return list;
690}
691
692static void __init setup_processor(void)
693{
694 unsigned int midr = read_cpuid_id();
695 struct proc_info_list *list = lookup_processor(midr);
696
685 cpu_name = list->cpu_name; 697 cpu_name = list->cpu_name;
686 __cpu_architecture = __get_cpu_architecture(); 698 __cpu_architecture = __get_cpu_architecture();
687 699
688#ifdef MULTI_CPU 700 init_proc_vtable(list->proc);
689 processor = *list->proc;
690#endif
691#ifdef MULTI_TLB 701#ifdef MULTI_TLB
692 cpu_tlb = *list->tlb; 702 cpu_tlb = *list->tlb;
693#endif 703#endif
@@ -699,7 +709,7 @@ static void __init setup_processor(void)
699#endif 709#endif
700 710
701 pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", 711 pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
702 cpu_name, read_cpuid_id(), read_cpuid_id() & 15, 712 list->cpu_name, midr, midr & 15,
703 proc_arch[cpu_architecture()], get_cr()); 713 proc_arch[cpu_architecture()], get_cr());
704 714
705 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c", 715 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",