1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <device/pci_def.h>
6 unsigned long acpi_fill_madt(unsigned long current
)
8 struct device
*bdev
, *dev
= NULL
;
9 struct resource
*res
= NULL
;
11 current
= acpi_create_madt_lapics_with_nmis(current
);
13 /* Southbridge IOAPIC */
14 current
+= acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t
*)current
, 0xfec00000);
16 bdev
= pcidev_on_root(2, 0);
17 /* P64H2 Bus B IOAPIC */
19 dev
= pcidev_path_behind(bdev
->link_list
, PCI_DEVFN(28, 0));
21 res
= find_resource(dev
, PCI_BASE_ADDRESS_0
);
22 current
+= acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t
*)current
, res
->base
);
25 /* P64H2 Bus A IOAPIC */
27 dev
= pcidev_path_behind(bdev
->link_list
, PCI_DEVFN(30, 0));
29 res
= find_resource(dev
, PCI_BASE_ADDRESS_0
);
30 current
+= acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t
*)current
, res
->base
);
33 /* Map ISA IRQ 0 to IRQ 2 */
34 current
+= acpi_create_madt_irqoverride((acpi_madt_irqoverride_t
*)current
, 1, 0, 2, 0);
36 /* IRQ9 differs from ISA standard - ours is active high, level-triggered */
37 current
+= acpi_create_madt_irqoverride((acpi_madt_irqoverride_t
*)current
, 0, 9, 9, 0xD);