From 3ab13a8691cbe0e96c0741cb9bdf0e0acfa6efaf Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 27 Aug 2017 16:11:55 +0200 Subject: ec/lenovo/h8/acpi/thermal: Add support for passive cooling The ACPI spec requires _TSP, _TC1, _TC2 and _PSL for passive cooling. _TSP already has been added in a previous commit. Copy the coefficients used on google devices to activate the feature. Tested on Lenovo T430: The CPU is throttled once the passive threshold has been reached. Tested on Lenovo T500: The CPU is throttled once the passive threshold has been reached. Change-Id: I922923a9029de77158988ac254bab4aad9536935 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/21223 Tested-by: build bot (Jenkins) Reviewed-by: Vasya Boytsov Reviewed-by: Nico Huber --- src/ec/lenovo/h8/acpi/thermal.asl | 48 ++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/ec/lenovo/h8/acpi/thermal.asl b/src/ec/lenovo/h8/acpi/thermal.asl index 84e23f9675..d43e3c6fbd 100644 --- a/src/ec/lenovo/h8/acpi/thermal.asl +++ b/src/ec/lenovo/h8/acpi/thermal.asl @@ -40,20 +40,36 @@ Scope(\_TZ) /* Thermal sampling period for passive cooling: 10 seconds */ Name (_TSP, 100) - Method(_CRT, 0, NotSerialized) { + /* Coefficients for passive cooling */ + Name (_TC1, 0x02) + Name (_TC2, 0x05) + +#if !IS_ENABLED(CONFIG_CPU_INTEL_MODEL_206AX) && \ + !IS_ENABLED(CONFIG_CPU_INTEL_MODEL_2065X) && \ + !IS_ENABLED(CONFIG_CPU_INTEL_MODEL_306AX) + /* Generated by acpigen */ +External (\PPKG, MethodObj) +#endif + /* Processors used for passive cooling */ + Method (_PSL, 0, Serialized) + { + Return (\PPKG ()) + } + + Method (_CRT, 0, NotSerialized) { Store (\TCRT, Local0) - if (LGreater(Local0, Zero)) { - Return (C2K(Local0)) + if (LGreater (Local0, 0)) { + Return (C2K (Local0)) } - Return (C2K(127)) + Return (C2K (127)) } - Method(_PSV, 0, NotSerialized) { + Method (_PSV, 0, NotSerialized) { Store (\TPSV, Local0) - if (LGreater(Local0, Zero)) { + if (LGreater (Local0, 0)) { Return (C2K(Local0)) } - Return (C2K(95)) + Return (C2K (95)) } Method(_TMP) { @@ -76,12 +92,22 @@ Scope(\_TZ) /* Thermal sampling period for passive cooling: 10 seconds */ Name (_TSP, 100) - Method(_CRT, 0, NotSerialized) { - Return (C2K(99)) + /* Coefficients for passive cooling */ + Name (_TC1, 0x02) + Name (_TC2, 0x05) + + /* Processors used for passive cooling */ + Method (_PSL, 0, Serialized) + { + Return (\PPKG ()) + } + + Method (_CRT, 0, NotSerialized) { + Return (C2K (99)) } - Method(_PSV, 0, NotSerialized) { - Return (C2K(94)) + Method (_PSV, 0, NotSerialized) { + Return (C2K (94)) } Method(_TMP) { -- cgit v1.2.3