blob: 591d934829fc5c32c705893ab132618ca4a3245a [file] [log] [blame]
Lee Leahy5cb9dda2015-05-01 10:34:54 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 Google Inc.
5 * Copyright (C) 2015 Intel Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Lee Leahy5cb9dda2015-05-01 10:34:54 -070015 */
16
17#include <arch/acpi.h>
18#include <arch/acpigen.h>
19#include <arch/ioapic.h>
20#include <arch/smp/mpspec.h>
21#include <cbmem.h>
22#include <console/console.h>
23#include <cpu/cpu.h>
24#include <cpu/x86/msr.h>
25#include <device/device.h>
26#include <device/pci.h>
27#include <device/pci_ids.h>
28#include <soc/acpi.h>
29#include <soc/iomap.h>
30#include <soc/nvs.h>
31#include <string.h>
32#include <types.h>
33#include <boardid.h>
34#include "onboard.h"
35
36void acpi_create_gnvs(global_nvs_t *gnvs)
37{
38 acpi_init_gnvs(gnvs);
39
40 /* Enable USB ports in S3 */
41 gnvs->s3u0 = 1;
42 gnvs->s3u1 = 1;
43
44 /* Disable USB ports in S5 */
45 gnvs->s5u0 = 0;
46 gnvs->s5u1 = 0;
47
48 /* Enable DPTF */
49 gnvs->dpte = 1;
Hannah Williams103f00d2016-01-25 14:36:56 -080050
51 /* PMIC is configured in I2C1, hidden it from OS */
52 gnvs->dev.lpss_en[LPSS_NVS_I2C2] = 0;
Lee Leahy5cb9dda2015-05-01 10:34:54 -070053}
54
55unsigned long acpi_fill_madt(unsigned long current)
56{
57 /* Local APICs */
58 current = acpi_create_madt_lapics(current);
59
60 /* IOAPIC */
61 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
62 2, IO_APIC_ADDR, 0);
63
64 current = acpi_madt_irq_overrides(current);
65
66 return current;
67}