We define IO_APIC_ADDR in <arch/ioapic.h>, let's use it.
[coreboot.git] / src / mainboard / asus / p2b-ds / mptable.c
index e5bfdcd3a75cf5a7d17e1524ed2a06a7e45d5ad6..4650c5912612533e2199b1d8935ea8000b8f6346 100644 (file)
 
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
 
-void *smp_write_config_table(void *v)
+static void *smp_write_config_table(void *v)
 {
        static const char sig[4] = "PCMP";
        static const char oem[8] = "COREBOOT";
@@ -55,7 +56,7 @@ void *smp_write_config_table(void *v)
        smp_write_bus(mc, 1, "ISA   ");
 
        /* I/O APICs:   APIC ID Version State           Address */
-       smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+       smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
        {
                device_t dev;
                struct resource *res;
@@ -86,46 +87,8 @@ void *smp_write_config_table(void *v)
                }
        }
 
-       /* I/O Ints: Type  Polarity  Trigger  Bus ID  IRQ  APIC ID  PIN# */
-       smp_write_intsrc(mc, mp_ExtINT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x0, 0x2, 0x0);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x1, 0x2, 0x1);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x0, 0x2, 0x2);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x3, 0x2, 0x3);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x4, 0x2, 0x4);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x5, 0x2, 0x5);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x6, 0x2, 0x6);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x7, 0x2, 0x7);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x8, 0x2, 0x8);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0x9, 0x2, 0x9);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0xc, 0x2, 0xc);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0xe, 0x2, 0xe);
-       smp_write_intsrc(mc, mp_INT,
-                        MP_IRQ_TRIGGER_DEFAULT | MP_IRQ_POLARITY_DEFAULT, 0x1,
-                        0xf, 0x2, 0xf);
+       mptable_add_isa_interrupts(mc, 0x1, 0x2, 0);
+
        smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW,
                         0x0, 0x13, 0x2, 0x13);
        smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW,