aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/kernel/setup.c')
-rw-r--r--arch/arm64/kernel/setup.c55
1 files changed, 38 insertions, 17 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index e8420f635bd4..51ef97274b52 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -50,7 +50,6 @@
50#include <asm/cpu.h> 50#include <asm/cpu.h>
51#include <asm/cputype.h> 51#include <asm/cputype.h>
52#include <asm/elf.h> 52#include <asm/elf.h>
53#include <asm/cputable.h>
54#include <asm/cpufeature.h> 53#include <asm/cpufeature.h>
55#include <asm/cpu_ops.h> 54#include <asm/cpu_ops.h>
56#include <asm/sections.h> 55#include <asm/sections.h>
@@ -62,9 +61,7 @@
62#include <asm/memblock.h> 61#include <asm/memblock.h>
63#include <asm/psci.h> 62#include <asm/psci.h>
64#include <asm/efi.h> 63#include <asm/efi.h>
65 64#include <asm/virt.h>
66unsigned int processor_id;
67EXPORT_SYMBOL(processor_id);
68 65
69unsigned long elf_hwcap __read_mostly; 66unsigned long elf_hwcap __read_mostly;
70EXPORT_SYMBOL_GPL(elf_hwcap); 67EXPORT_SYMBOL_GPL(elf_hwcap);
@@ -83,7 +80,6 @@ unsigned int compat_elf_hwcap2 __read_mostly;
83 80
84DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS); 81DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS);
85 82
86static const char *cpu_name;
87phys_addr_t __fdt_pointer __initdata; 83phys_addr_t __fdt_pointer __initdata;
88 84
89/* 85/*
@@ -119,6 +115,11 @@ void __init early_print(const char *str, ...)
119 printk("%s", buf); 115 printk("%s", buf);
120} 116}
121 117
118/*
119 * The recorded values of x0 .. x3 upon kernel entry.
120 */
121u64 __cacheline_aligned boot_args[4];
122
122void __init smp_setup_processor_id(void) 123void __init smp_setup_processor_id(void)
123{ 124{
124 u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; 125 u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
@@ -207,24 +208,38 @@ static void __init smp_build_mpidr_hash(void)
207} 208}
208#endif 209#endif
209 210
211static void __init hyp_mode_check(void)
212{
213 if (is_hyp_mode_available())
214 pr_info("CPU: All CPU(s) started at EL2\n");
215 else if (is_hyp_mode_mismatched())
216 WARN_TAINT(1, TAINT_CPU_OUT_OF_SPEC,
217 "CPU: CPUs started in inconsistent modes");
218 else
219 pr_info("CPU: All CPU(s) started at EL1\n");
220}
221
222void __init do_post_cpus_up_work(void)
223{
224 hyp_mode_check();
225 apply_alternatives_all();
226}
227
228#ifdef CONFIG_UP_LATE_INIT
229void __init up_late_init(void)
230{
231 do_post_cpus_up_work();
232}
233#endif /* CONFIG_UP_LATE_INIT */
234
210static void __init setup_processor(void) 235static void __init setup_processor(void)
211{ 236{
212 struct cpu_info *cpu_info;
213 u64 features, block; 237 u64 features, block;
214 u32 cwg; 238 u32 cwg;
215 int cls; 239 int cls;
216 240
217 cpu_info = lookup_processor_type(read_cpuid_id()); 241 printk("CPU: AArch64 Processor [%08x] revision %d\n",
218 if (!cpu_info) { 242 read_cpuid_id(), read_cpuid_id() & 15);
219 printk("CPU configuration botched (ID %08x), unable to continue.\n",
220 read_cpuid_id());
221 while (1);
222 }
223
224 cpu_name = cpu_info->cpu_name;
225
226 printk("CPU: %s [%08x] revision %d\n",
227 cpu_name, read_cpuid_id(), read_cpuid_id() & 15);
228 243
229 sprintf(init_utsname()->machine, ELF_PLATFORM); 244 sprintf(init_utsname()->machine, ELF_PLATFORM);
230 elf_hwcap = 0; 245 elf_hwcap = 0;
@@ -402,6 +417,12 @@ void __init setup_arch(char **cmdline_p)
402 conswitchp = &dummy_con; 417 conswitchp = &dummy_con;
403#endif 418#endif
404#endif 419#endif
420 if (boot_args[1] || boot_args[2] || boot_args[3]) {
421 pr_err("WARNING: x1-x3 nonzero in violation of boot protocol:\n"
422 "\tx1: %016llx\n\tx2: %016llx\n\tx3: %016llx\n"
423 "This indicates a broken bootloader or old kernel\n",
424 boot_args[1], boot_args[2], boot_args[3]);
425 }
405} 426}
406 427
407static int __init arm64_device_init(void) 428static int __init arm64_device_init(void)