aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2008-04-04 15:41:07 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:34 -0400
commit61048c6328819b0973ef662f6d46f2e2bc753ceb (patch)
tree09efa08f2e4a18b191769aad558144c2bde404df
parent16ecf7a47cf4f1c97189a551b001195aed550cc2 (diff)
x86: don't set IO APIC features if IO APIC is not enabled
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/mpparse_32.c24
-rw-r--r--include/asm-x86/mach-default/mach_apic.h2
-rw-r--r--include/asm-x86/mpspec.h3
3 files changed, 23 insertions, 6 deletions
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c
index 4f4cfad9ae5..09cb7781368 100644
--- a/arch/x86/kernel/mpparse_32.c
+++ b/arch/x86/kernel/mpparse_32.c
@@ -221,6 +221,8 @@ static void __init MP_bus_info (struct mpc_config_bus *m)
221 } 221 }
222} 222}
223 223
224#ifdef CONFIG_X86_IO_APIC
225
224static int bad_ioapic(unsigned long address) 226static int bad_ioapic(unsigned long address)
225{ 227{
226 if (nr_ioapics >= MAX_IO_APICS) { 228 if (nr_ioapics >= MAX_IO_APICS) {
@@ -263,6 +265,8 @@ static void __init MP_intsrc_info (struct mpc_config_intsrc *m)
263 panic("Max # of irq sources exceeded!!\n"); 265 panic("Max # of irq sources exceeded!!\n");
264} 266}
265 267
268#endif
269
266static void __init MP_lintsrc_info (struct mpc_config_lintsrc *m) 270static void __init MP_lintsrc_info (struct mpc_config_lintsrc *m)
267{ 271{
268 Dprintk("Lint: type %d, pol %d, trig %d, bus %d," 272 Dprintk("Lint: type %d, pol %d, trig %d, bus %d,"
@@ -421,21 +425,25 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
421 } 425 }
422 case MP_IOAPIC: 426 case MP_IOAPIC:
423 { 427 {
428#ifdef CONFIG_X86_IO_APIC
424 struct mpc_config_ioapic *m= 429 struct mpc_config_ioapic *m=
425 (struct mpc_config_ioapic *)mpt; 430 (struct mpc_config_ioapic *)mpt;
426 MP_ioapic_info(m); 431 MP_ioapic_info(m);
427 mpt+=sizeof(*m); 432 mpt+=sizeof(*m);
428 count+=sizeof(*m); 433 count+=sizeof(*m);
434#endif
429 break; 435 break;
430 } 436 }
431 case MP_INTSRC: 437 case MP_INTSRC:
432 { 438 {
439#ifdef CONFIG_X86_IO_APIC
433 struct mpc_config_intsrc *m= 440 struct mpc_config_intsrc *m=
434 (struct mpc_config_intsrc *)mpt; 441 (struct mpc_config_intsrc *)mpt;
435 442
436 MP_intsrc_info(m); 443 MP_intsrc_info(m);
437 mpt+=sizeof(*m); 444 mpt+=sizeof(*m);
438 count+=sizeof(*m); 445 count+=sizeof(*m);
446#endif
439 break; 447 break;
440 } 448 }
441 case MP_LINTSRC: 449 case MP_LINTSRC:
@@ -463,6 +471,8 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
463 return num_processors; 471 return num_processors;
464} 472}
465 473
474#ifdef CONFIG_X86_IO_APIC
475
466static int __init ELCR_trigger(unsigned int irq) 476static int __init ELCR_trigger(unsigned int irq)
467{ 477{
468 unsigned int port; 478 unsigned int port;
@@ -537,11 +547,15 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type)
537 MP_intsrc_info(&intsrc); 547 MP_intsrc_info(&intsrc);
538} 548}
539 549
550#endif
551
540static inline void __init construct_default_ISA_mptable(int mpc_default_type) 552static inline void __init construct_default_ISA_mptable(int mpc_default_type)
541{ 553{
542 struct mpc_config_processor processor; 554 struct mpc_config_processor processor;
543 struct mpc_config_bus bus; 555 struct mpc_config_bus bus;
556#ifdef CONFIG_X86_IO_APIC
544 struct mpc_config_ioapic ioapic; 557 struct mpc_config_ioapic ioapic;
558#endif
545 struct mpc_config_lintsrc lintsrc; 559 struct mpc_config_lintsrc lintsrc;
546 int linttypes[2] = { mp_ExtINT, mp_NMI }; 560 int linttypes[2] = { mp_ExtINT, mp_NMI };
547 int i; 561 int i;
@@ -597,6 +611,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
597 MP_bus_info(&bus); 611 MP_bus_info(&bus);
598 } 612 }
599 613
614#ifdef CONFIG_X86_IO_APIC
600 ioapic.mpc_type = MP_IOAPIC; 615 ioapic.mpc_type = MP_IOAPIC;
601 ioapic.mpc_apicid = 2; 616 ioapic.mpc_apicid = 2;
602 ioapic.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; 617 ioapic.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01;
@@ -608,7 +623,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
608 * We set up most of the low 16 IO-APIC pins according to MPS rules. 623 * We set up most of the low 16 IO-APIC pins according to MPS rules.
609 */ 624 */
610 construct_default_ioirq_mptable(mpc_default_type); 625 construct_default_ioirq_mptable(mpc_default_type);
611 626#endif
612 lintsrc.mpc_type = MP_LINTSRC; 627 lintsrc.mpc_type = MP_LINTSRC;
613 lintsrc.mpc_irqflag = 0; /* conforming */ 628 lintsrc.mpc_irqflag = 0; /* conforming */
614 lintsrc.mpc_srcbusid = 0; 629 lintsrc.mpc_srcbusid = 0;
@@ -670,6 +685,8 @@ void __init get_smp_config (void)
670 printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); 685 printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
671 return; 686 return;
672 } 687 }
688
689#ifdef CONFIG_X86_IO_APIC
673 /* 690 /*
674 * If there are no explicit MP IRQ entries, then we are 691 * If there are no explicit MP IRQ entries, then we are
675 * broken. We set up most of the low 16 IO-APIC pins to 692 * broken. We set up most of the low 16 IO-APIC pins to
@@ -687,7 +704,7 @@ void __init get_smp_config (void)
687 704
688 construct_default_ioirq_mptable(0); 705 construct_default_ioirq_mptable(0);
689 } 706 }
690 707#endif
691 } else 708 } else
692 BUG(); 709 BUG();
693 710
@@ -967,8 +984,9 @@ void __init mp_config_acpi_legacy_irqs (void)
967 intsrc.mpc_type = MP_INTSRC; 984 intsrc.mpc_type = MP_INTSRC;
968 intsrc.mpc_irqflag = 0; /* Conforming */ 985 intsrc.mpc_irqflag = 0; /* Conforming */
969 intsrc.mpc_srcbus = MP_ISA_BUS; 986 intsrc.mpc_srcbus = MP_ISA_BUS;
987#ifdef CONFIG_X86_IO_APIC
970 intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; 988 intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;
971 989#endif
972 /* 990 /*
973 * Use the default configuration for the IRQs 0-15. Unless 991 * Use the default configuration for the IRQs 0-15. Unless
974 * overridden by (MADT) interrupt source override entries. 992 * overridden by (MADT) interrupt source override entries.
diff --git a/include/asm-x86/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h
index 14217a970c5..0a6634f62ab 100644
--- a/include/asm-x86/mach-default/mach_apic.h
+++ b/include/asm-x86/mach-default/mach_apic.h
@@ -69,8 +69,10 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
69 69
70static inline void setup_apic_routing(void) 70static inline void setup_apic_routing(void)
71{ 71{
72#ifdef CONFIG_X86_IO_APIC
72 printk("Enabling APIC mode: %s. Using %d I/O APICs\n", 73 printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
73 "Flat", nr_ioapics); 74 "Flat", nr_ioapics);
75#endif
74} 76}
75 77
76static inline int apicid_to_node(int logical_apicid) 78static inline int apicid_to_node(int logical_apicid)
diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h
index 1f6445b147f..08cc5e02795 100644
--- a/include/asm-x86/mpspec.h
+++ b/include/asm-x86/mpspec.h
@@ -36,9 +36,6 @@ extern int mp_bus_id_to_pci_bus[MAX_MP_BUSSES];
36 36
37extern unsigned int boot_cpu_physical_apicid; 37extern unsigned int boot_cpu_physical_apicid;
38extern int smp_found_config; 38extern int smp_found_config;
39extern int nr_ioapics;
40extern int mp_irq_entries;
41extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
42extern int mpc_default_type; 39extern int mpc_default_type;
43extern unsigned long mp_lapic_addr; 40extern unsigned long mp_lapic_addr;
44 41