mptable: Refactor mptable generation some more
[coreboot.git] / src / mainboard / asus / p2b-ds / mptable.c
index 7c024152ff9f6777eaac55b5808476b52512909f..153c62c5c60053aa1ab0b9343765c52e974c6401 100644 (file)
@@ -32,7 +32,7 @@ static void *smp_write_config_table(void *v)
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
-       mptable_init(mc, "P2B-DS      ", LAPIC_ADDR);
+       mptable_init(mc, LAPIC_ADDR);
 
        smp_write_processors(mc);
 
@@ -50,21 +50,15 @@ static void *smp_write_config_table(void *v)
        smp_write_intsrc(mc,  mp_INT,    MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW,  0x0,     0x18, ioapic_id,   0x13);
 
        /* Local Ints:        Type       Trigger                Polarity              Bus ID   IRQ   APIC ID      PIN# */
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE |  MP_IRQ_POLARITY_HIGH, 0x1,     0x0,  MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI,    MP_IRQ_TRIGGER_EDGE |  MP_IRQ_POLARITY_HIGH, 0x1,     0x0,  MP_APIC_ALL, 0x1);
+       mptable_lintsrc(mc, 0x1);
 
        /* Compute the checksums. */
-       mc->mpe_checksum =
-           smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
-       mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
-       printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n",
-                    mc, smp_next_mpe_entry(mc));
-       return smp_next_mpe_entry(mc);
+       return mptable_finalize(mc);
 }
 
 unsigned long write_smp_table(unsigned long addr)
 {
        void *v;
-       v = smp_write_floating_table(addr);
+       v = smp_write_floating_table(addr, 0);
        return (unsigned long)smp_write_config_table(v);
 }