Marc Jones | 3b0a626 | 2015-09-15 23:05:00 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 The Chromium OS Authors. All rights reserved. |
| 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. |
Marc Jones | 3b0a626 | 2015-09-15 23:05:00 -0600 | [diff] [blame] | 14 | */ |
| 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> |
Marc Jones | 3b0a626 | 2015-09-15 23:05:00 -0600 | [diff] [blame] | 27 | |
| 28 | #include <southbridge/intel/fsp_i89xx/pch.h> |
| 29 | #include <southbridge/intel/fsp_i89xx/nvs.h> |
| 30 | #include "thermal.h" |
| 31 | |
| 32 | static global_nvs_t *gnvs_; |
| 33 | |
| 34 | static void acpi_update_thermal_table(global_nvs_t *gnvs) |
| 35 | { |
| 36 | |
| 37 | } |
| 38 | |
| 39 | void acpi_create_gnvs(global_nvs_t *gnvs) |
| 40 | { |
| 41 | gnvs_ = gnvs; |
| 42 | memset((void *)gnvs, 0, sizeof(*gnvs)); |
| 43 | gnvs->apic = 1; |
| 44 | gnvs->mpen = 1; /* Enable Multi Processing */ |
| 45 | gnvs->pcnt = dev_count_cpu(); |
| 46 | |
| 47 | /* Enable USB ports in S3 */ |
| 48 | gnvs->s3u0 = 0; |
| 49 | gnvs->s3u1 = 0; |
| 50 | |
| 51 | /* |
| 52 | * Enable USB ports in S5 by default |
| 53 | * to be consistent with back port behavior |
| 54 | */ |
| 55 | gnvs->s5u0 = 1; |
| 56 | gnvs->s5u1 = 1; |
| 57 | |
| 58 | acpi_update_thermal_table(gnvs); |
| 59 | } |
| 60 | |
| 61 | unsigned long acpi_fill_madt(unsigned long current) |
| 62 | { |
| 63 | /* Local APICs */ |
| 64 | current = acpi_create_madt_lapics(current); |
| 65 | |
| 66 | /* IOAPIC */ |
| 67 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, |
| 68 | 2, IO_APIC_ADDR, 0); |
| 69 | |
| 70 | /* INT_SRC_OVR */ |
| 71 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 72 | current, 0, 0, 2, 0); |
| 73 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 74 | current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_HIGH); |
| 75 | |
| 76 | return current; |
| 77 | } |