blob: 0197def7a7aa61b1002221e2bb82ff16a94b2f1d [file] [log] [blame]
York Yang9c6c7912016-03-09 11:19:51 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 Google Inc.
5 * Copyright (C) 2015-2016 Intel Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <arch/ioapic.h>
18#include <soc/acpi.h>
19#include <soc/iomap.h>
20
21extern const unsigned char AmlCode[];
22
23unsigned long acpi_fill_madt(unsigned long current)
24{
25 u32 i;
26
27 current = acpi_create_madt_lapics(current);
28
29 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 8,
30 IOXAPIC1_BASE_ADDRESS, 0);
31 set_ioapic_id((u8 *)IOXAPIC1_BASE_ADDRESS, 8);
32
33 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 9,
34 IOXAPIC2_BASE_ADDRESS, 24);
35 set_ioapic_id((u8 *)IOXAPIC2_BASE_ADDRESS, 9);
36
37 current = acpi_madt_irq_overrides(current);
38
39 for (i = 0; i < 16; i++)
40 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current, i, 0xD, 1);
41
42 return current;
43}