blob: 243a4a621d43331b43fa9e2b26fb46a3bc29c1d9 [file] [log] [blame]
Angel Pons5c596802020-04-03 01:21:01 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Siyuan Wang80cf7d52013-07-09 17:42:43 +08003
Siyuan Wang80cf7d52013-07-09 17:42:43 +08004#include <arch/acpi.h>
Siyuan Wang80cf7d52013-07-09 17:42:43 +08005#include <arch/ioapic.h>
Siyuan Wang80cf7d52013-07-09 17:42:43 +08006
Siyuan Wang80cf7d52013-07-09 17:42:43 +08007unsigned long acpi_fill_madt(unsigned long current)
8{
9 /* create all subtables for processors */
10 current = acpi_create_madt_lapics(current);
11
12 /* Write SB800 IOAPIC, only one */
13 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, CONFIG_MAX_CPUS,
14 IO_APIC_ADDR, 0);
15
16 /* TODO: Remove the hardcode */
17 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, CONFIG_MAX_CPUS+1,
18 0xFEC20000, 24);
19
20 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
21 current, 0, 0, 2, 0);
22 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
23 current, 0, 9, 9, 0xF);
24 /* 0: mean bus 0--->ISA */
25 /* 0: PIC 0 */
26 /* 2: APIC 2 */
Kyösti Mälkkid8747572014-06-26 05:30:54 +030027 /* 5 mean: 0101 --> Edge-triggered, Active high */
Siyuan Wang80cf7d52013-07-09 17:42:43 +080028
29 /* create all subtables for processors */
30 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current, 0xff, 5, 1);
31 /* 1: LINT1 connect to NMI */
32
33 return current;
34}