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. |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 19 | */ |
| 20 | |
| 21 | #include <console/console.h> |
| 22 | #include <string.h> |
| 23 | #include <arch/acpi.h> |
Tobias Diedrich | 0fe6e9a | 2010-11-17 16:27:06 +0000 | [diff] [blame] | 24 | #include <arch/acpigen.h> |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 25 | #include <arch/smp/mpspec.h> |
Uwe Hermann | 74d1a6e | 2010-10-12 17:34:08 +0000 | [diff] [blame] | 26 | #include <arch/ioapic.h> |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 27 | #include <device/device.h> |
| 28 | #include <device/pci_ids.h> |
Uwe Hermann | 5df4168 | 2010-09-25 16:17:20 +0000 | [diff] [blame] | 29 | #include "southbridge/via/vt8237r/vt8237r.h" |
| 30 | #include "southbridge/via/k8t890/k8t890.h" |
stepan | 8301d83 | 2010-12-08 07:07:33 +0000 | [diff] [blame] | 31 | #include "northbridge/amd/amdk8/acpi.h" |
Vladimir Serbinenko | 4743254 | 2014-10-05 14:54:26 +0200 | [diff] [blame] | 32 | #include <cpu/amd/powernow.h> |
Vladimir Serbinenko | 6985d4e | 2014-09-21 14:31:19 +0200 | [diff] [blame] | 33 | #include <cpu/amd/amdk8_sysconf.h> |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 34 | |
Vladimir Serbinenko | 6985d4e | 2014-09-21 14:31:19 +0200 | [diff] [blame] | 35 | void get_bus_conf(void) |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 36 | { |
Vladimir Serbinenko | 6985d4e | 2014-09-21 14:31:19 +0200 | [diff] [blame] | 37 | /* FIXME: implement this. */ |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | unsigned 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 Hermann | 74d1a6e | 2010-10-12 17:34:08 +0000 | [diff] [blame] | 49 | VT8237R_APIC_ID, IO_APIC_ADDR, 0); |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 50 | |
| 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 Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 61 | current, 0, 0, 2, 0x0); |
Rudolf Marek | 0583997 | 2008-09-23 20:36:03 +0000 | [diff] [blame] | 62 | |
| 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 | } |