Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2009 coresystems GmbH |
| 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> |
| 32 | #include <cpu/x86/msr.h> |
| 33 | |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 34 | #include <southbridge/intel/bd82x6x/pch.h> |
| 35 | #include <southbridge/intel/bd82x6x/nvs.h> |
| 36 | #include "thermal.h" |
| 37 | |
| 38 | static void acpi_update_thermal_table(global_nvs_t *gnvs) |
| 39 | { |
| 40 | gnvs->tcrt = CRITICAL_TEMPERATURE; |
| 41 | gnvs->tpsv = PASSIVE_TEMPERATURE; |
| 42 | } |
| 43 | |
Vladimir Serbinenko | 35c0f43 | 2014-09-02 22:25:36 +0200 | [diff] [blame^] | 44 | void acpi_create_gnvs(global_nvs_t *gnvs) |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 45 | { |
| 46 | memset((void *)gnvs, 0, sizeof(*gnvs)); |
| 47 | gnvs->apic = 1; |
| 48 | gnvs->mpen = 1; /* Enable Multi Processing */ |
| 49 | gnvs->pcnt = dev_count_cpu(); |
| 50 | |
| 51 | /* Disable USB ports in S3 by default */ |
| 52 | gnvs->s3u0 = 0; |
| 53 | gnvs->s3u1 = 0; |
| 54 | |
| 55 | /* Disable USB ports in S5 by default */ |
| 56 | gnvs->s5u0 = 0; |
| 57 | gnvs->s5u1 = 0; |
| 58 | |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 59 | /* IGD Displays */ |
| 60 | gnvs->ndid = 3; |
| 61 | gnvs->did[0] = 0x80000100; |
| 62 | gnvs->did[1] = 0x80000240; |
| 63 | gnvs->did[2] = 0x80000410; |
| 64 | gnvs->did[3] = 0x80000410; |
| 65 | gnvs->did[4] = 0x00000005; |
| 66 | |
| 67 | // the lid is open by default. |
| 68 | gnvs->lids = 1; |
| 69 | |
| 70 | acpi_update_thermal_table(gnvs); |
| 71 | } |
| 72 | |
| 73 | unsigned long acpi_fill_madt(unsigned long current) |
| 74 | { |
| 75 | /* Local APICs */ |
| 76 | current = acpi_create_madt_lapics(current); |
| 77 | |
| 78 | /* IOAPIC */ |
| 79 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, |
| 80 | 2, IO_APIC_ADDR, 0); |
| 81 | |
| 82 | /* INT_SRC_OVR */ |
| 83 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 84 | current, 0, 0, 2, 0); |
| 85 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 86 | current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_HIGH); |
| 87 | |
| 88 | return current; |
| 89 | } |
| 90 | |
Vladimir Serbinenko | e7e9502 | 2014-01-12 15:26:15 +0100 | [diff] [blame] | 91 | unsigned long acpi_fill_slit(unsigned long current) |
| 92 | { |
| 93 | // Not implemented |
| 94 | return current; |
| 95 | } |
| 96 | |
| 97 | unsigned long acpi_fill_srat(unsigned long current) |
| 98 | { |
| 99 | /* No NUMA, no SRAT */ |
| 100 | return current; |
| 101 | } |