Vladimir Serbinenko | 33b535f | 2014-10-19 10:13:14 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2009 coresystems GmbH |
| 5 | * Copyright (C) 2013 Vladimir Serbinenko <phcoder@gmail.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; version 2 of |
| 10 | * the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 20 | * MA 02110-1301 USA |
| 21 | */ |
| 22 | |
| 23 | #include <string.h> |
| 24 | #include <console/console.h> |
| 25 | #include <arch/io.h> |
| 26 | #include <arch/ioapic.h> |
| 27 | #include <arch/acpi.h> |
| 28 | #include <arch/acpigen.h> |
| 29 | #include <arch/smp/mpspec.h> |
| 30 | #include <device/device.h> |
| 31 | #include <device/pci.h> |
| 32 | #include <device/pci_ids.h> |
| 33 | |
| 34 | unsigned long acpi_fill_madt(unsigned long current) |
| 35 | { |
| 36 | /* Local APICs */ |
| 37 | current = acpi_create_madt_lapics(current); |
| 38 | |
| 39 | /* IOAPIC */ |
| 40 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, |
| 41 | 1, IO_APIC_ADDR, 0); |
| 42 | |
| 43 | /* INT_SRC_OVR */ |
| 44 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 45 | current, 0, 0, 2, |
| 46 | MP_IRQ_POLARITY_DEFAULT | |
| 47 | MP_IRQ_TRIGGER_DEFAULT); |
| 48 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 49 | current, 0, 9, 9, |
| 50 | MP_IRQ_POLARITY_HIGH | |
| 51 | MP_IRQ_TRIGGER_LEVEL); |
| 52 | |
| 53 | /* LAPIC_NMI */ |
| 54 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 55 | current, 0, |
| 56 | MP_IRQ_POLARITY_HIGH | |
| 57 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 58 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 59 | current, 1, MP_IRQ_POLARITY_HIGH | |
| 60 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 61 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 62 | current, 2, MP_IRQ_POLARITY_HIGH | |
| 63 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 64 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) |
| 65 | current, 3, MP_IRQ_POLARITY_HIGH | |
| 66 | MP_IRQ_TRIGGER_EDGE, 0x01); |
| 67 | return current; |
| 68 | } |