blob: 397d310a9948d40945d1281f5531559d9f62d19d [file] [log] [blame]
Rudolf Marek05839972008-09-23 20:36:03 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Written by Stefan Reinauer <stepan@openbios.org>.
Stefan Reinauer14e22772010-04-27 06:56:47 +00005 * ACPI FADT, FACS, and DSDT table support added by
Rudolf Marek05839972008-09-23 20:36:03 +00006 *
7 * Copyright (C) 2004 Stefan Reinauer <stepan@openbios.org>
8 * Copyright (C) 2005 Nick Barker <nick.barker9@btinternet.com>
Rudolf Marek79e53252008-12-23 17:34:15 +00009 * Copyright (C) 2007, 2008 Rudolf Marek <r.marek@assembler.cz>
Rudolf Marek05839972008-09-23 20:36:03 +000010 *
11 * This program is free software; you can redistribute it and/or modify
Uwe Hermannc70e9fc2010-02-15 23:10:19 +000012 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; version 2 of the License.
Rudolf Marek05839972008-09-23 20:36:03 +000014 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
Rudolf Marek05839972008-09-23 20:36:03 +000019 */
20
21#include <console/console.h>
22#include <string.h>
23#include <arch/acpi.h>
Tobias Diedrich0fe6e9a2010-11-17 16:27:06 +000024#include <arch/acpigen.h>
Rudolf Marek05839972008-09-23 20:36:03 +000025#include <arch/smp/mpspec.h>
Uwe Hermann74d1a6e2010-10-12 17:34:08 +000026#include <arch/ioapic.h>
Rudolf Marek05839972008-09-23 20:36:03 +000027#include <device/device.h>
28#include <device/pci_ids.h>
Uwe Hermann5df41682010-09-25 16:17:20 +000029#include "southbridge/via/vt8237r/vt8237r.h"
30#include "southbridge/via/k8t890/k8t890.h"
stepan8301d832010-12-08 07:07:33 +000031#include "northbridge/amd/amdk8/acpi.h"
Vladimir Serbinenko47432542014-10-05 14:54:26 +020032#include <cpu/amd/powernow.h>
Vladimir Serbinenko6985d4e2014-09-21 14:31:19 +020033#include <cpu/amd/amdk8_sysconf.h>
Rudolf Marek05839972008-09-23 20:36:03 +000034
Vladimir Serbinenko6985d4e2014-09-21 14:31:19 +020035void get_bus_conf(void)
Rudolf Marek05839972008-09-23 20:36:03 +000036{
Vladimir Serbinenko6985d4e2014-09-21 14:31:19 +020037 /* FIXME: implement this. */
Rudolf Marek05839972008-09-23 20:36:03 +000038}
39
40unsigned long acpi_fill_madt(unsigned long current)
41{
42 unsigned int gsi_base = 0x18;
43
44 /* Create all subtables for processors. */
45 current = acpi_create_madt_lapics(current);
46
47 /* Write SB IOAPIC. */
48 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
Uwe Hermann74d1a6e2010-10-12 17:34:08 +000049 VT8237R_APIC_ID, IO_APIC_ADDR, 0);
Rudolf Marek05839972008-09-23 20:36:03 +000050
51 /* Write NB IOAPIC. */
52 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
53 K8T890_APIC_ID, K8T890_APIC_BASE, gsi_base);
54
55 /* IRQ9 ACPI active low. */
56 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
57 current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW);
58
59 /* IRQ0 -> APIC IRQ2. */
60 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
Stefan Reinauer14e22772010-04-27 06:56:47 +000061 current, 0, 0, 2, 0x0);
Rudolf Marek05839972008-09-23 20:36:03 +000062
63 /* Create all subtables for processors. */
64 current = acpi_create_madt_lapic_nmis(current,
65 MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH, 1);
66
67 return current;
68}