blob: b6c0f9aeefb4c205a69e2029a42ae37339161a3e [file] [log] [blame]
Duncan Laurieafad0562013-01-14 08:50:03 -08001/*
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 Laurie0aa06cb2014-05-14 17:03:15 -070032#include <broadwell/acpi.h>
33#include <broadwell/nvs.h>
Duncan Laurieafad0562013-01-14 08:50:03 -080034#include "thermal.h"
35
Vladimir Serbinenkoc6e566a2014-08-31 17:43:51 +020036void acpi_create_gnvs(global_nvs_t *gnvs)
Duncan Laurieafad0562013-01-14 08:50:03 -080037{
Duncan Laurie0aa06cb2014-05-14 17:03:15 -070038 acpi_init_gnvs(gnvs);
39
Duncan Laurieafad0562013-01-14 08:50:03 -080040 /* Enable USB ports in S3 */
41 gnvs->s3u0 = 1;
Duncan Laurieafad0562013-01-14 08:50:03 -080042
43 /* Disable USB ports in S5 */
44 gnvs->s5u0 = 0;
Duncan Laurieafad0562013-01-14 08:50:03 -080045
Duncan Laurief6763db2013-03-22 11:01:37 -070046 /* TPM Present */
47 gnvs->tpmp = 1;
48
Duncan Laurie0aa06cb2014-05-14 17:03:15 -070049 gnvs->tcrt = CRITICAL_TEMPERATURE;
50 gnvs->tpsv = PASSIVE_TEMPERATURE;
51 gnvs->tmax = MAX_TEMPERATURE;
Duncan Laurieafad0562013-01-14 08:50:03 -080052}
53
54unsigned 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 Laurie0aa06cb2014-05-14 17:03:15 -070063 return acpi_madt_irq_overrides(current);
Duncan Laurieafad0562013-01-14 08:50:03 -080064}