blob: 3f8a4aecd483f7b528d4a1412175736da020774e [file] [log] [blame]
Frank Vibrans69da1b62011-02-14 19:04:45 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Frank Vibrans69da1b62011-02-14 19:04:45 +000014 */
15
16#include <console/console.h>
17#include <string.h>
18#include <arch/acpi.h>
Kerry Sheh01f7ab92012-01-19 13:18:36 +080019#include <arch/acpigen.h>
Frank Vibrans69da1b62011-02-14 19:04:45 +000020#include <arch/ioapic.h>
Frank Vibrans69da1b62011-02-14 19:04:45 +000021#include <device/pci.h>
22#include <device/pci_ids.h>
Marc Jones84e0dfc2011-12-12 21:12:43 -070023#include <cpu/amd/amdfam14.h>
Frank Vibrans69da1b62011-02-14 19:04:45 +000024
Frank Vibrans69da1b62011-02-14 19:04:45 +000025unsigned long acpi_fill_madt(unsigned long current)
26{
Marc Jones522ba282012-01-03 16:02:07 -070027 /* create all subtables for processors */
Marc Jones84e0dfc2011-12-12 21:12:43 -070028 current = acpi_create_madt_lapics(current);
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070029
Marc Jones522ba282012-01-03 16:02:07 -070030 /* Write SB800 IOAPIC, only one */
Marc Jones84e0dfc2011-12-12 21:12:43 -070031 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
Kerry Shehf03360f2012-01-19 13:25:55 +080032 CONFIG_MAX_CPUS, IO_APIC_ADDR, 0);
Frank Vibrans69da1b62011-02-14 19:04:45 +000033
Marc Jones522ba282012-01-03 16:02:07 -070034 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
35 current, 0, 0, 2, 0);
Marc Jones84e0dfc2011-12-12 21:12:43 -070036 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
37 current, 0, 9, 9, 0xF);
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070038
Marc Jones522ba282012-01-03 16:02:07 -070039 /* 0: mean bus 0--->ISA */
40 /* 0: PIC 0 */
41 /* 2: APIC 2 */
Kyösti Mälkkid8747572014-06-26 05:30:54 +030042 /* 5 mean: 0101 --> Edge-triggered, Active high */
Frank Vibrans69da1b62011-02-14 19:04:45 +000043
Marc Jones522ba282012-01-03 16:02:07 -070044 /* create all subtables for processors */
Marc Jones84e0dfc2011-12-12 21:12:43 -070045 /* current = acpi_create_madt_lapic_nmis(current, 5, 1); */
Marc Jones522ba282012-01-03 16:02:07 -070046 /* 1: LINT1 connect to NMI */
Frank Vibrans69da1b62011-02-14 19:04:45 +000047
Marc Jones522ba282012-01-03 16:02:07 -070048 return current;
Frank Vibrans69da1b62011-02-14 19:04:45 +000049}