blob: ec3cc20563204a177ce70a289184a578f17584d8 [file] [log] [blame]
Wang Qing Pei0ede4c02010-08-17 15:19:32 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2010 Wang Qing Pei <wangqingpei@gmail.com>
5 * Copyright (C) 2010 Advanced Micro Devices, Inc.
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.
Wang Qing Pei0ede4c02010-08-17 15:19:32 +000015 */
16
17#include <console/console.h>
18#include <string.h>
19#include <arch/acpi.h>
Uwe Hermann74d1a6e2010-10-12 17:34:08 +000020#include <arch/ioapic.h>
Wang Qing Pei0ede4c02010-08-17 15:19:32 +000021#include <device/pci.h>
22#include <device/pci_ids.h>
23#include <cpu/x86/msr.h>
24#include <cpu/amd/mtrr.h>
25#include <cpu/amd/amdfam10_sysconf.h>
26
Wang Qing Pei0ede4c02010-08-17 15:19:32 +000027unsigned long acpi_fill_madt(unsigned long current)
28{
29 /* create all subtables for processors */
30 current = acpi_create_madt_lapics(current);
31
32 /* Write SB700 IOAPIC, only one */
33 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 2,
34 IO_APIC_ADDR, 0);
35
36 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
37 current, 0, 0, 2, 0);
38 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
39 current, 0, 9, 9, 0xF);
40 /* 0: mean bus 0--->ISA */
41 /* 0: PIC 0 */
42 /* 2: APIC 2 */
Kyösti Mälkkid8747572014-06-26 05:30:54 +030043 /* 5 mean: 0101 --> Edge-triggered, Active high */
Wang Qing Pei0ede4c02010-08-17 15:19:32 +000044
45 /* create all subtables for processors */
46 /* current = acpi_create_madt_lapic_nmis(current, 5, 1); */
47 /* 1: LINT1 connect to NMI */
48
49 return current;
50}