aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Pan <jacob.jun.pan@intel.com>2009-09-23 10:20:23 -0400
committerH. Peter Anvin <hpa@zytor.com>2010-02-24 02:13:19 -0500
commit05ddafb17ad1a73c8bc333cb328bad46513e85e7 (patch)
tree77cbf299a3a4f0f458bbea410ce31d85ff946185
parent28a3c93d11212655ce0a9be977c405c703844164 (diff)
x86, ioapic: Early enable ioapic for timer irq
Moorestown platform needs apic ready early for the system timer irq which is delievered via ioapic. Should not impact other platforms. In the longer term, once ioapic setup is moved before late time init, we will not need this patch to do early apic enabling. Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com> LKML-Reference: <43F901BD926A4E43B106BF17856F07559FB80D07@orsmsx508.amr.corp.intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--arch/x86/include/asm/io_apic.h1
-rw-r--r--arch/x86/kernel/apic/io_apic.c21
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index 31dfb42d8649..99a416ed16b7 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -187,6 +187,7 @@ extern struct mp_ioapic_gsi mp_gsi_routing[];
187int mp_find_ioapic(int gsi); 187int mp_find_ioapic(int gsi);
188int mp_find_ioapic_pin(int ioapic, int gsi); 188int mp_find_ioapic_pin(int ioapic, int gsi);
189void __init mp_register_ioapic(int id, u32 address, u32 gsi_base); 189void __init mp_register_ioapic(int id, u32 address, u32 gsi_base);
190extern void __init pre_init_apic_IRQ0(void);
190 191
191#else /* !CONFIG_X86_IO_APIC */ 192#else /* !CONFIG_X86_IO_APIC */
192 193
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b34854358ee6..8c848b5877a0 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -4289,3 +4289,24 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
4289 4289
4290 nr_ioapics++; 4290 nr_ioapics++;
4291} 4291}
4292
4293/* Enable IOAPIC early just for system timer */
4294void __init pre_init_apic_IRQ0(void)
4295{
4296 struct irq_cfg *cfg;
4297 struct irq_desc *desc;
4298
4299 printk(KERN_INFO "Early APIC setup for system timer0\n");
4300#ifndef CONFIG_SMP
4301 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid);
4302#endif
4303 desc = irq_to_desc_alloc_node(0, 0);
4304
4305 setup_local_APIC();
4306
4307 cfg = irq_cfg(0);
4308 add_pin_to_irq_node(cfg, 0, 0, 0);
4309 set_irq_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq, "edge");
4310
4311 setup_IO_APIC_irq(0, 0, 0, desc, 0, 0);
4312}