Angel Pons | 5c59680 | 2020-04-03 01:21:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 2 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 4 | #include <arch/ioapic.h> |
Felix Held | 6b2b835 | 2023-02-21 21:03:39 +0100 | [diff] [blame] | 5 | #include <northbridge/amd/nb_common.h> |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 6 | |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 7 | unsigned long acpi_fill_madt(unsigned long current) |
| 8 | { |
| 9 | /* create all subtables for processors */ |
Kyösti Mälkki | 899c713 | 2021-06-16 11:06:26 +0300 | [diff] [blame] | 10 | current = acpi_create_madt_lapics_with_nmis(current); |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 11 | |
| 12 | /* Write SB800 IOAPIC, only one */ |
Kyösti Mälkki | d1534e4 | 2023-04-09 10:01:58 +0300 | [diff] [blame] | 13 | current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 14 | |
| 15 | /* TODO: Remove the hardcode */ |
Kyösti Mälkki | d1534e4 | 2023-04-09 10:01:58 +0300 | [diff] [blame] | 16 | current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC2_ADDR); |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 17 | |
| 18 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 19 | current, 0, 0, 2, 0); |
| 20 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 21 | current, 0, 9, 9, 0xF); |
| 22 | /* 0: mean bus 0--->ISA */ |
| 23 | /* 0: PIC 0 */ |
| 24 | /* 2: APIC 2 */ |
Kyösti Mälkki | d874757 | 2014-06-26 05:30:54 +0300 | [diff] [blame] | 25 | /* 5 mean: 0101 --> Edge-triggered, Active high */ |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 26 | |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 27 | return current; |
| 28 | } |