blob: 35ba78e95c71f87c1aa1a0e669fe661db3f50e93 [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.
Duncan Laurieafad0562013-01-14 08:50:03 -080014 */
15
16#include <types.h>
17#include <string.h>
18#include <cbmem.h>
19#include <console/console.h>
20#include <arch/acpi.h>
21#include <arch/ioapic.h>
22#include <arch/acpigen.h>
23#include <arch/smp/mpspec.h>
24#include <device/device.h>
25#include <device/pci.h>
26#include <device/pci_ids.h>
Julius Werner4ee4bd52014-10-20 13:46:39 -070027#include <soc/acpi.h>
28#include <soc/nvs.h>
Duncan Laurieafad0562013-01-14 08:50:03 -080029#include "thermal.h"
30
Vladimir Serbinenkoc6e566a2014-08-31 17:43:51 +020031void acpi_create_gnvs(global_nvs_t *gnvs)
Duncan Laurieafad0562013-01-14 08:50:03 -080032{
Duncan Laurie0aa06cb2014-05-14 17:03:15 -070033 acpi_init_gnvs(gnvs);
34
Duncan Laurieafad0562013-01-14 08:50:03 -080035 /* Enable USB ports in S3 */
36 gnvs->s3u0 = 1;
Duncan Laurieafad0562013-01-14 08:50:03 -080037
38 /* Disable USB ports in S5 */
39 gnvs->s5u0 = 0;
Duncan Laurieafad0562013-01-14 08:50:03 -080040
Duncan Laurie0aa06cb2014-05-14 17:03:15 -070041 gnvs->tcrt = CRITICAL_TEMPERATURE;
42 gnvs->tpsv = PASSIVE_TEMPERATURE;
43 gnvs->tmax = MAX_TEMPERATURE;
Duncan Laurieafad0562013-01-14 08:50:03 -080044}
45
46unsigned long acpi_fill_madt(unsigned long current)
47{
48 /* Local APICs */
49 current = acpi_create_madt_lapics(current);
50
51 /* IOAPIC */
52 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
53 2, IO_APIC_ADDR, 0);
54
Duncan Laurie0aa06cb2014-05-14 17:03:15 -070055 return acpi_madt_irq_overrides(current);
Duncan Laurieafad0562013-01-14 08:50:03 -080056}