blob: 828546c1b15bf7243fb94c88e440d2613d8d10ff [file] [log] [blame]
Stefan Reinauer155e9b52012-04-27 23:19:58 +02001/*
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.
Stefan Reinauer155e9b52012-04-27 23:19:58 +020014 */
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>
Stefan Reinauer155e9b52012-04-27 23:19:58 +020027#include <ec/acpi/ec.h>
Kyösti Mälkkib67d99c2013-08-18 18:08:40 +030028#if CONFIG_CHROMEOS
Stefan Reinauer155e9b52012-04-27 23:19:58 +020029#include <vendorcode/google/chromeos/gnvs.h>
Kyösti Mälkkib67d99c2013-08-18 18:08:40 +030030#endif
Stefan Reinauer155e9b52012-04-27 23:19:58 +020031
Stefan Reinauer155e9b52012-04-27 23:19:58 +020032#include "southbridge/intel/bd82x6x/nvs.h"
33#include "thermal.h"
34
35static global_nvs_t *gnvs_;
36
37static void acpi_update_thermal_table(global_nvs_t *gnvs)
38{
39 gnvs->f4of = FAN4_THRESHOLD_OFF;
40 gnvs->f4on = FAN4_THRESHOLD_ON;
41
42 gnvs->f3of = FAN3_THRESHOLD_OFF;
43 gnvs->f3on = FAN3_THRESHOLD_ON;
44
45 gnvs->f2of = FAN2_THRESHOLD_OFF;
46 gnvs->f2on = FAN2_THRESHOLD_ON;
47
48 gnvs->f1of = FAN1_THRESHOLD_OFF;
49 gnvs->f1on = FAN1_THRESHOLD_ON;
50
51 gnvs->f0of = FAN0_THRESHOLD_OFF;
52 gnvs->f0on = FAN0_THRESHOLD_ON;
53
54 gnvs->tcrt = CRITICAL_TEMPERATURE;
55 gnvs->tpsv = PASSIVE_TEMPERATURE;
56 gnvs->tmax = MAX_TEMPERATURE;
57 gnvs->flvl = 5;
58}
59
Vladimir Serbinenko35c0f432014-09-02 22:25:36 +020060void acpi_create_gnvs(global_nvs_t *gnvs)
Stefan Reinauer155e9b52012-04-27 23:19:58 +020061{
62 gnvs_ = gnvs;
Stefan Reinauer155e9b52012-04-27 23:19:58 +020063
64 /*
65 * Disable 3G in suspend by default.
66 * Provide option to enable for http://crosbug.com/p/7925
67 */
68 gnvs->s33g = 0;
69
70 /* Disable USB ports in S3 by default */
71 gnvs->s3u0 = 0;
72 gnvs->s3u1 = 0;
73
74 /* Disable USB ports in S5 by default */
75 gnvs->s5u0 = 0;
76 gnvs->s5u1 = 0;
77
Stefan Reinauer155e9b52012-04-27 23:19:58 +020078
Stefan Reinauer155e9b52012-04-27 23:19:58 +020079 acpi_update_thermal_table(gnvs);
80
81 gnvs->chromeos.vbt2 = ec_read(0xcb) ? ACTIVE_ECFW_RW : ACTIVE_ECFW_RO;
82}