diff options
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 133 |
1 files changed, 116 insertions, 17 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c461f6d69074..5b85759e7972 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -74,14 +74,15 @@ | |||
74 | #include <asm/e820.h> | 74 | #include <asm/e820.h> |
75 | #include <asm/mpspec.h> | 75 | #include <asm/mpspec.h> |
76 | #include <asm/setup.h> | 76 | #include <asm/setup.h> |
77 | #include <asm/arch_hooks.h> | ||
78 | #include <asm/efi.h> | 77 | #include <asm/efi.h> |
78 | #include <asm/timer.h> | ||
79 | #include <asm/i8259.h> | ||
79 | #include <asm/sections.h> | 80 | #include <asm/sections.h> |
80 | #include <asm/dmi.h> | 81 | #include <asm/dmi.h> |
81 | #include <asm/io_apic.h> | 82 | #include <asm/io_apic.h> |
82 | #include <asm/ist.h> | 83 | #include <asm/ist.h> |
83 | #include <asm/vmi.h> | 84 | #include <asm/vmi.h> |
84 | #include <setup_arch.h> | 85 | #include <asm/setup_arch.h> |
85 | #include <asm/bios_ebda.h> | 86 | #include <asm/bios_ebda.h> |
86 | #include <asm/cacheflush.h> | 87 | #include <asm/cacheflush.h> |
87 | #include <asm/processor.h> | 88 | #include <asm/processor.h> |
@@ -89,7 +90,7 @@ | |||
89 | 90 | ||
90 | #include <asm/system.h> | 91 | #include <asm/system.h> |
91 | #include <asm/vsyscall.h> | 92 | #include <asm/vsyscall.h> |
92 | #include <asm/smp.h> | 93 | #include <asm/cpu.h> |
93 | #include <asm/desc.h> | 94 | #include <asm/desc.h> |
94 | #include <asm/dma.h> | 95 | #include <asm/dma.h> |
95 | #include <asm/iommu.h> | 96 | #include <asm/iommu.h> |
@@ -97,7 +98,6 @@ | |||
97 | #include <asm/mmu_context.h> | 98 | #include <asm/mmu_context.h> |
98 | #include <asm/proto.h> | 99 | #include <asm/proto.h> |
99 | 100 | ||
100 | #include <mach_apic.h> | ||
101 | #include <asm/paravirt.h> | 101 | #include <asm/paravirt.h> |
102 | #include <asm/hypervisor.h> | 102 | #include <asm/hypervisor.h> |
103 | 103 | ||
@@ -112,6 +112,20 @@ | |||
112 | #define ARCH_SETUP | 112 | #define ARCH_SETUP |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | unsigned int boot_cpu_id __read_mostly; | ||
116 | |||
117 | #ifdef CONFIG_X86_64 | ||
118 | int default_cpu_present_to_apicid(int mps_cpu) | ||
119 | { | ||
120 | return __default_cpu_present_to_apicid(mps_cpu); | ||
121 | } | ||
122 | |||
123 | int default_check_phys_apicid_present(int boot_cpu_physical_apicid) | ||
124 | { | ||
125 | return __default_check_phys_apicid_present(boot_cpu_physical_apicid); | ||
126 | } | ||
127 | #endif | ||
128 | |||
115 | #ifndef CONFIG_DEBUG_BOOT_PARAMS | 129 | #ifndef CONFIG_DEBUG_BOOT_PARAMS |
116 | struct boot_params __initdata boot_params; | 130 | struct boot_params __initdata boot_params; |
117 | #else | 131 | #else |
@@ -586,19 +600,18 @@ static int __init setup_elfcorehdr(char *arg) | |||
586 | early_param("elfcorehdr", setup_elfcorehdr); | 600 | early_param("elfcorehdr", setup_elfcorehdr); |
587 | #endif | 601 | #endif |
588 | 602 | ||
589 | static int __init default_update_genapic(void) | 603 | static int __init default_update_apic(void) |
590 | { | 604 | { |
591 | #ifdef CONFIG_X86_SMP | 605 | #ifdef CONFIG_SMP |
592 | # if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64) | 606 | if (!apic->wakeup_cpu) |
593 | genapic->wakeup_cpu = wakeup_secondary_cpu_via_init; | 607 | apic->wakeup_cpu = wakeup_secondary_cpu_via_init; |
594 | # endif | ||
595 | #endif | 608 | #endif |
596 | 609 | ||
597 | return 0; | 610 | return 0; |
598 | } | 611 | } |
599 | 612 | ||
600 | static struct x86_quirks default_x86_quirks __initdata = { | 613 | static struct x86_quirks default_x86_quirks __initdata = { |
601 | .update_genapic = default_update_genapic, | 614 | .update_apic = default_update_apic, |
602 | }; | 615 | }; |
603 | 616 | ||
604 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; | 617 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; |
@@ -656,7 +669,6 @@ void __init setup_arch(char **cmdline_p) | |||
656 | #ifdef CONFIG_X86_32 | 669 | #ifdef CONFIG_X86_32 |
657 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); | 670 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); |
658 | visws_early_detect(); | 671 | visws_early_detect(); |
659 | pre_setup_arch_hook(); | ||
660 | #else | 672 | #else |
661 | printk(KERN_INFO "Command line: %s\n", boot_command_line); | 673 | printk(KERN_INFO "Command line: %s\n", boot_command_line); |
662 | #endif | 674 | #endif |
@@ -823,8 +835,7 @@ void __init setup_arch(char **cmdline_p) | |||
823 | #else | 835 | #else |
824 | num_physpages = max_pfn; | 836 | num_physpages = max_pfn; |
825 | 837 | ||
826 | if (cpu_has_x2apic) | 838 | check_x2apic(); |
827 | check_x2apic(); | ||
828 | 839 | ||
829 | /* How many end-of-memory variables you have, grandma! */ | 840 | /* How many end-of-memory variables you have, grandma! */ |
830 | /* need this before calling reserve_initrd */ | 841 | /* need this before calling reserve_initrd */ |
@@ -892,12 +903,11 @@ void __init setup_arch(char **cmdline_p) | |||
892 | */ | 903 | */ |
893 | acpi_reserve_bootmem(); | 904 | acpi_reserve_bootmem(); |
894 | #endif | 905 | #endif |
895 | #ifdef CONFIG_X86_FIND_SMP_CONFIG | ||
896 | /* | 906 | /* |
897 | * Find and reserve possible boot-time SMP configuration: | 907 | * Find and reserve possible boot-time SMP configuration: |
898 | */ | 908 | */ |
899 | find_smp_config(); | 909 | find_smp_config(); |
900 | #endif | 910 | |
901 | reserve_crashkernel(); | 911 | reserve_crashkernel(); |
902 | 912 | ||
903 | #ifdef CONFIG_X86_64 | 913 | #ifdef CONFIG_X86_64 |
@@ -924,9 +934,7 @@ void __init setup_arch(char **cmdline_p) | |||
924 | map_vsyscall(); | 934 | map_vsyscall(); |
925 | #endif | 935 | #endif |
926 | 936 | ||
927 | #ifdef CONFIG_X86_GENERICARCH | ||
928 | generic_apic_probe(); | 937 | generic_apic_probe(); |
929 | #endif | ||
930 | 938 | ||
931 | early_quirks(); | 939 | early_quirks(); |
932 | 940 | ||
@@ -977,4 +985,95 @@ void __init setup_arch(char **cmdline_p) | |||
977 | #endif | 985 | #endif |
978 | } | 986 | } |
979 | 987 | ||
988 | #ifdef CONFIG_X86_32 | ||
989 | |||
990 | /** | ||
991 | * x86_quirk_pre_intr_init - initialisation prior to setting up interrupt vectors | ||
992 | * | ||
993 | * Description: | ||
994 | * Perform any necessary interrupt initialisation prior to setting up | ||
995 | * the "ordinary" interrupt call gates. For legacy reasons, the ISA | ||
996 | * interrupts should be initialised here if the machine emulates a PC | ||
997 | * in any way. | ||
998 | **/ | ||
999 | void __init x86_quirk_pre_intr_init(void) | ||
1000 | { | ||
1001 | if (x86_quirks->arch_pre_intr_init) { | ||
1002 | if (x86_quirks->arch_pre_intr_init()) | ||
1003 | return; | ||
1004 | } | ||
1005 | init_ISA_irqs(); | ||
1006 | } | ||
1007 | |||
1008 | /** | ||
1009 | * x86_quirk_intr_init - post gate setup interrupt initialisation | ||
1010 | * | ||
1011 | * Description: | ||
1012 | * Fill in any interrupts that may have been left out by the general | ||
1013 | * init_IRQ() routine. interrupts having to do with the machine rather | ||
1014 | * than the devices on the I/O bus (like APIC interrupts in intel MP | ||
1015 | * systems) are started here. | ||
1016 | **/ | ||
1017 | void __init x86_quirk_intr_init(void) | ||
1018 | { | ||
1019 | if (x86_quirks->arch_intr_init) { | ||
1020 | if (x86_quirks->arch_intr_init()) | ||
1021 | return; | ||
1022 | } | ||
1023 | } | ||
1024 | |||
1025 | /** | ||
1026 | * x86_quirk_trap_init - initialise system specific traps | ||
1027 | * | ||
1028 | * Description: | ||
1029 | * Called as the final act of trap_init(). Used in VISWS to initialise | ||
1030 | * the various board specific APIC traps. | ||
1031 | **/ | ||
1032 | void __init x86_quirk_trap_init(void) | ||
1033 | { | ||
1034 | if (x86_quirks->arch_trap_init) { | ||
1035 | if (x86_quirks->arch_trap_init()) | ||
1036 | return; | ||
1037 | } | ||
1038 | } | ||
1039 | |||
1040 | static struct irqaction irq0 = { | ||
1041 | .handler = timer_interrupt, | ||
1042 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, | ||
1043 | .mask = CPU_MASK_NONE, | ||
1044 | .name = "timer" | ||
1045 | }; | ||
980 | 1046 | ||
1047 | /** | ||
1048 | * x86_quirk_pre_time_init - do any specific initialisations before. | ||
1049 | * | ||
1050 | **/ | ||
1051 | void __init x86_quirk_pre_time_init(void) | ||
1052 | { | ||
1053 | if (x86_quirks->arch_pre_time_init) | ||
1054 | x86_quirks->arch_pre_time_init(); | ||
1055 | } | ||
1056 | |||
1057 | /** | ||
1058 | * x86_quirk_time_init - do any specific initialisations for the system timer. | ||
1059 | * | ||
1060 | * Description: | ||
1061 | * Must plug the system timer interrupt source at HZ into the IRQ listed | ||
1062 | * in irq_vectors.h:TIMER_IRQ | ||
1063 | **/ | ||
1064 | void __init x86_quirk_time_init(void) | ||
1065 | { | ||
1066 | if (x86_quirks->arch_time_init) { | ||
1067 | /* | ||
1068 | * A nonzero return code does not mean failure, it means | ||
1069 | * that the architecture quirk does not want any | ||
1070 | * generic (timer) setup to be performed after this: | ||
1071 | */ | ||
1072 | if (x86_quirks->arch_time_init()) | ||
1073 | return; | ||
1074 | } | ||
1075 | |||
1076 | irq0.mask = cpumask_of_cpu(0); | ||
1077 | setup_irq(0, &irq0); | ||
1078 | } | ||
1079 | #endif /* CONFIG_X86_32 */ | ||