]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/setup_64.c
x86: merge setup_memory_map with e820
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / setup_64.c
index 6dff1286ad8adec4b9fc6bb7808c3a233c476fd2..3220c7b56eb3f1eb9029abb8871a299d5629b50b 100644 (file)
@@ -56,6 +56,7 @@
 #include <asm/desc.h>
 #include <video/edid.h>
 #include <asm/e820.h>
+#include <asm/mpspec.h>
 #include <asm/dma.h>
 #include <asm/gart.h>
 #include <asm/mpspec.h>
@@ -243,7 +244,7 @@ static void __init reserve_crashkernel(void)
                        return;
                }
 
-               if (reserve_bootmem(crash_base, crash_size,
+               if (reserve_bootmem_generic(crash_base, crash_size,
                                        BOOTMEM_EXCLUSIVE) < 0) {
                        printk(KERN_INFO "crashkernel reservation failed - "
                                        "memory is in use\n");
@@ -265,34 +266,6 @@ static inline void __init reserve_crashkernel(void)
 {}
 #endif
 
-/* Overridden in paravirt.c if CONFIG_PARAVIRT */
-void __attribute__((weak)) __init memory_setup(void)
-{
-       machine_specific_memory_setup();
-}
-
-static void __init parse_setup_data(void)
-{
-       struct setup_data *data;
-       unsigned long pa_data;
-
-       if (boot_params.hdr.version < 0x0209)
-               return;
-       pa_data = boot_params.hdr.setup_data;
-       while (pa_data) {
-               data = early_ioremap(pa_data, PAGE_SIZE);
-               switch (data->type) {
-               default:
-                       break;
-               }
-#ifndef CONFIG_DEBUG_BOOT_PARAMS
-               free_early(pa_data, pa_data+sizeof(*data)+data->len);
-#endif
-               pa_data = data->next;
-               early_iounmap(data, PAGE_SIZE);
-       }
-}
-
 #ifdef CONFIG_PCI_MMCONFIG
 extern void __cpuinit fam10h_check_enable_mmcfg(void);
 extern void __init check_enable_amd_mmconf_dmi(void);
@@ -329,13 +302,15 @@ void __init setup_arch(char **cmdline_p)
 #endif
 #ifdef CONFIG_EFI
        if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
-                    "EL64", 4))
+                    "EL64", 4)) {
                efi_enabled = 1;
+               efi_reserve_early();
+       }
 #endif
 
        ARCH_SETUP
 
-       memory_setup();
+       setup_memory_map();
        copy_edd();
 
        if (!boot_params.hdr.root_flags)
@@ -381,9 +356,13 @@ void __init setup_arch(char **cmdline_p)
         * we are rounding upwards:
         */
        end_pfn = e820_end_of_ram();
+
+       /* pre allocte 4k for mptable mpc */
+       early_reserve_e820_mpc_new();
        /* update e820 for memory not covered by WB MTRRs */
        mtrr_bp_init();
        if (mtrr_trim_uncached_memory(end_pfn)) {
+               remove_all_active_ranges();
                e820_register_active_regions(0, 0, -1UL);
                end_pfn = e820_end_of_ram();
        }
@@ -392,7 +371,7 @@ void __init setup_arch(char **cmdline_p)
 
        check_efer();
 
-       max_pfn_mapped = init_memory_mapping(0, (max_pfn_mapped << PAGE_SHIFT));
+       max_pfn_mapped = init_memory_mapping(0, (end_pfn << PAGE_SHIFT));
        if (efi_enabled)
                efi_init();
 
@@ -453,13 +432,12 @@ void __init setup_arch(char **cmdline_p)
        acpi_reserve_bootmem();
 #endif
 
-       if (efi_enabled)
-               efi_reserve_bootmem();
-
+#ifdef CONFIG_X86_MPPARSE
        /*
        * Find and reserve possible boot-time SMP configuration:
        */
        find_smp_config();
+#endif
 #ifdef CONFIG_BLK_DEV_INITRD
        if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
                unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
@@ -502,11 +480,13 @@ void __init setup_arch(char **cmdline_p)
 
        init_cpu_to_node();
 
+#ifdef CONFIG_X86_MPPARSE
        /*
         * get boot-time SMP configuration:
         */
        if (smp_found_config)
                get_smp_config();
+#endif
        init_apic_mappings();
        ioapic_init_mappings();
 
@@ -516,7 +496,7 @@ void __init setup_arch(char **cmdline_p)
         * We trust e820 completely. No explicit ROM probing in memory.
         */
        e820_reserve_resources();
-       e820_mark_nosave_regions();
+       e820_mark_nosave_regions(end_pfn);
 
        /* request I/O space for devices used on all i[345]86 PCs */
        for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)