auron: Change thermal behavior to match other haswell platforms

Auron port of Samus commit 8e51d1d74c.

BUG=chrome-os-partner:31286
TEST=Compile only.
BRANCH=None.

Change-Id: I8b50edf37062205193acecf984c1b4ee33b3222a
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/213953
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Shawn Nematbakhsh 2014-08-21 12:06:48 -07:00 committed by chrome-internal-fetch
commit 7aae2adda7
4 changed files with 38 additions and 87 deletions

View file

@ -21,6 +21,20 @@
Scope (\_TZ)
{
// Handler for throttle requests on this platform
// 0 = Stop throttling
// 1 = Start throttling
Method (THRT, 1, Serialized)
{
If (LEqual (Arg0, 0)) {
/* Disable Power Limit */
\_SB.PCI0.MCHC.CTLD ()
} Else {
/* Enable Power Limit */
\_SB.PCI0.MCHC.CTLE (\F0PW)
}
}
ThermalZone (THRM)
{
Name (_TC1, 0x02)
@ -61,7 +75,7 @@ Scope (\_TZ)
Return (\PPKG ())
}
Method (_TMP, 0, Serialized)
Method (TCHK, 0, Serialized)
{
// Get Temperature from TIN# set in NVS
Store (\_SB.PCI0.LPCB.EC0.TINS (TMPS), Local0)
@ -94,85 +108,29 @@ Scope (\_TZ)
Return (Local0)
}
/* CTDP Down */
Method (_AC0) {
If (LLessEqual (\FLVL, 0)) {
Return (CTOK (\F0OF))
} Else {
Return (CTOK (\F0ON))
}
}
/* CTDP Nominal */
Method (_AC1) {
If (LLessEqual (\FLVL, 1)) {
Return (CTOK (\F1OF))
} Else {
Return (CTOK (\F1ON))
}
}
Name (_AL0, Package () { TDP0 })
Name (_AL1, Package () { TDP1 })
PowerResource (TNP0, 0, 0)
Method (_TMP, 0, Serialized)
{
Method (_STA) {
If (LLessEqual (\FLVL, 0)) {
Return (One)
} Else {
Return (Zero)
}
// Get temperature from EC in deci-kelvin
Store (TCHK (), Local0)
// Critical temperature in deci-kelvin
Store (CTOK (\TCRT), Local1)
If (LGreaterEqual (Local0, Local1)) {
Store ("CRITICAL TEMPERATURE", Debug)
Store (Local0, Debug)
// Wait 1 second for EC to re-poll
Sleep (1000)
// Re-read temperature from EC
Store (TCHK (), Local0)
Store ("RE-READ TEMPERATURE", Debug)
Store (Local0, Debug)
}
Method (_ON) {
Store (0, \FLVL)
/* Enable Power Limit */
\_SB.PCI0.MCHC.CTLE (\F0PW)
Notify (\_TZ.THRM, 0x81)
}
Method (_OFF) {
Store (1, \FLVL)
/* Disable Power Limit */
\_SB.PCI0.MCHC.CTLD ()
Notify (\_TZ.THRM, 0x81)
}
}
PowerResource (TNP1, 0, 0)
{
Method (_STA) {
If (LLessEqual (\FLVL, 1)) {
Return (One)
} Else {
Return (Zero)
}
}
Method (_ON) {
Store (1, \FLVL)
Notify (\_TZ.THRM, 0x81)
}
Method (_OFF) {
Store (1, \FLVL)
Notify (\_TZ.THRM, 0x81)
}
}
Device (TDP0)
{
Name (_HID, EISAID ("PNP0C0B"))
Name (_UID, 0)
Name (_PR0, Package () { TNP0 })
}
Device (TDP1)
{
Name (_HID, EISAID ("PNP0C0B"))
Name (_UID, 1)
Name (_PR0, Package () { TNP1 })
Return (Local0)
}
}
}

View file

@ -41,20 +41,12 @@ extern const unsigned char AmlCode[];
static void acpi_update_thermal_table(global_nvs_t *gnvs)
{
gnvs->tmps = CTL_TDP_SENSOR_ID;
/* Normal TDP */
gnvs->f1of = 0;
gnvs->f1on = 0;
/* Limited TDP */
gnvs->f0of = CTL_TDP_THRESHOLD_OFF;
gnvs->f0on = CTL_TDP_THRESHOLD_ON;
gnvs->f0pw = CTL_TDP_POWER_LIMIT;
gnvs->tmps = TEMPERATURE_SENSOR_ID;
gnvs->tcrt = CRITICAL_TEMPERATURE;
gnvs->tpsv = PASSIVE_TEMPERATURE;
gnvs->tmax = MAX_TEMPERATURE;
gnvs->f0pw = EC_THROTTLE_POWER_LIMIT;
gnvs->flvl = 1;
}

View file

@ -35,6 +35,8 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER))
#define MAINBOARD_EC_SMI_EVENTS \

View file

@ -20,11 +20,10 @@
#ifndef THERMAL_H
#define THERMAL_H
/* Control TDP Settings */
#define CTL_TDP_SENSOR_ID 0 /* PECI */
#define CTL_TDP_POWER_LIMIT 12 /* 12W */
#define CTL_TDP_THRESHOLD_OFF 80 /* Normal at 80C */
#define CTL_TDP_THRESHOLD_ON 85 /* Limited at 85C */
#define TEMPERATURE_SENSOR_ID 0 /* PECI */
/* Power level to set when EC requests throttle */
#define EC_THROTTLE_POWER_LIMIT 12 /* 12W */
/* Temperature which OS will shutdown at */
#define CRITICAL_TEMPERATURE 99