diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-29 09:03:59 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-31 05:09:40 -0400 |
commit | 47a3d5da70f411bc044ecd3c0593b158b09d0efa (patch) | |
tree | 30d5204e6d11cd81b20bc3fa582762cd4bdd3135 /arch | |
parent | dd0a70c8f921708eba29ef9f30dde1f14a74af05 (diff) |
x86: Add early platform detection
Platforms like Moorestown require early setup and want to avoid the
call to reserve_ebda_region. The x86_init override is too late when
the MRST detection happens in setup_arch. Move the default i386
x86_init overrides and the call to reserve_ebda_region into a separate
function which is called as the default of a switch case depending on
the hardware_subarch id in boot params. This allows us to add a case
for MRST and let MRST have its own early setup function.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/x86_init.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/head32.c | 22 | ||||
-rw-r--r-- | arch/x86/kernel/head64.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/x86_init.c | 1 |
4 files changed, 20 insertions, 9 deletions
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 20df51871713..b6c89428137d 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ASM_X86_PLATFORM_H | 2 | #define _ASM_X86_PLATFORM_H |
3 | 3 | ||
4 | #include <asm/pgtable_types.h> | 4 | #include <asm/pgtable_types.h> |
5 | #include <asm/bootparam.h> | ||
5 | 6 | ||
6 | struct mpc_bus; | 7 | struct mpc_bus; |
7 | struct mpc_cpu; | 8 | struct mpc_cpu; |
@@ -34,14 +35,12 @@ struct x86_init_mpparse { | |||
34 | * @probe_roms: probe BIOS roms | 35 | * @probe_roms: probe BIOS roms |
35 | * @reserve_resources: reserve the standard resources for the | 36 | * @reserve_resources: reserve the standard resources for the |
36 | * platform | 37 | * platform |
37 | * @reserve_ebda_region: reserve the extended bios data area | ||
38 | * @memory_setup: platform specific memory setup | 38 | * @memory_setup: platform specific memory setup |
39 | * | 39 | * |
40 | */ | 40 | */ |
41 | struct x86_init_resources { | 41 | struct x86_init_resources { |
42 | void (*probe_roms)(void); | 42 | void (*probe_roms)(void); |
43 | void (*reserve_resources)(void); | 43 | void (*reserve_resources)(void); |
44 | void (*reserve_ebda_region)(void); | ||
45 | char *(*memory_setup)(void); | 44 | char *(*memory_setup)(void); |
46 | }; | 45 | }; |
47 | 46 | ||
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index a21398fac4fa..441c075e2b80 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c | |||
@@ -15,6 +15,17 @@ | |||
15 | #include <asm/trampoline.h> | 15 | #include <asm/trampoline.h> |
16 | #include <asm/apic.h> | 16 | #include <asm/apic.h> |
17 | #include <asm/io_apic.h> | 17 | #include <asm/io_apic.h> |
18 | #include <asm/bios_ebda.h> | ||
19 | |||
20 | static void __init i386_default_early_setup(void) | ||
21 | { | ||
22 | /* Initilize 32bit specific setup functions */ | ||
23 | x86_init.resources.probe_roms = probe_roms; | ||
24 | x86_init.resources.reserve_resources = i386_reserve_resources; | ||
25 | x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc; | ||
26 | |||
27 | reserve_ebda_region(); | ||
28 | } | ||
18 | 29 | ||
19 | void __init i386_start_kernel(void) | 30 | void __init i386_start_kernel(void) |
20 | { | 31 | { |
@@ -31,12 +42,13 @@ void __init i386_start_kernel(void) | |||
31 | reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); | 42 | reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); |
32 | } | 43 | } |
33 | #endif | 44 | #endif |
34 | /* Initilize 32bit specific setup functions */ | ||
35 | x86_init.resources.probe_roms = probe_roms; | ||
36 | x86_init.resources.reserve_resources = i386_reserve_resources; | ||
37 | x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc; | ||
38 | 45 | ||
39 | x86_init.resources.reserve_ebda_region(); | 46 | /* Call the subarch specific early setup function */ |
47 | switch (boot_params.hdr.hardware_subarch) { | ||
48 | default: | ||
49 | i386_default_early_setup(); | ||
50 | break; | ||
51 | } | ||
40 | 52 | ||
41 | /* | 53 | /* |
42 | * At this point everything still needed from the boot loader | 54 | * At this point everything still needed from the boot loader |
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index cead8149c3de..0b06cd778fd9 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/kdebug.h> | 24 | #include <asm/kdebug.h> |
25 | #include <asm/e820.h> | 25 | #include <asm/e820.h> |
26 | #include <asm/trampoline.h> | 26 | #include <asm/trampoline.h> |
27 | #include <asm/bios_ebda.h> | ||
27 | 28 | ||
28 | static void __init zap_identity_mappings(void) | 29 | static void __init zap_identity_mappings(void) |
29 | { | 30 | { |
@@ -111,7 +112,7 @@ void __init x86_64_start_reservations(char *real_mode_data) | |||
111 | } | 112 | } |
112 | #endif | 113 | #endif |
113 | 114 | ||
114 | x86_init.resources.reserve_ebda_region(); | 115 | reserve_ebda_region(); |
115 | 116 | ||
116 | /* | 117 | /* |
117 | * At this point everything still needed from the boot loader | 118 | * At this point everything still needed from the boot loader |
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 13081b921914..24be7f397894 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c | |||
@@ -28,7 +28,6 @@ struct __initdata x86_init_ops x86_init = { | |||
28 | .resources = { | 28 | .resources = { |
29 | .probe_roms = x86_init_noop, | 29 | .probe_roms = x86_init_noop, |
30 | .reserve_resources = reserve_standard_io_resources, | 30 | .reserve_resources = reserve_standard_io_resources, |
31 | .reserve_ebda_region = reserve_ebda_region, | ||
32 | .memory_setup = default_machine_specific_memory_setup, | 31 | .memory_setup = default_machine_specific_memory_setup, |
33 | }, | 32 | }, |
34 | 33 | ||