blob: 3ef993a3d7da78dc272363d09b4e69dc51d4dc05 [file] [log] [blame]
Stefan Reinauer6651da32012-04-27 23:16:30 +02001/*
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.
Stefan Reinauer6651da32012-04-27 23:16:30 +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 Reinauer6651da32012-04-27 23:16:30 +020027#include <vendorcode/google/chromeos/gnvs.h>
28
Stefan Reinauer6651da32012-04-27 23:16:30 +020029#include "southbridge/intel/bd82x6x/nvs.h"
30#include "thermal.h"
31
32static global_nvs_t *gnvs_;
33
34static void acpi_update_thermal_table(global_nvs_t *gnvs)
35{
36 gnvs->f4of = FAN4_THRESHOLD_OFF;
37 gnvs->f4on = FAN4_THRESHOLD_ON;
38 gnvs->f4pw = FAN4_PWM;
39
40 gnvs->f3of = FAN3_THRESHOLD_OFF;
41 gnvs->f3on = FAN3_THRESHOLD_ON;
42 gnvs->f3pw = FAN3_PWM;
43
44 gnvs->f2of = FAN2_THRESHOLD_OFF;
45 gnvs->f2on = FAN2_THRESHOLD_ON;
46 gnvs->f2pw = FAN2_PWM;
47
48 gnvs->f1of = FAN1_THRESHOLD_OFF;
49 gnvs->f1on = FAN1_THRESHOLD_ON;
50 gnvs->f1pw = FAN1_PWM;
51
52 gnvs->f0of = FAN0_THRESHOLD_OFF;
53 gnvs->f0on = FAN0_THRESHOLD_ON;
54 gnvs->f0pw = FAN0_PWM;
55
56 gnvs->tcrt = CRITICAL_TEMPERATURE;
57 gnvs->tpsv = PASSIVE_TEMPERATURE;
58 gnvs->tmax = MAX_TEMPERATURE;
59}
60
Vladimir Serbinenko35c0f432014-09-02 22:25:36 +020061void acpi_create_gnvs(global_nvs_t *gnvs)
Stefan Reinauer6651da32012-04-27 23:16:30 +020062{
63 gnvs_ = gnvs;
Stefan Reinauer6651da32012-04-27 23:16:30 +020064
65 /* Enable USB ports in S3 */
66 gnvs->s3u0 = 1;
67 gnvs->s3u1 = 1;
68
69 /*
70 * Enable Front USB ports in S5 by default
71 * to be consistent with back port behavior
72 */
73 gnvs->s5u0 = 1;
74 gnvs->s5u1 = 1;
75
Stefan Reinauer6651da32012-04-27 23:16:30 +020076
Stefan Reinauer6651da32012-04-27 23:16:30 +020077 acpi_update_thermal_table(gnvs);
78
79 // Stumpy has no arms^H^H^H^HEC.
80 gnvs->chromeos.vbt2 = ACTIVE_ECFW_RO;
81}