mb/google/brya: Create rull variant
[coreboot2.git] / src / mainboard / asus / p2b / variants / p2b-ds / mptable.c
blobf06fc6039c4706626cd15dd663b3be00b66f84a1
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <arch/smp/mpspec.h>
4 #include <arch/ioapic.h>
6 static void *smp_write_config_table(void *v)
8 int isa_bus;
9 struct mp_config_table *mc;
11 mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
13 mptable_init(mc);
15 smp_write_processors(mc);
17 mptable_write_buses(mc, NULL, &isa_bus);
19 /* External Intel 82093AA IOAPIC. */
20 u8 ioapic_id = smp_write_ioapic_from_hw(mc, IO_APIC_ADDR);
22 /* Legacy Interrupts */
23 mptable_add_isa_interrupts(mc, isa_bus, ioapic_id, 0);
25 /* I/O Ints: Type Trigger Polarity Bus ID IRQ APIC ID PIN# */
26 smp_write_pci_intsrc(mc, mp_INT, 0x0, 0x04, 3, ioapic_id, 0x13);
27 smp_write_pci_intsrc(mc, mp_INT, 0x0, 0x06, 0, ioapic_id, 0x13);
29 /* Local Ints: Type Trigger Polarity Bus ID IRQ APIC ID PIN# */
30 mptable_lintsrc(mc, 0x1);
32 /* Compute the checksums. */
33 return mptable_finalize(mc);
36 unsigned long write_smp_table(unsigned long addr)
38 void *v;
39 v = smp_write_floating_table(addr, 0);
40 return (unsigned long)smp_write_config_table(v);