Angel Pons | 5c59680 | 2020-04-03 01:21:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 3 | |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 4 | #include <arch/acpi.h> |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 5 | #include <arch/ioapic.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 */ |
| 10 | current = acpi_create_madt_lapics(current); |
| 11 | |
| 12 | /* Write SB800 IOAPIC, only one */ |
| 13 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, CONFIG_MAX_CPUS, |
| 14 | IO_APIC_ADDR, 0); |
| 15 | |
| 16 | /* TODO: Remove the hardcode */ |
| 17 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, CONFIG_MAX_CPUS+1, |
| 18 | 0xFEC20000, 24); |
| 19 | |
| 20 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 21 | current, 0, 0, 2, 0); |
| 22 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 23 | current, 0, 9, 9, 0xF); |
| 24 | /* 0: mean bus 0--->ISA */ |
| 25 | /* 0: PIC 0 */ |
| 26 | /* 2: APIC 2 */ |
Kyösti Mälkki | d874757 | 2014-06-26 05:30:54 +0300 | [diff] [blame] | 27 | /* 5 mean: 0101 --> Edge-triggered, Active high */ |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 28 | |
| 29 | /* create all subtables for processors */ |
| 30 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current, 0xff, 5, 1); |
| 31 | /* 1: LINT1 connect to NMI */ |
| 32 | |
| 33 | return current; |
| 34 | } |