diff options
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 138 |
1 files changed, 36 insertions, 102 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index d784ea207606..6c7886890fa6 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -67,6 +67,7 @@ | |||
67 | 67 | ||
68 | #include <linux/percpu.h> | 68 | #include <linux/percpu.h> |
69 | #include <linux/crash_dump.h> | 69 | #include <linux/crash_dump.h> |
70 | #include <linux/tboot.h> | ||
70 | 71 | ||
71 | #include <video/edid.h> | 72 | #include <video/edid.h> |
72 | 73 | ||
@@ -109,10 +110,6 @@ | |||
109 | #include <asm/numa_64.h> | 110 | #include <asm/numa_64.h> |
110 | #endif | 111 | #endif |
111 | 112 | ||
112 | #ifndef ARCH_SETUP | ||
113 | #define ARCH_SETUP | ||
114 | #endif | ||
115 | |||
116 | /* | 113 | /* |
117 | * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. | 114 | * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. |
118 | * The direct mapping extends to max_pfn_mapped, so that we can directly access | 115 | * The direct mapping extends to max_pfn_mapped, so that we can directly access |
@@ -134,9 +131,9 @@ int default_cpu_present_to_apicid(int mps_cpu) | |||
134 | return __default_cpu_present_to_apicid(mps_cpu); | 131 | return __default_cpu_present_to_apicid(mps_cpu); |
135 | } | 132 | } |
136 | 133 | ||
137 | int default_check_phys_apicid_present(int boot_cpu_physical_apicid) | 134 | int default_check_phys_apicid_present(int phys_apicid) |
138 | { | 135 | { |
139 | return __default_check_phys_apicid_present(boot_cpu_physical_apicid); | 136 | return __default_check_phys_apicid_present(phys_apicid); |
140 | } | 137 | } |
141 | #endif | 138 | #endif |
142 | 139 | ||
@@ -172,13 +169,6 @@ static struct resource bss_resource = { | |||
172 | 169 | ||
173 | 170 | ||
174 | #ifdef CONFIG_X86_32 | 171 | #ifdef CONFIG_X86_32 |
175 | static struct resource video_ram_resource = { | ||
176 | .name = "Video RAM area", | ||
177 | .start = 0xa0000, | ||
178 | .end = 0xbffff, | ||
179 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
180 | }; | ||
181 | |||
182 | /* cpu data as detected by the assembly code in head.S */ | 172 | /* cpu data as detected by the assembly code in head.S */ |
183 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1}; | 173 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1}; |
184 | /* common cpu data for all cpus */ | 174 | /* common cpu data for all cpus */ |
@@ -606,7 +596,7 @@ static struct resource standard_io_resources[] = { | |||
606 | .flags = IORESOURCE_BUSY | IORESOURCE_IO } | 596 | .flags = IORESOURCE_BUSY | IORESOURCE_IO } |
607 | }; | 597 | }; |
608 | 598 | ||
609 | static void __init reserve_standard_io_resources(void) | 599 | void __init reserve_standard_io_resources(void) |
610 | { | 600 | { |
611 | int i; | 601 | int i; |
612 | 602 | ||
@@ -638,10 +628,6 @@ static int __init setup_elfcorehdr(char *arg) | |||
638 | early_param("elfcorehdr", setup_elfcorehdr); | 628 | early_param("elfcorehdr", setup_elfcorehdr); |
639 | #endif | 629 | #endif |
640 | 630 | ||
641 | static struct x86_quirks default_x86_quirks __initdata; | ||
642 | |||
643 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; | ||
644 | |||
645 | #ifdef CONFIG_X86_RESERVE_LOW_64K | 631 | #ifdef CONFIG_X86_RESERVE_LOW_64K |
646 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) | 632 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) |
647 | { | 633 | { |
@@ -712,6 +698,21 @@ void __init setup_arch(char **cmdline_p) | |||
712 | printk(KERN_INFO "Command line: %s\n", boot_command_line); | 698 | printk(KERN_INFO "Command line: %s\n", boot_command_line); |
713 | #endif | 699 | #endif |
714 | 700 | ||
701 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | ||
702 | *cmdline_p = command_line; | ||
703 | |||
704 | #ifdef CONFIG_X86_64 | ||
705 | /* | ||
706 | * Must call this twice: Once just to detect whether hardware doesn't | ||
707 | * support NX (so that the early EHCI debug console setup can safely | ||
708 | * call set_fixmap(), and then again after parsing early parameters to | ||
709 | * honor the respective command line option. | ||
710 | */ | ||
711 | check_efer(); | ||
712 | #endif | ||
713 | |||
714 | parse_early_param(); | ||
715 | |||
715 | /* VMI may relocate the fixmap; do this before touching ioremap area */ | 716 | /* VMI may relocate the fixmap; do this before touching ioremap area */ |
716 | vmi_init(); | 717 | vmi_init(); |
717 | 718 | ||
@@ -758,7 +759,7 @@ void __init setup_arch(char **cmdline_p) | |||
758 | } | 759 | } |
759 | #endif | 760 | #endif |
760 | 761 | ||
761 | ARCH_SETUP | 762 | x86_init.oem.arch_setup(); |
762 | 763 | ||
763 | setup_memory_map(); | 764 | setup_memory_map(); |
764 | parse_setup_data(); | 765 | parse_setup_data(); |
@@ -794,11 +795,6 @@ void __init setup_arch(char **cmdline_p) | |||
794 | #endif | 795 | #endif |
795 | #endif | 796 | #endif |
796 | 797 | ||
797 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | ||
798 | *cmdline_p = command_line; | ||
799 | |||
800 | parse_early_param(); | ||
801 | |||
802 | #ifdef CONFIG_X86_64 | 798 | #ifdef CONFIG_X86_64 |
803 | check_efer(); | 799 | check_efer(); |
804 | #endif | 800 | #endif |
@@ -834,11 +830,9 @@ void __init setup_arch(char **cmdline_p) | |||
834 | * VMware detection requires dmi to be available, so this | 830 | * VMware detection requires dmi to be available, so this |
835 | * needs to be done after dmi_scan_machine, for the BP. | 831 | * needs to be done after dmi_scan_machine, for the BP. |
836 | */ | 832 | */ |
837 | init_hypervisor(&boot_cpu_data); | 833 | init_hypervisor_platform(); |
838 | 834 | ||
839 | #ifdef CONFIG_X86_32 | 835 | x86_init.resources.probe_roms(); |
840 | probe_roms(); | ||
841 | #endif | ||
842 | 836 | ||
843 | /* after parse_early_param, so could debug it */ | 837 | /* after parse_early_param, so could debug it */ |
844 | insert_resource(&iomem_resource, &code_resource); | 838 | insert_resource(&iomem_resource, &code_resource); |
@@ -973,10 +967,11 @@ void __init setup_arch(char **cmdline_p) | |||
973 | kvmclock_init(); | 967 | kvmclock_init(); |
974 | #endif | 968 | #endif |
975 | 969 | ||
976 | paravirt_pagetable_setup_start(swapper_pg_dir); | 970 | x86_init.paging.pagetable_setup_start(swapper_pg_dir); |
977 | paging_init(); | 971 | paging_init(); |
978 | paravirt_pagetable_setup_done(swapper_pg_dir); | 972 | x86_init.paging.pagetable_setup_done(swapper_pg_dir); |
979 | paravirt_post_allocator_init(); | 973 | |
974 | tboot_probe(); | ||
980 | 975 | ||
981 | #ifdef CONFIG_X86_64 | 976 | #ifdef CONFIG_X86_64 |
982 | map_vsyscall(); | 977 | map_vsyscall(); |
@@ -993,13 +988,11 @@ void __init setup_arch(char **cmdline_p) | |||
993 | 988 | ||
994 | sfi_init(); | 989 | sfi_init(); |
995 | 990 | ||
996 | #if defined(CONFIG_X86_MPPARSE) || defined(CONFIG_X86_VISWS) | ||
997 | /* | 991 | /* |
998 | * get boot-time SMP configuration: | 992 | * get boot-time SMP configuration: |
999 | */ | 993 | */ |
1000 | if (smp_found_config) | 994 | if (smp_found_config) |
1001 | get_smp_config(); | 995 | get_smp_config(); |
1002 | #endif | ||
1003 | 996 | ||
1004 | prefill_possible_map(); | 997 | prefill_possible_map(); |
1005 | 998 | ||
@@ -1018,10 +1011,7 @@ void __init setup_arch(char **cmdline_p) | |||
1018 | e820_reserve_resources(); | 1011 | e820_reserve_resources(); |
1019 | e820_mark_nosave_regions(max_low_pfn); | 1012 | e820_mark_nosave_regions(max_low_pfn); |
1020 | 1013 | ||
1021 | #ifdef CONFIG_X86_32 | 1014 | x86_init.resources.reserve_resources(); |
1022 | request_resource(&iomem_resource, &video_ram_resource); | ||
1023 | #endif | ||
1024 | reserve_standard_io_resources(); | ||
1025 | 1015 | ||
1026 | e820_setup_gap(); | 1016 | e820_setup_gap(); |
1027 | 1017 | ||
@@ -1033,78 +1023,22 @@ void __init setup_arch(char **cmdline_p) | |||
1033 | conswitchp = &dummy_con; | 1023 | conswitchp = &dummy_con; |
1034 | #endif | 1024 | #endif |
1035 | #endif | 1025 | #endif |
1026 | x86_init.oem.banner(); | ||
1036 | } | 1027 | } |
1037 | 1028 | ||
1038 | #ifdef CONFIG_X86_32 | 1029 | #ifdef CONFIG_X86_32 |
1039 | 1030 | ||
1040 | /** | 1031 | static struct resource video_ram_resource = { |
1041 | * x86_quirk_intr_init - post gate setup interrupt initialisation | 1032 | .name = "Video RAM area", |
1042 | * | 1033 | .start = 0xa0000, |
1043 | * Description: | 1034 | .end = 0xbffff, |
1044 | * Fill in any interrupts that may have been left out by the general | 1035 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM |
1045 | * init_IRQ() routine. interrupts having to do with the machine rather | ||
1046 | * than the devices on the I/O bus (like APIC interrupts in intel MP | ||
1047 | * systems) are started here. | ||
1048 | **/ | ||
1049 | void __init x86_quirk_intr_init(void) | ||
1050 | { | ||
1051 | if (x86_quirks->arch_intr_init) { | ||
1052 | if (x86_quirks->arch_intr_init()) | ||
1053 | return; | ||
1054 | } | ||
1055 | } | ||
1056 | |||
1057 | /** | ||
1058 | * x86_quirk_trap_init - initialise system specific traps | ||
1059 | * | ||
1060 | * Description: | ||
1061 | * Called as the final act of trap_init(). Used in VISWS to initialise | ||
1062 | * the various board specific APIC traps. | ||
1063 | **/ | ||
1064 | void __init x86_quirk_trap_init(void) | ||
1065 | { | ||
1066 | if (x86_quirks->arch_trap_init) { | ||
1067 | if (x86_quirks->arch_trap_init()) | ||
1068 | return; | ||
1069 | } | ||
1070 | } | ||
1071 | |||
1072 | static struct irqaction irq0 = { | ||
1073 | .handler = timer_interrupt, | ||
1074 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, | ||
1075 | .name = "timer" | ||
1076 | }; | 1036 | }; |
1077 | 1037 | ||
1078 | /** | 1038 | void __init i386_reserve_resources(void) |
1079 | * x86_quirk_pre_time_init - do any specific initialisations before. | ||
1080 | * | ||
1081 | **/ | ||
1082 | void __init x86_quirk_pre_time_init(void) | ||
1083 | { | 1039 | { |
1084 | if (x86_quirks->arch_pre_time_init) | 1040 | request_resource(&iomem_resource, &video_ram_resource); |
1085 | x86_quirks->arch_pre_time_init(); | 1041 | reserve_standard_io_resources(); |
1086 | } | 1042 | } |
1087 | 1043 | ||
1088 | /** | ||
1089 | * x86_quirk_time_init - do any specific initialisations for the system timer. | ||
1090 | * | ||
1091 | * Description: | ||
1092 | * Must plug the system timer interrupt source at HZ into the IRQ listed | ||
1093 | * in irq_vectors.h:TIMER_IRQ | ||
1094 | **/ | ||
1095 | void __init x86_quirk_time_init(void) | ||
1096 | { | ||
1097 | if (x86_quirks->arch_time_init) { | ||
1098 | /* | ||
1099 | * A nonzero return code does not mean failure, it means | ||
1100 | * that the architecture quirk does not want any | ||
1101 | * generic (timer) setup to be performed after this: | ||
1102 | */ | ||
1103 | if (x86_quirks->arch_time_init()) | ||
1104 | return; | ||
1105 | } | ||
1106 | |||
1107 | irq0.mask = cpumask_of_cpu(0); | ||
1108 | setup_irq(0, &irq0); | ||
1109 | } | ||
1110 | #endif /* CONFIG_X86_32 */ | 1044 | #endif /* CONFIG_X86_32 */ |