blob: d776c9fcb1fdc4ba0863b02d222a7ac830ab29c6 [file] [log] [blame]
Vladimir Serbinenko33b535f2014-10-19 10:13:14 +02001/*
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.
Vladimir Serbinenko33b535f2014-10-19 10:13:14 +020016 */
17
18#include <string.h>
19#include <console/console.h>
20#include <arch/io.h>
21#include <arch/ioapic.h>
22#include <arch/acpi.h>
23#include <arch/acpigen.h>
24#include <arch/smp/mpspec.h>
25#include <device/device.h>
26#include <device/pci.h>
27#include <device/pci_ids.h>
28
29unsigned long acpi_fill_madt(unsigned long current)
30{
31 /* Local APICs */
32 current = acpi_create_madt_lapics(current);
33
34 /* IOAPIC */
35 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
36 1, IO_APIC_ADDR, 0);
37
38 /* INT_SRC_OVR */
39 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
40 current, 0, 0, 2,
41 MP_IRQ_POLARITY_DEFAULT |
42 MP_IRQ_TRIGGER_DEFAULT);
43 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
44 current, 0, 9, 9,
45 MP_IRQ_POLARITY_HIGH |
46 MP_IRQ_TRIGGER_LEVEL);
47
48 /* LAPIC_NMI */
49 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)
50 current, 0,
51 MP_IRQ_POLARITY_HIGH |
52 MP_IRQ_TRIGGER_EDGE, 0x01);
53 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)
54 current, 1, MP_IRQ_POLARITY_HIGH |
55 MP_IRQ_TRIGGER_EDGE, 0x01);
56 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)
57 current, 2, MP_IRQ_POLARITY_HIGH |
58 MP_IRQ_TRIGGER_EDGE, 0x01);
59 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)
60 current, 3, MP_IRQ_POLARITY_HIGH |
61 MP_IRQ_TRIGGER_EDGE, 0x01);
62 return current;
63}