samus: Change thermal behavior to match other haswell platforms
Change-Id: Ia835f16b156949f1841210c4a469223d5df28a54 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/174087 Reviewed-by: Aaron Durbin <adurbin@chromium.org> (cherry picked from commit 8e51d1d74cdcadde9cbf10e8321d601b099c46bc) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6825 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
51edd54738
commit
1eca1d4e15
|
@ -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,79 +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)
|
||||
}
|
||||
}
|
||||
Method (_ON) {
|
||||
Store (0, \FLVL)
|
||||
\_SB.PCI0.MCHC.STND ()
|
||||
Notify (\_TZ.THRM, 0x81)
|
||||
}
|
||||
Method (_OFF) {
|
||||
Store (1, \FLVL)
|
||||
\_SB.PCI0.MCHC.STDN ()
|
||||
Notify (\_TZ.THRM, 0x81)
|
||||
}
|
||||
}
|
||||
// Get temperature from EC in deci-kelvin
|
||||
Store (TCHK (), Local0)
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
// Critical temperature in deci-kelvin
|
||||
Store (CTOK (\TCRT), Local1)
|
||||
|
||||
Device (TDP0)
|
||||
{
|
||||
Name (_HID, EISAID ("PNP0C0B"))
|
||||
Name (_UID, 0)
|
||||
Name (_PR0, Package () { TNP0 })
|
||||
}
|
||||
If (LGreaterEqual (Local0, Local1)) {
|
||||
Store ("CRITICAL TEMPERATURE", Debug)
|
||||
Store (Local0, Debug)
|
||||
|
||||
Device (TDP1)
|
||||
{
|
||||
Name (_HID, EISAID ("PNP0C0B"))
|
||||
Name (_UID, 1)
|
||||
Name (_PR0, Package () { TNP1 })
|
||||
// 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)
|
||||
}
|
||||
|
||||
Return (Local0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,17 +44,11 @@ unsigned long acpi_create_slic(unsigned long current);
|
|||
|
||||
static void acpi_update_thermal_table(global_nvs_t *gnvs)
|
||||
{
|
||||
gnvs->tmps = CTDP_SENSOR_ID;
|
||||
|
||||
gnvs->f1of = CTDP_NOMINAL_THRESHOLD_OFF;
|
||||
gnvs->f1on = CTDP_NOMINAL_THRESHOLD_ON;
|
||||
|
||||
gnvs->f0of = CTDP_DOWN_THRESHOLD_OFF;
|
||||
gnvs->f0on = CTDP_DOWN_THRESHOLD_ON;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,24 +20,18 @@
|
|||
#ifndef THERMAL_H
|
||||
#define THERMAL_H
|
||||
|
||||
/* Config TDP Sensor ID */
|
||||
#define CTDP_SENSOR_ID 0 /* PECI */
|
||||
#define TEMPERATURE_SENSOR_ID 0 /* PECI */
|
||||
|
||||
/* Config TDP Nominal */
|
||||
#define CTDP_NOMINAL_THRESHOLD_OFF 0
|
||||
#define CTDP_NOMINAL_THRESHOLD_ON 0
|
||||
|
||||
/* Config TDP Down */
|
||||
#define CTDP_DOWN_THRESHOLD_OFF 80
|
||||
#define CTDP_DOWN_THRESHOLD_ON 90
|
||||
/* Power level to set when EC requests throttle */
|
||||
#define EC_THROTTLE_POWER_LIMIT 12 /* 12W */
|
||||
|
||||
/* Temperature which OS will shutdown at */
|
||||
#define CRITICAL_TEMPERATURE 104
|
||||
#define CRITICAL_TEMPERATURE 99
|
||||
|
||||
/* Temperature which OS will throttle CPU */
|
||||
#define PASSIVE_TEMPERATURE 100
|
||||
#define PASSIVE_TEMPERATURE 95
|
||||
|
||||
/* Tj_max value for calculating PECI CPU temperature */
|
||||
#define MAX_TEMPERATURE 105
|
||||
#define MAX_TEMPERATURE 100
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue