Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Written by Stefan Reinauer <stepan@openbios.org>. |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 5 | * ACPI FADT, FACS, and DSDT table support added by |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 6 | * |
| 7 | * Copyright (C) 2004 Stefan Reinauer <stepan@openbios.org> |
| 8 | * Copyright (C) 2005 Nick Barker <nick.barker9@btinternet.com> |
Rudolf Marek | 79e5325 | 2008-12-23 17:34:15 +0000 | [diff] [blame] | 9 | * Copyright (C) 2007, 2008 Rudolf Marek <r.marek@assembler.cz> |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
Uwe Hermann | c70e9fc | 2010-02-15 23:10:19 +0000 | [diff] [blame] | 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; version 2 of the License. |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 14 | * |
| 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. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program; if not, write to the Free Software |
Paul Menzel | a46a712 | 2013-02-23 18:37:27 +0100 | [diff] [blame] | 22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 23 | */ |
| 24 | |
| 25 | #include <console/console.h> |
| 26 | #include <string.h> |
| 27 | #include <arch/acpi.h> |
Tobias Diedrich | 0fe6e9a | 2010-11-17 16:27:06 +0000 | [diff] [blame] | 28 | #include <arch/acpigen.h> |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 29 | #include <arch/smp/mpspec.h> |
Uwe Hermann | 74d1a6e | 2010-10-12 17:34:08 +0000 | [diff] [blame] | 30 | #include <arch/ioapic.h> |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 31 | #include <device/device.h> |
| 32 | #include <device/pci_ids.h> |
Uwe Hermann | 5df4168 | 2010-09-25 16:17:20 +0000 | [diff] [blame] | 33 | #include "southbridge/via/vt8237r/vt8237r.h" |
| 34 | #include "southbridge/via/k8t890/k8t890.h" |
stepan | 8301d83 | 2010-12-08 07:07:33 +0000 | [diff] [blame] | 35 | #include "northbridge/amd/amdk8/acpi.h" |
Vladimir Serbinenko | 4743254 | 2014-10-05 14:54:26 +0200 | [diff] [blame^] | 36 | #include <cpu/amd/powernow.h> |
Vladimir Serbinenko | 6985d4e | 2014-09-21 14:31:19 +0200 | [diff] [blame] | 37 | #include <cpu/amd/amdk8_sysconf.h> |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 38 | |
Vladimir Serbinenko | 6985d4e | 2014-09-21 14:31:19 +0200 | [diff] [blame] | 39 | void get_bus_conf(void) |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 40 | { |
Vladimir Serbinenko | 6985d4e | 2014-09-21 14:31:19 +0200 | [diff] [blame] | 41 | /* FIXME: implement this. */ |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | unsigned long acpi_fill_madt(unsigned long current) |
| 45 | { |
| 46 | unsigned int gsi_base = 0x18; |
| 47 | |
| 48 | /* Create all subtables for processors. */ |
| 49 | current = acpi_create_madt_lapics(current); |
| 50 | |
| 51 | /* Write SB IOAPIC. */ |
| 52 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, |
Uwe Hermann | 74d1a6e | 2010-10-12 17:34:08 +0000 | [diff] [blame] | 53 | VT8237R_APIC_ID, IO_APIC_ADDR, 0); |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 54 | |
| 55 | /* Write NB IOAPIC. */ |
| 56 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, |
| 57 | K8T890_APIC_ID, K8T890_APIC_BASE, gsi_base); |
| 58 | |
| 59 | /* IRQ9 ACPI active low. */ |
| 60 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 61 | current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW); |
| 62 | |
| 63 | /* IRQ0 -> APIC IRQ2. */ |
| 64 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 65 | current, 0, 0, 2, 0x0); |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 66 | |
| 67 | /* Create all subtables for processors. */ |
| 68 | current = acpi_create_madt_lapic_nmis(current, |
| 69 | MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH, 1); |
| 70 | |
| 71 | return current; |
| 72 | } |