blob: c5293dc9dd190205fd712fb4504b19f5741074d9 [file] [log] [blame]
Aaron Durbinf6933a62012-10-30 09:09:39 -05001/*
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 Durbinf6933a62012-10-30 09:09:39 -050014 */
15
16#include <types.h>
17#include <string.h>
Aaron Durbinf6933a62012-10-30 09:09:39 -050018#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 Durbinf6933a62012-10-30 09:09:39 -050024#include <vendorcode/google/chromeos/gnvs.h>
25
Aaron Durbinf6933a62012-10-30 09:09:39 -050026#include <southbridge/intel/lynxpoint/pch.h>
27#include <southbridge/intel/lynxpoint/nvs.h>
28#include "thermal.h"
29
30static 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 Serbinenkoc6e566a2014-08-31 17:43:51 +020057void acpi_create_gnvs(global_nvs_t *gnvs)
Aaron Durbinf6933a62012-10-30 09:09:39 -050058{
Aaron Durbinf6933a62012-10-30 09:09:39 -050059 /* 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 Laurief6763db2013-03-22 11:01:37 -070070 /* TPM Present */
71 gnvs->tpmp = 1;
72
Aaron Durbinf6933a62012-10-30 09:09:39 -050073
Martin Roth356b5192017-06-24 21:53:37 -060074#if IS_ENABLED(CONFIG_CHROMEOS)
Aaron Durbinf6933a62012-10-30 09:09:39 -050075 /* Emerald Lake has no EC (?) */
76 gnvs->chromeos.vbt2 = ACTIVE_ECFW_RO;
77#endif
78
79 acpi_update_thermal_table(gnvs);
80}