Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; version 2 of the License. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 13 | */ |
| 14 | |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 15 | #include <arch/acpi.h> |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 16 | #include <arch/ioapic.h> |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 17 | |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 18 | unsigned long acpi_fill_madt(unsigned long current) |
| 19 | { |
| 20 | /* create all subtables for processors */ |
| 21 | current = acpi_create_madt_lapics(current); |
| 22 | |
| 23 | /* Write SB800 IOAPIC, only one */ |
| 24 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, CONFIG_MAX_CPUS, |
| 25 | IO_APIC_ADDR, 0); |
| 26 | |
| 27 | /* TODO: Remove the hardcode */ |
| 28 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, CONFIG_MAX_CPUS+1, |
| 29 | 0xFEC20000, 24); |
| 30 | |
| 31 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 32 | current, 0, 0, 2, 0); |
| 33 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 34 | current, 0, 9, 9, 0xF); |
| 35 | /* 0: mean bus 0--->ISA */ |
| 36 | /* 0: PIC 0 */ |
| 37 | /* 2: APIC 2 */ |
Kyösti Mälkki | d874757 | 2014-06-26 05:30:54 +0300 | [diff] [blame] | 38 | /* 5 mean: 0101 --> Edge-triggered, Active high */ |
Siyuan Wang | 80cf7d5 | 2013-07-09 17:42:43 +0800 | [diff] [blame] | 39 | |
| 40 | /* create all subtables for processors */ |
| 41 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current, 0xff, 5, 1); |
| 42 | /* 1: LINT1 connect to NMI */ |
| 43 | |
| 44 | return current; |
| 45 | } |