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