diff options
author | Marc Jones <marcj303@gmail.com> | 2017-11-02 11:36:53 -0600 |
---|---|---|
committer | Marc Jones <marc@marcjonesconsulting.com> | 2017-11-15 18:19:31 +0000 |
commit | 067031e0e195c4346255680821ff288b407e0b90 (patch) | |
tree | f5eaf61b5d113908d4eb331378cdbcce64b74c94 /src/mainboard/google/kahlee/acpi | |
parent | c8999a7c43e85365224e32a81364f68cb89d8975 (diff) |
variants/kahlee: Add thermal ASL
Connect the EC thermal to Kahlee and Grunt thermal ASL. Intialize GNVS
thermal values in the mainboard finalize.
BUG=b:67999819
Change-Id: I89159a5fd3c639e511139b8c5948b6a4ee19aaa3
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/22400
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/mainboard/google/kahlee/acpi')
-rw-r--r-- | src/mainboard/google/kahlee/acpi/thermal.asl | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/mainboard/google/kahlee/acpi/thermal.asl b/src/mainboard/google/kahlee/acpi/thermal.asl new file mode 100644 index 0000000000..86f8758892 --- /dev/null +++ b/src/mainboard/google/kahlee/acpi/thermal.asl @@ -0,0 +1,90 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2014 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <variant/thermal.h> + +/* Thermal Zone */ + +Scope (\_TZ) +{ + ThermalZone (THRM) + { + /* Thermal constants for passive cooling */ + Name (_TC1, 0x02) + Name (_TC2, 0x05) + + /* Thermal zone polling frequency: 10 seconds */ + Name (_TZP, 100) + + /* Thermal sampling period for passive cooling: 2 seconds */ + Name (_TSP, 20) + + /* Convert from Degrees C to 1/10 Kelvin for ACPI */ + Method (CTOK, 1) { + /* 10th of Degrees C */ + Multiply (Arg0, 10, Local0) + + /* Convert to Kelvin */ + Add (Local0, 2732, Local0) + + Return (Local0) + } + + /* Threshold for OS to shutdown */ + Method (_CRT, 0, Serialized) + { + Return (CTOK (\TCRT)) + } + + /* Threshold for passive cooling */ + Method (_PSV, 0, Serialized) + { + Return (CTOK (\TPSV)) + } + + /* Processors used for passive cooling */ + Method (_PSL, 0, Serialized) + { + Return (\PPKG ()) + } + + Method (_TMP, 0, Serialized) + { + /* Get temperature from EC in deci-kelvin */ + Store (\_SB.PCI0.LPCB.EC0.TSRD (TMPS), Local0) + + /* Critical temperature in deci-kelvin */ + Store (CTOK (\TCRT), Local1) + + If (LGreaterEqual (Local0, Local1)) { + Store ("CRITICAL TEMPERATURE", Debug) + Store (Local0, Debug) + + /* Wait 1 second for EC to re-poll */ + Sleep (1000) + + /* Re-read temperature from EC */ + Store (\_SB.PCI0.LPCB.EC0.TSRD (TMPS), Local0) + + Store ("RE-READ TEMPERATURE", Debug) + Store (Local0, Debug) + } + + Return (Local0) + } + + /* No active fan control (_ACx) on Kahlee */ + } +} |