Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Vladimir Serbinenko | 33b535f | 2014-10-19 10:13:14 +0200 | [diff] [blame] | 3 | |
Vladimir Serbinenko | 33b535f | 2014-10-19 10:13:14 +0200 | [diff] [blame] | 4 | #include <arch/ioapic.h> |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame^] | 5 | #include <acpi/acpi.h> |
Vladimir Serbinenko | 33b535f | 2014-10-19 10:13:14 +0200 | [diff] [blame] | 6 | #include <arch/smp/mpspec.h> |
| 7 | #include <device/device.h> |
| 8 | #include <device/pci.h> |
Vladimir Serbinenko | 33b535f | 2014-10-19 10:13:14 +0200 | [diff] [blame] | 9 | |
| 10 | unsigned long acpi_fill_madt(unsigned long current) |
| 11 | { |
| 12 | /* Local APICs */ |
| 13 | current = acpi_create_madt_lapics(current); |
| 14 | |
| 15 | /* IOAPIC */ |
| 16 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, |
| 17 | 1, IO_APIC_ADDR, 0); |
| 18 | |
| 19 | /* INT_SRC_OVR */ |
| 20 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 21 | current, 0, 0, 2, |
| 22 | MP_IRQ_POLARITY_DEFAULT | |
| 23 | MP_IRQ_TRIGGER_DEFAULT); |
| 24 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 25 | current, 0, 9, 9, |
| 26 | MP_IRQ_POLARITY_HIGH | |
| 27 | MP_IRQ_TRIGGER_LEVEL); |
| 28 | |
| 29 | /* LAPIC_NMI */ |
| 30 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 31 | current, 0, |
| 32 | MP_IRQ_POLARITY_HIGH | |
| 33 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 34 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 35 | current, 1, MP_IRQ_POLARITY_HIGH | |
| 36 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 37 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 38 | current, 2, MP_IRQ_POLARITY_HIGH | |
| 39 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 40 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 41 | current, 3, MP_IRQ_POLARITY_HIGH | |
| 42 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 43 | return current; |
| 44 | } |