blob: a40e86fe00f63d6d45b8fc1c8c5f6dedab7a47b5 [file] [log] [blame]
Siyuan Wang80cf7d52013-07-09 17:42:43 +08001/*
2 * This file is part of the coreboot project.
3 *
Siyuan Wang80cf7d52013-07-09 17:42:43 +08004 *
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 Wang80cf7d52013-07-09 17:42:43 +080013 */
14
Siyuan Wang80cf7d52013-07-09 17:42:43 +080015#include <arch/acpi.h>
Siyuan Wang80cf7d52013-07-09 17:42:43 +080016#include <arch/ioapic.h>
Siyuan Wang80cf7d52013-07-09 17:42:43 +080017
Siyuan Wang80cf7d52013-07-09 17:42:43 +080018unsigned 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älkkid8747572014-06-26 05:30:54 +030038 /* 5 mean: 0101 --> Edge-triggered, Active high */
Siyuan Wang80cf7d52013-07-09 17:42:43 +080039
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}