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)
|
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)
|
ThermalZone (THRM)
|
||||||
{
|
{
|
||||||
Name (_TC1, 0x02)
|
Name (_TC1, 0x02)
|
||||||
|
@ -61,7 +75,7 @@ Scope (\_TZ)
|
||||||
Return (\PPKG ())
|
Return (\PPKG ())
|
||||||
}
|
}
|
||||||
|
|
||||||
Method (_TMP, 0, Serialized)
|
Method (TCHK, 0, Serialized)
|
||||||
{
|
{
|
||||||
// Get Temperature from TIN# set in NVS
|
// Get Temperature from TIN# set in NVS
|
||||||
Store (\_SB.PCI0.LPCB.EC0.TINS (TMPS), Local0)
|
Store (\_SB.PCI0.LPCB.EC0.TINS (TMPS), Local0)
|
||||||
|
@ -94,79 +108,29 @@ Scope (\_TZ)
|
||||||
Return (Local0)
|
Return (Local0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CTDP Down */
|
Method (_TMP, 0, Serialized)
|
||||||
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 (_STA) {
|
// Get temperature from EC in deci-kelvin
|
||||||
If (LLessEqual (\FLVL, 0)) {
|
Store (TCHK (), Local0)
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PowerResource (TNP1, 0, 0)
|
// Critical temperature in deci-kelvin
|
||||||
{
|
Store (CTOK (\TCRT), Local1)
|
||||||
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)
|
If (LGreaterEqual (Local0, Local1)) {
|
||||||
{
|
Store ("CRITICAL TEMPERATURE", Debug)
|
||||||
Name (_HID, EISAID ("PNP0C0B"))
|
Store (Local0, Debug)
|
||||||
Name (_UID, 0)
|
|
||||||
Name (_PR0, Package () { TNP0 })
|
|
||||||
}
|
|
||||||
|
|
||||||
Device (TDP1)
|
// Wait 1 second for EC to re-poll
|
||||||
{
|
Sleep (1000)
|
||||||
Name (_HID, EISAID ("PNP0C0B"))
|
|
||||||
Name (_UID, 1)
|
// Re-read temperature from EC
|
||||||
Name (_PR0, Package () { TNP1 })
|
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)
|
static void acpi_update_thermal_table(global_nvs_t *gnvs)
|
||||||
{
|
{
|
||||||
gnvs->tmps = CTDP_SENSOR_ID;
|
gnvs->tmps = TEMPERATURE_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->tcrt = CRITICAL_TEMPERATURE;
|
gnvs->tcrt = CRITICAL_TEMPERATURE;
|
||||||
gnvs->tpsv = PASSIVE_TEMPERATURE;
|
gnvs->tpsv = PASSIVE_TEMPERATURE;
|
||||||
gnvs->tmax = MAX_TEMPERATURE;
|
gnvs->tmax = MAX_TEMPERATURE;
|
||||||
|
gnvs->f0pw = EC_THROTTLE_POWER_LIMIT;
|
||||||
gnvs->flvl = 1;
|
gnvs->flvl = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,24 +20,18 @@
|
||||||
#ifndef THERMAL_H
|
#ifndef THERMAL_H
|
||||||
#define THERMAL_H
|
#define THERMAL_H
|
||||||
|
|
||||||
/* Config TDP Sensor ID */
|
#define TEMPERATURE_SENSOR_ID 0 /* PECI */
|
||||||
#define CTDP_SENSOR_ID 0 /* PECI */
|
|
||||||
|
|
||||||
/* Config TDP Nominal */
|
/* Power level to set when EC requests throttle */
|
||||||
#define CTDP_NOMINAL_THRESHOLD_OFF 0
|
#define EC_THROTTLE_POWER_LIMIT 12 /* 12W */
|
||||||
#define CTDP_NOMINAL_THRESHOLD_ON 0
|
|
||||||
|
|
||||||
/* Config TDP Down */
|
|
||||||
#define CTDP_DOWN_THRESHOLD_OFF 80
|
|
||||||
#define CTDP_DOWN_THRESHOLD_ON 90
|
|
||||||
|
|
||||||
/* Temperature which OS will shutdown at */
|
/* Temperature which OS will shutdown at */
|
||||||
#define CRITICAL_TEMPERATURE 104
|
#define CRITICAL_TEMPERATURE 99
|
||||||
|
|
||||||
/* Temperature which OS will throttle CPU */
|
/* Temperature which OS will throttle CPU */
|
||||||
#define PASSIVE_TEMPERATURE 100
|
#define PASSIVE_TEMPERATURE 95
|
||||||
|
|
||||||
/* Tj_max value for calculating PECI CPU temperature */
|
/* Tj_max value for calculating PECI CPU temperature */
|
||||||
#define MAX_TEMPERATURE 105
|
#define MAX_TEMPERATURE 100
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue