diff --git a/src/mainboard/samsung/stumpy/acpi/thermal.asl b/src/mainboard/samsung/stumpy/acpi/thermal.asl index 2dcb13fabe..cc8a060443 100644 --- a/src/mainboard/samsung/stumpy/acpi/thermal.asl +++ b/src/mainboard/samsung/stumpy/acpi/thermal.asl @@ -2,6 +2,8 @@ // Thermal Zone +#include "../thermal.h" + External (\PPKG, MethodObj) Scope (\_TZ) @@ -31,13 +33,13 @@ Scope (\_TZ) // Threshold for OS to shutdown Method (_CRT, 0, Serialized) { - Return (CTOK (\TCRT)) + Return (CTOK (CRITICAL_TEMPERATURE)) } // Threshold for passive cooling Method (_PSV, 0, Serialized) { - Return (CTOK (\TPSV)) + Return (CTOK (PASSIVE_TEMPERATURE)) } // Processors used for passive cooling @@ -46,6 +48,14 @@ Scope (\_TZ) Return (\PPKG ()) } + // Initialize to the lowest cooling state (fan idle) + Method (_INI) + { + \FLVL = 4 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN4_PWM + Notify (\_TZ.THRM, 0x81) + } + Method (_TMP, 0, Serialized) { // Get CPU Temperature from PECI via SuperIO TMPIN3 @@ -53,59 +63,59 @@ Scope (\_TZ) // Check for invalid readings If ((Local0 == 255) || (Local0 == 0)) { - Return (CTOK (\F2ON)) + Return (CTOK (FAN2_THRESHOLD_ON)) } // PECI raw value is an offset from Tj_max Local1 = 255 - Local0 // Handle values greater than Tj_max - If (Local1 >= \TMAX) { - Return (CTOK (\TMAX)) + If (Local1 >= MAX_TEMPERATURE) { + Return (CTOK (MAX_TEMPERATURE)) } // Subtract from Tj_max to get temperature - Local0 = \TMAX - Local1 + Local0 = MAX_TEMPERATURE - Local1 Return (CTOK (Local0)) } Method (_AC0) { If (\FLVL <= 0) { - Return (CTOK (\F0OF)) + Return (CTOK (FAN0_THRESHOLD_OFF)) } Else { - Return (CTOK (\F0ON)) + Return (CTOK (FAN0_THRESHOLD_ON)) } } Method (_AC1) { If (\FLVL <= 1) { - Return (CTOK (\F1OF)) + Return (CTOK (FAN1_THRESHOLD_OFF)) } Else { - Return (CTOK (\F1ON)) + Return (CTOK (FAN1_THRESHOLD_ON)) } } Method (_AC2) { If (\FLVL <= 2) { - Return (CTOK (\F2OF)) + Return (CTOK (FAN2_THRESHOLD_OFF)) } Else { - Return (CTOK (\F2ON)) + Return (CTOK (FAN2_THRESHOLD_ON)) } } Method (_AC3) { If (\FLVL <= 3) { - Return (CTOK (\F3OF)) + Return (CTOK (FAN3_THRESHOLD_OFF)) } Else { - Return (CTOK (\F3ON)) + Return (CTOK (FAN3_THRESHOLD_ON)) } } Method (_AC4) { If (\FLVL <= 4) { - Return (CTOK (\F4OF)) + Return (CTOK (FAN4_THRESHOLD_OFF)) } Else { - Return (CTOK (\F4ON)) + Return (CTOK (FAN4_THRESHOLD_ON)) } } @@ -125,14 +135,18 @@ Scope (\_TZ) } } Method (_ON) { - \FLVL = 0 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F0PW - Notify (\_TZ.THRM, 0x81) + If (! _STA ()) { + \FLVL = 0 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN0_PWM + Notify (\_TZ.THRM, 0x81) + } } Method (_OFF) { - \FLVL = 1 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F1PW - Notify (\_TZ.THRM, 0x81) + If (_STA ()) { + \FLVL = 1 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN1_PWM + Notify (\_TZ.THRM, 0x81) + } } } @@ -146,14 +160,18 @@ Scope (\_TZ) } } Method (_ON) { - \FLVL = 1 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F1PW - Notify (\_TZ.THRM, 0x81) + If (! _STA ()) { + \FLVL = 1 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN1_PWM + Notify (\_TZ.THRM, 0x81) + } } Method (_OFF) { - \FLVL = 2 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F2PW - Notify (\_TZ.THRM, 0x81) + If (_STA ()) { + \FLVL = 2 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN2_PWM + Notify (\_TZ.THRM, 0x81) + } } } @@ -167,14 +185,18 @@ Scope (\_TZ) } } Method (_ON) { - \FLVL = 2 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F2PW - Notify (\_TZ.THRM, 0x81) + If (! _STA ()) { + \FLVL = 2 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN2_PWM + Notify (\_TZ.THRM, 0x81) + } } Method (_OFF) { - \FLVL = 3 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F3PW - Notify (\_TZ.THRM, 0x81) + If (_STA ()) { + \FLVL = 3 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN3_PWM + Notify (\_TZ.THRM, 0x81) + } } } @@ -188,14 +210,18 @@ Scope (\_TZ) } } Method (_ON) { - \FLVL = 3 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F3PW - Notify (\_TZ.THRM, 0x81) + If (! _STA ()) { + \FLVL = 3 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN3_PWM + Notify (\_TZ.THRM, 0x81) + } } Method (_OFF) { - \FLVL = 4 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW - Notify (\_TZ.THRM, 0x81) + If (_STA ()) { + \FLVL = 4 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN4_PWM + Notify (\_TZ.THRM, 0x81) + } } } @@ -209,9 +235,11 @@ Scope (\_TZ) } } Method (_ON) { - \FLVL = 4 - \_SB.PCI0.LPCB.SIO.ENVC.F3PS = \F4PW - Notify (\_TZ.THRM, 0x81) + If (! _STA ()) { + \FLVL = 4 + \_SB.PCI0.LPCB.SIO.ENVC.F3PS = FAN4_PWM + Notify (\_TZ.THRM, 0x81) + } } Method (_OFF) { // FAN4 is the minimum cooling state (idle/lowest fan speed) diff --git a/src/mainboard/samsung/stumpy/acpi_tables.c b/src/mainboard/samsung/stumpy/acpi_tables.c index 6912ca1a76..9c8c690e93 100644 --- a/src/mainboard/samsung/stumpy/acpi_tables.c +++ b/src/mainboard/samsung/stumpy/acpi_tables.c @@ -4,8 +4,6 @@ #include #include -#include "thermal.h" - void mainboard_fill_gnvs(struct global_nvs *gnvs) { /* Enable Front USB ports in S3 by default */ @@ -18,29 +16,4 @@ void mainboard_fill_gnvs(struct global_nvs *gnvs) */ gnvs->s5u0 = 1; gnvs->s5u1 = 1; - - gnvs->f4of = FAN4_THRESHOLD_OFF; - gnvs->f4on = FAN4_THRESHOLD_ON; - gnvs->f4pw = FAN4_PWM; - - gnvs->f3of = FAN3_THRESHOLD_OFF; - gnvs->f3on = FAN3_THRESHOLD_ON; - gnvs->f3pw = FAN3_PWM; - - gnvs->f2of = FAN2_THRESHOLD_OFF; - gnvs->f2on = FAN2_THRESHOLD_ON; - gnvs->f2pw = FAN2_PWM; - - gnvs->f1of = FAN1_THRESHOLD_OFF; - gnvs->f1on = FAN1_THRESHOLD_ON; - gnvs->f1pw = FAN1_PWM; - - gnvs->f0of = FAN0_THRESHOLD_OFF; - gnvs->f0on = FAN0_THRESHOLD_ON; - gnvs->f0pw = FAN0_PWM; - - gnvs->tcrt = CRITICAL_TEMPERATURE; - gnvs->tpsv = PASSIVE_TEMPERATURE; - gnvs->tmax = MAX_TEMPERATURE; - gnvs->flvl = 5; }