]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/arm64/kernel/setup.c
Merge tag 'for-linus-4.2-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / arch / arm64 / kernel / setup.c
index 1b36ba9b73acaf340eed6f717523bd4a3ffc2006..f3067d4d4e35711680376372395667efdc45ad07 100644 (file)
@@ -106,18 +106,6 @@ static struct resource mem_res[] = {
 #define kernel_code mem_res[0]
 #define kernel_data mem_res[1]
 
-void __init early_print(const char *str, ...)
-{
-       char buf[256];
-       va_list ap;
-
-       va_start(ap, str);
-       vsnprintf(buf, sizeof(buf), str, ap);
-       va_end(ap);
-
-       printk("%s", buf);
-}
-
 /*
  * The recorded values of x0 .. x3 upon kernel entry.
  */
@@ -327,12 +315,14 @@ static void __init setup_processor(void)
 
 static void __init setup_machine_fdt(phys_addr_t dt_phys)
 {
-       if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys))) {
-               early_print("\n"
-                       "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n"
-                       "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
-                       "\nPlease check your bootloader.\n",
-                       dt_phys, phys_to_virt(dt_phys));
+       void *dt_virt = fixmap_remap_fdt(dt_phys);
+
+       if (!dt_virt || !early_init_dt_scan(dt_virt)) {
+               pr_crit("\n"
+                       "Error: invalid device tree blob at physical address %pa (virtual address 0x%p)\n"
+                       "The dtb must be 8-byte aligned and must not exceed 2 MB in size\n"
+                       "\nPlease check your bootloader.",
+                       &dt_phys, dt_virt);
 
                while (true)
                        cpu_relax();
@@ -375,8 +365,6 @@ void __init setup_arch(char **cmdline_p)
 {
        setup_processor();
 
-       setup_machine_fdt(__fdt_pointer);
-
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
        init_mm.end_data   = (unsigned long) _edata;
@@ -387,6 +375,8 @@ void __init setup_arch(char **cmdline_p)
        early_fixmap_init();
        early_ioremap_init();
 
+       setup_machine_fdt(__fdt_pointer);
+
        parse_early_param();
 
        /*
@@ -409,17 +399,14 @@ void __init setup_arch(char **cmdline_p)
        if (acpi_disabled) {
                unflatten_device_tree();
                psci_dt_init();
-               cpu_read_bootcpu_ops();
-#ifdef CONFIG_SMP
-               of_smp_init_cpus();
-#endif
        } else {
                psci_acpi_init();
-               acpi_init_cpus();
        }
        xen_early_init();
 
+       cpu_read_bootcpu_ops();
 #ifdef CONFIG_SMP
+       smp_init_cpus();
        smp_build_mpidr_hash();
 #endif