Merge tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[cascardo/linux.git] / arch / arm / kernel / setup.c
index 2c4bea3..da2f6c3 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/screen_info.h>
-#include <linux/of_iommu.h>
 #include <linux/of_platform.h>
 #include <linux/init.h>
 #include <linux/kexec.h>
@@ -844,7 +843,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
        struct resource *res;
 
        kernel_code.start   = virt_to_phys(_text);
-       kernel_code.end     = virt_to_phys(_etext - 1);
+       kernel_code.end     = virt_to_phys(__init_begin - 1);
        kernel_data.start   = virt_to_phys(_sdata);
        kernel_data.end     = virt_to_phys(_end - 1);
 
@@ -883,7 +882,8 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
                request_resource(&ioport_resource, &lp2);
 }
 
-#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
+#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) || \
+    defined(CONFIG_EFI)
 struct screen_info screen_info = {
  .orig_video_lines     = 30,
  .orig_video_cols      = 80,
@@ -902,14 +902,9 @@ static int __init customize_machine(void)
         * machine from the device tree, if no callback is provided,
         * otherwise we would always need an init_machine callback.
         */
-       of_iommu_init();
        if (machine_desc->init_machine)
                machine_desc->init_machine();
-#ifdef CONFIG_OF
-       else
-               of_platform_populate(NULL, of_default_bus_match_table,
-                                       NULL, NULL);
-#endif
+
        return 0;
 }
 arch_initcall(customize_machine);
@@ -940,6 +935,12 @@ static int __init init_machine_late(void)
 late_initcall(init_machine_late);
 
 #ifdef CONFIG_KEXEC
+/*
+ * The crash region must be aligned to 128MB to avoid
+ * zImage relocating below the reserved region.
+ */
+#define CRASH_ALIGN    (128 << 20)
+
 static inline unsigned long long get_total_mem(void)
 {
        unsigned long total;
@@ -967,6 +968,26 @@ static void __init reserve_crashkernel(void)
        if (ret)
                return;
 
+       if (crash_base <= 0) {
+               unsigned long long crash_max = idmap_to_phys((u32)~0);
+               crash_base = memblock_find_in_range(CRASH_ALIGN, crash_max,
+                                                   crash_size, CRASH_ALIGN);
+               if (!crash_base) {
+                       pr_err("crashkernel reservation failed - No suitable area found.\n");
+                       return;
+               }
+       } else {
+               unsigned long long start;
+
+               start = memblock_find_in_range(crash_base,
+                                              crash_base + crash_size,
+                                              crash_size, SECTION_SIZE);
+               if (start != crash_base) {
+                       pr_err("crashkernel reservation failed - memory is in use.\n");
+                       return;
+               }
+       }
+
        ret = memblock_reserve(crash_base, crash_size);
        if (ret < 0) {
                pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n",
@@ -1037,6 +1058,7 @@ void __init setup_arch(char **cmdline_p)
        early_paging_init(mdesc);
 #endif
        setup_dma_zone(mdesc);
+       xen_early_init();
        efi_init();
        sanity_check_meminfo();
        arm_memblock_init(mdesc);
@@ -1053,7 +1075,6 @@ void __init setup_arch(char **cmdline_p)
 
        arm_dt_init_cpu_maps();
        psci_dt_init();
-       xen_early_init();
 #ifdef CONFIG_SMP
        if (is_smp()) {
                if (!mdesc->smp_init || !mdesc->smp_init()) {