aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/apic.c92
-rw-r--r--arch/x86_64/kernel/mpparse.c8
-rw-r--r--arch/x86_64/kernel/smpboot.c1
-rw-r--r--include/asm-x86_64/mpspec.h1
-rw-r--r--include/asm-x86_64/smp.h1
5 files changed, 29 insertions, 74 deletions
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 78c43b1a3064..20a76f209629 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -136,72 +136,40 @@ void clear_local_APIC(void)
136 apic_read(APIC_ESR); 136 apic_read(APIC_ESR);
137} 137}
138 138
139void __init connect_bsp_APIC(void)
140{
141 if (pic_mode) {
142 /*
143 * Do not trust the local APIC being empty at bootup.
144 */
145 clear_local_APIC();
146 /*
147 * PIC mode, enable APIC mode in the IMCR, i.e.
148 * connect BSP's local APIC to INT and NMI lines.
149 */
150 apic_printk(APIC_VERBOSE, "leaving PIC mode, enabling APIC mode.\n");
151 outb(0x70, 0x22);
152 outb(0x01, 0x23);
153 }
154}
155
156void disconnect_bsp_APIC(int virt_wire_setup) 139void disconnect_bsp_APIC(int virt_wire_setup)
157{ 140{
158 if (pic_mode) { 141 /* Go back to Virtual Wire compatibility mode */
159 /* 142 unsigned long value;
160 * Put the board back into PIC mode (has an effect
161 * only on certain older boards). Note that APIC
162 * interrupts, including IPIs, won't work beyond
163 * this point! The only exception are INIT IPIs.
164 */
165 apic_printk(APIC_QUIET, "disabling APIC mode, entering PIC mode.\n");
166 outb(0x70, 0x22);
167 outb(0x00, 0x23);
168 }
169 else {
170 /* Go back to Virtual Wire compatibility mode */
171 unsigned long value;
172
173 /* For the spurious interrupt use vector F, and enable it */
174 value = apic_read(APIC_SPIV);
175 value &= ~APIC_VECTOR_MASK;
176 value |= APIC_SPIV_APIC_ENABLED;
177 value |= 0xf;
178 apic_write(APIC_SPIV, value);
179
180 if (!virt_wire_setup) {
181 /* For LVT0 make it edge triggered, active high, external and enabled */
182 value = apic_read(APIC_LVT0);
183 value &= ~(APIC_MODE_MASK | APIC_SEND_PENDING |
184 APIC_INPUT_POLARITY | APIC_LVT_REMOTE_IRR |
185 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED );
186 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING;
187 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_EXTINT);
188 apic_write(APIC_LVT0, value);
189 }
190 else {
191 /* Disable LVT0 */
192 apic_write(APIC_LVT0, APIC_LVT_MASKED);
193 }
194 143
195 /* For LVT1 make it edge triggered, active high, nmi and enabled */ 144 /* For the spurious interrupt use vector F, and enable it */
196 value = apic_read(APIC_LVT1); 145 value = apic_read(APIC_SPIV);
197 value &= ~( 146 value &= ~APIC_VECTOR_MASK;
198 APIC_MODE_MASK | APIC_SEND_PENDING | 147 value |= APIC_SPIV_APIC_ENABLED;
148 value |= 0xf;
149 apic_write(APIC_SPIV, value);
150
151 if (!virt_wire_setup) {
152 /* For LVT0 make it edge triggered, active high, external and enabled */
153 value = apic_read(APIC_LVT0);
154 value &= ~(APIC_MODE_MASK | APIC_SEND_PENDING |
199 APIC_INPUT_POLARITY | APIC_LVT_REMOTE_IRR | 155 APIC_INPUT_POLARITY | APIC_LVT_REMOTE_IRR |
200 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED); 156 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED );
201 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING; 157 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING;
202 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_NMI); 158 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_EXTINT);
203 apic_write(APIC_LVT1, value); 159 apic_write(APIC_LVT0, value);
160 } else {
161 /* Disable LVT0 */
162 apic_write(APIC_LVT0, APIC_LVT_MASKED);
204 } 163 }
164
165 /* For LVT1 make it edge triggered, active high, nmi and enabled */
166 value = apic_read(APIC_LVT1);
167 value &= ~(APIC_MODE_MASK | APIC_SEND_PENDING |
168 APIC_INPUT_POLARITY | APIC_LVT_REMOTE_IRR |
169 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED);
170 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING;
171 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_NMI);
172 apic_write(APIC_LVT1, value);
205} 173}
206 174
207void disable_local_APIC(void) 175void disable_local_APIC(void)
@@ -418,7 +386,7 @@ void __cpuinit setup_local_APIC (void)
418 * TODO: set up through-local-APIC from through-I/O-APIC? --macro 386 * TODO: set up through-local-APIC from through-I/O-APIC? --macro
419 */ 387 */
420 value = apic_read(APIC_LVT0) & APIC_LVT_MASKED; 388 value = apic_read(APIC_LVT0) & APIC_LVT_MASKED;
421 if (!smp_processor_id() && (pic_mode || !value)) { 389 if (!smp_processor_id() && !value) {
422 value = APIC_DM_EXTINT; 390 value = APIC_DM_EXTINT;
423 apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", smp_processor_id()); 391 apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", smp_processor_id());
424 } else { 392 } else {
@@ -1096,8 +1064,6 @@ int __init APIC_init_uniprocessor (void)
1096 1064
1097 verify_local_APIC(); 1065 verify_local_APIC();
1098 1066
1099 connect_bsp_APIC();
1100
1101 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_id); 1067 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_id);
1102 apic_write(APIC_ID, SET_APIC_ID(boot_cpu_id)); 1068 apic_write(APIC_ID, SET_APIC_ID(boot_cpu_id));
1103 1069
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 90e99cf27aa5..022624503552 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -56,7 +56,6 @@ struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
56int mp_irq_entries; 56int mp_irq_entries;
57 57
58int nr_ioapics; 58int nr_ioapics;
59int pic_mode;
60unsigned long mp_lapic_addr = 0; 59unsigned long mp_lapic_addr = 0;
61 60
62 61
@@ -514,13 +513,6 @@ void __init get_smp_config (void)
514 printk(KERN_INFO "Using ACPI for processor (LAPIC) configuration information\n"); 513 printk(KERN_INFO "Using ACPI for processor (LAPIC) configuration information\n");
515 514
516 printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification); 515 printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
517 if (mpf->mpf_feature2 & (1<<7)) {
518 printk(KERN_INFO " IMCR and PIC compatibility mode.\n");
519 pic_mode = 1;
520 } else {
521 printk(KERN_INFO " Virtual Wire compatibility mode.\n");
522 pic_mode = 0;
523 }
524 516
525 /* 517 /*
526 * Now see if we need to read further. 518 * Now see if we need to read further.
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index d29571e24953..ae7d6d84e352 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -1090,7 +1090,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
1090 /* 1090 /*
1091 * Switch from PIC to APIC mode. 1091 * Switch from PIC to APIC mode.
1092 */ 1092 */
1093 connect_bsp_APIC();
1094 setup_local_APIC(); 1093 setup_local_APIC();
1095 1094
1096 if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_id) { 1095 if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_id) {
diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h
index 3c7aae9fd157..1dc83436cc91 100644
--- a/include/asm-x86_64/mpspec.h
+++ b/include/asm-x86_64/mpspec.h
@@ -178,7 +178,6 @@ extern int mp_irq_entries;
178extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES]; 178extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES];
179extern int mpc_default_type; 179extern int mpc_default_type;
180extern unsigned long mp_lapic_addr; 180extern unsigned long mp_lapic_addr;
181extern int pic_mode;
182 181
183#ifdef CONFIG_ACPI 182#ifdef CONFIG_ACPI
184extern void mp_register_lapic (u8 id, u8 enabled); 183extern void mp_register_lapic (u8 id, u8 enabled);
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
index 6353fa41bebe..498fbc1fc179 100644
--- a/include/asm-x86_64/smp.h
+++ b/include/asm-x86_64/smp.h
@@ -33,7 +33,6 @@ extern cpumask_t cpu_initialized;
33 33
34extern void smp_alloc_memory(void); 34extern void smp_alloc_memory(void);
35extern volatile unsigned long smp_invalidate_needed; 35extern volatile unsigned long smp_invalidate_needed;
36extern int pic_mode;
37extern void lock_ipi_call_lock(void); 36extern void lock_ipi_call_lock(void);
38extern void unlock_ipi_call_lock(void); 37extern void unlock_ipi_call_lock(void);
39extern int smp_num_siblings; 38extern int smp_num_siblings;