Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [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. |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <types.h> |
| 17 | #include <string.h> |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 18 | #include <arch/acpi.h> |
| 19 | #include <arch/ioapic.h> |
| 20 | #include <arch/acpigen.h> |
| 21 | #include <arch/smp/mpspec.h> |
| 22 | #include <device/device.h> |
| 23 | #include <device/pci.h> |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 24 | #include <vendorcode/google/chromeos/gnvs.h> |
| 25 | |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 26 | #include <southbridge/intel/lynxpoint/pch.h> |
| 27 | #include <southbridge/intel/lynxpoint/nvs.h> |
| 28 | #include "thermal.h" |
| 29 | |
| 30 | static void acpi_update_thermal_table(global_nvs_t *gnvs) |
| 31 | { |
| 32 | gnvs->f4of = FAN4_THRESHOLD_OFF; |
| 33 | gnvs->f4on = FAN4_THRESHOLD_ON; |
| 34 | gnvs->f4pw = FAN4_PWM; |
| 35 | |
| 36 | gnvs->f3of = FAN3_THRESHOLD_OFF; |
| 37 | gnvs->f3on = FAN3_THRESHOLD_ON; |
| 38 | gnvs->f3pw = FAN3_PWM; |
| 39 | |
| 40 | gnvs->f2of = FAN2_THRESHOLD_OFF; |
| 41 | gnvs->f2on = FAN2_THRESHOLD_ON; |
| 42 | gnvs->f2pw = FAN2_PWM; |
| 43 | |
| 44 | gnvs->f1of = FAN1_THRESHOLD_OFF; |
| 45 | gnvs->f1on = FAN1_THRESHOLD_ON; |
| 46 | gnvs->f1pw = FAN1_PWM; |
| 47 | |
| 48 | gnvs->f0of = FAN0_THRESHOLD_OFF; |
| 49 | gnvs->f0on = FAN0_THRESHOLD_ON; |
| 50 | gnvs->f0pw = FAN0_PWM; |
| 51 | |
| 52 | gnvs->tcrt = CRITICAL_TEMPERATURE; |
| 53 | gnvs->tpsv = PASSIVE_TEMPERATURE; |
| 54 | gnvs->tmax = MAX_TEMPERATURE; |
| 55 | } |
| 56 | |
Vladimir Serbinenko | c6e566a | 2014-08-31 17:43:51 +0200 | [diff] [blame] | 57 | void acpi_create_gnvs(global_nvs_t *gnvs) |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 58 | { |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 59 | /* Enable USB ports in S3 */ |
| 60 | gnvs->s3u0 = 1; |
| 61 | gnvs->s3u1 = 1; |
| 62 | |
| 63 | /* |
| 64 | * Enable Front USB ports in S5 by default |
| 65 | * to be consistent with back port behavior |
| 66 | */ |
| 67 | gnvs->s5u0 = 1; |
| 68 | gnvs->s5u1 = 1; |
| 69 | |
Duncan Laurie | f6763db | 2013-03-22 11:01:37 -0700 | [diff] [blame] | 70 | /* TPM Present */ |
| 71 | gnvs->tpmp = 1; |
| 72 | |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 73 | |
Martin Roth | 356b519 | 2017-06-24 21:53:37 -0600 | [diff] [blame] | 74 | #if IS_ENABLED(CONFIG_CHROMEOS) |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 75 | /* Emerald Lake has no EC (?) */ |
| 76 | gnvs->chromeos.vbt2 = ACTIVE_ECFW_RO; |
| 77 | #endif |
| 78 | |
| 79 | acpi_update_thermal_table(gnvs); |
| 80 | } |