blob: 38622799289d447d771b5645f7d62193d80fbb17 [file] [log] [blame]
Dave Frodin892d1292013-12-11 12:38:40 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
5 * Copyright (C) 2013 Sage Electronic Engineering, LLC
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.
Dave Frodin892d1292013-12-11 12:38:40 -070015 */
16
17#include <console/console.h>
18#include <string.h>
19#include <arch/acpi.h>
20#include <arch/acpigen.h>
21#include <arch/ioapic.h>
22#include <device/pci.h>
23#include <device/pci_ids.h>
24#include <cpu/x86/msr.h>
Kyösti Mälkkif21c2ac2014-10-19 09:35:18 +030025#include <northbridge/amd/agesa/agesawrapper.h>
Dave Frodin892d1292013-12-11 12:38:40 -070026#include <cpu/amd/mtrr.h>
27#include <cpu/amd/amdfam14.h>
28
Dave Frodin892d1292013-12-11 12:38:40 -070029unsigned long acpi_fill_madt(unsigned long current)
30{
31 /* create all subtables for processors */
32 current = acpi_create_madt_lapics(current);
33
34 /* Write SB800 IOAPIC, only one */
35 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
36 CONFIG_MAX_CPUS, IO_APIC_ADDR, 0);
37
38 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
39 current, 0, 0, 2, 0);
40 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
41 current, 0, 9, 9, 0xF);
42
43 /* 0: mean bus 0--->ISA */
44 /* 0: PIC 0 */
45 /* 2: APIC 2 */
Kyösti Mälkkid8747572014-06-26 05:30:54 +030046 /* 5 mean: 0101 --> Edge-triggered, Active high */
Dave Frodin892d1292013-12-11 12:38:40 -070047
48 /* create all subtables for processors */
49 /* current = acpi_create_madt_lapic_nmis(current, 5, 1); */
50 /* 1: LINT1 connect to NMI */
51
52 return current;
53}