Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Google 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. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #include <types.h> |
| 21 | #include <string.h> |
| 22 | #include <cbmem.h> |
| 23 | #include <console/console.h> |
| 24 | #include <arch/acpi.h> |
| 25 | #include <arch/ioapic.h> |
| 26 | #include <arch/acpigen.h> |
| 27 | #include <arch/smp/mpspec.h> |
| 28 | #include <device/device.h> |
| 29 | #include <device/pci.h> |
| 30 | #include <device/pci_ids.h> |
| 31 | #include <cpu/cpu.h> |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame^] | 32 | #include <broadwell/acpi.h> |
| 33 | #include <broadwell/nvs.h> |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 34 | #include "thermal.h" |
| 35 | |
Vladimir Serbinenko | c6e566a | 2014-08-31 17:43:51 +0200 | [diff] [blame] | 36 | void acpi_create_gnvs(global_nvs_t *gnvs) |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 37 | { |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame^] | 38 | acpi_init_gnvs(gnvs); |
| 39 | |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 40 | /* Enable USB ports in S3 */ |
| 41 | gnvs->s3u0 = 1; |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 42 | |
| 43 | /* Disable USB ports in S5 */ |
| 44 | gnvs->s5u0 = 0; |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 45 | |
Duncan Laurie | f6763db | 2013-03-22 11:01:37 -0700 | [diff] [blame] | 46 | /* TPM Present */ |
| 47 | gnvs->tpmp = 1; |
| 48 | |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame^] | 49 | gnvs->tcrt = CRITICAL_TEMPERATURE; |
| 50 | gnvs->tpsv = PASSIVE_TEMPERATURE; |
| 51 | gnvs->tmax = MAX_TEMPERATURE; |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | unsigned long acpi_fill_madt(unsigned long current) |
| 55 | { |
| 56 | /* Local APICs */ |
| 57 | current = acpi_create_madt_lapics(current); |
| 58 | |
| 59 | /* IOAPIC */ |
| 60 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, |
| 61 | 2, IO_APIC_ADDR, 0); |
| 62 | |
Duncan Laurie | 0aa06cb | 2014-05-14 17:03:15 -0700 | [diff] [blame^] | 63 | return acpi_madt_irq_overrides(current); |
Duncan Laurie | afad056 | 2013-01-14 08:50:03 -0800 | [diff] [blame] | 64 | } |