From ece6b2fc8a7f22716d47ae4f26742d54d0b655c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Fri, 20 Mar 2020 12:07:45 +0100 Subject: nb/amd/agesa/family14: Improve HTC threshold handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to BKDGs HTC temperature limit field indicates the threshold where HTC becomes active. HTC active state means that processor is limiting its power consumption and maximum P-State. Using this threshold as _CRT is incorrect, since HTC active is designed to prevent overheating, not causing immediate shutdown. Change the behavior of temperature limit to act as a passive cooling threshold. Make the passive cooling threshold a reference value for critical and hot temperature with 5 degrees step. TEST=boot FreeBSD on PC Engines apu2 and check the thermal zone temperature using sysctl Signed-off-by: Michał Żygowski Change-Id: Ife64c3aab76f8e125493ecc8183a6e87fb012e3b Reviewed-on: https://review.coreboot.org/c/coreboot/+/39697 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Angel Pons --- src/northbridge/amd/agesa/family14/acpi/thermal_mixin.asl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/northbridge/amd/agesa/family14/acpi') diff --git a/src/northbridge/amd/agesa/family14/acpi/thermal_mixin.asl b/src/northbridge/amd/agesa/family14/acpi/thermal_mixin.asl index 1f877ccc6e..3c692ce859 100644 --- a/src/northbridge/amd/agesa/family14/acpi/thermal_mixin.asl +++ b/src/northbridge/amd/agesa/family14/acpi/thermal_mixin.asl @@ -35,7 +35,7 @@ */ #ifndef K10TEMP_HOT_OFFSET -# define K10TEMP_HOT_OFFSET 100 +# define K10TEMP_HOT_OFFSET 50 #endif #define K10TEMP_KELVIN_OFFSET 2732 @@ -71,7 +71,11 @@ ThermalZone (TZ00) { Return (Add (Local0, K10TEMP_KELVIN_OFFSET)) } - Method (_CRT) { /* Critical temp in tenths degree Kelvin. */ + /* + * TLMT indicates threshold where HTC become active. That is the processor will limit + * P-State and power consumption in order to cool down. + */ + Method (_PSV) { /* Passive temp in tenths degree Kelvin. */ Multiply (TLMT, 10, Local0) ShiftRight (Local0, 1, Local0) Add (Local0, K10TEMP_TLIMIT_OFFSET, Local0) @@ -79,6 +83,10 @@ ThermalZone (TZ00) { } Method (_HOT) { /* Hot temp in tenths degree Kelvin. */ - Return (Subtract (_CRT, K10TEMP_HOT_OFFSET)) + Return (Add (_PSV, K10TEMP_HOT_OFFSET)) + } + + Method (_CRT) { /* Critical temp in tenths degree Kelvin. */ + Return (Add (_HOT, K10TEMP_HOT_OFFSET)) } } -- cgit v1.2.3