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