Lee Leahy | 5cb9dda | 2015-05-01 10:34:54 -0700 | [diff] [blame] | 1 | /* |
| 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 Leahy | 5cb9dda | 2015-05-01 10:34:54 -0700 | [diff] [blame] | 15 | */ |
| 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 | |
| 36 | void 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; |
| 50 | if (board_id() == BOARD_BCRD2) |
| 51 | gnvs->dev.lpss_en[LPSS_NVS_I2C2] = 0; |
| 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 | |
| 63 | current = acpi_madt_irq_overrides(current); |
| 64 | |
| 65 | return current; |
| 66 | } |