Debian Codegraph @

src/mainboard/asus/p2b/variants/p2b-ds/mptable.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <arch/smp/mpspec.h>
4 #include <arch/ioapic.h>
5
6 static void *smp_write_config_table(void *v)
7 {
8 int isa_bus;
9 struct mp_config_table *mc;
10
11 mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
12
13 mptable_init(mc);
14
15 smp_write_processors(mc);
16
17 mptable_write_buses(mc, NULL, &isa_bus);
18
19 /* External Intel 82093AA IOAPIC. */
20 u8 ioapic_id = smp_write_ioapic_from_hw(mc, IO_APIC_ADDR);
21
22 /* Legacy Interrupts */
23 mptable_add_isa_interrupts(mc, isa_bus, ioapic_id, 0);
24
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);
28
29 /* Local Ints: Type Trigger Polarity Bus ID IRQ APIC ID PIN# */
30 mptable_lintsrc(mc, 0x1);
31
32 /* Compute the checksums. */
33 return mptable_finalize(mc);
34 }
35
36 unsigned long write_smp_table(unsigned long addr)
37 {
38 void *v;
39 v = smp_write_floating_table(addr, 0);
40 return (unsigned long)smp_write_config_table(v);
41 }