aboutsummaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec/acpi
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2014-01-06 12:30:52 -0800
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-05-13 20:59:11 +0200
commit93e244433a510cd57012973192cffb3fa50d66e3 (patch)
treefee096e4eff83e6727144dd74e8926196c48ba5e /src/ec/google/chromeec/acpi
parent063b2c4df71e54c674d729eae021da3e340bc110 (diff)
chrome ec: Update header and add functions to support DPTF
The EC now supports two auxiliary programmable trip points for thermal monitoring. These are expected to be used by DPTF and need to be exported. In order to support these the header was updated from the latest chrome ec source. BUG=chrome-os-partner:17279 BRANCH=rambi TEST=build and boot on rambi Change-Id: I257d910daac4e36280c0cecf4129381a32ffcb9a Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/181661 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5027 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/ec/google/chromeec/acpi')
-rw-r--r--src/ec/google/chromeec/acpi/ec.asl92
1 files changed, 80 insertions, 12 deletions
diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl
index d0540edb08..6e6646c62e 100644
--- a/src/ec/google/chromeec/acpi/ec.asl
+++ b/src/ec/google/chromeec/acpi/ec.asl
@@ -49,6 +49,9 @@ Device (EC0)
TSTC, 8, // Complement of Test Byte
KBLV, 8, // Keyboard Backlight
FAND, 8, // Set Fan Duty Cycle
+ PATI, 8, // Programmable Auxiliary Trip Sensor ID
+ PATT, 8, // Programmable Auxiliary Trip Threshold
+ PATC, 8, // Programmable Auxiliary Trip Commit
}
OperationRegion (EMEM, SystemIO, EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE)
@@ -234,13 +237,6 @@ Device (EC0)
Notify (BAT0, 0x81)
}
- // Thermal Treshold Event
- Method (_Q09, 0, NotSerialized)
- {
- Store ("EC: THERMAL THRESHOLD", Debug)
- Notify (\_TZ, 0x80)
- }
-
// Thermal Overload Event
Method (_Q0A, 0, NotSerialized)
{
@@ -289,6 +285,9 @@ Device (EC0)
* Dynamic Platform Thermal Framework support
*/
+ /* Mutex for EC PAT interface */
+ Mutex (PATM, 1)
+
/*
* Set Aux Trip Point 0
* Arg0 = Temp Sensor ID
@@ -296,6 +295,23 @@ Device (EC0)
*/
Method (PAT0, 2, Serialized)
{
+ If (Acquire (^PATM, 1000)) {
+ Return (0)
+ }
+
+ Store ("EC: PAT0", Debug)
+
+ /* Set sensor ID */
+ Store (ToInteger (Arg0), ^PATI)
+
+ /* Adjust by offset to get Kelvin and set Threshold */
+ Add (ToInteger (Arg1), ^TOFS, ^PATT)
+
+ /* Set commit value with SELECT=0 and ENABLE=1 */
+ Store (0x02, ^PATC)
+
+ Release (^PATM)
+ Return (1)
}
/*
@@ -305,17 +321,69 @@ Device (EC0)
*/
Method (PAT1, 2, Serialized)
{
+ If (Acquire (^PATM, 1000)) {
+ Return (0)
+ }
+
+ Store ("EC: PAT1", Debug)
+
+ /* Set sensor ID */
+ Store (ToInteger (Arg0), ^PATI)
+
+ /* Adjust by offset to get Kelvin and set Threshold */
+ Add (ToInteger (Arg1), ^TOFS, ^PATT)
+
+ /* Set commit value with SELECT=1 and ENABLE=1 */
+ Store (0x03, ^PATC)
+
+ Release (^PATM)
+ Return (1)
+ }
+
+ /* Disable Aux Trip Points */
+ Method (PATD)
+ {
+ If (Acquire (^PATM, 1000)) {
+ Return (0)
+ }
+
+ Store ("EC: PAT Disable", Debug)
+
+ Store (0x00, ^PATI)
+ Store (0x00, ^PATT)
+
+ /* Disable PAT0 */
+ Store (0x00, ^PATC)
+
+ /* Disable PAT1 */
+ Store (0x01, ^PATC)
+
+ Release (^PATM)
+ Return (1)
}
/*
- * DPTF Thermal Threshold Event
+ * Thermal Threshold Event
*/
- Method (_Q14, 0, Serialized)
+ Method (_Q09, 0, Serialized)
{
- Store ("EC: DPTF THERMAL THRESHOLD", Debug)
- If (CondRefOf (\_SB.DPTF.TEVT, Local0)) {
- \_SB.DPTF.TEVT ()
+ If (Acquire (^PATM, 1000)) {
+ Return ()
+ }
+
+ Store ("EC: THERMAL THRESHOLD", Debug)
+
+ /* Read sensor ID for event */
+ Store (^PATI, Local0)
+
+ /* When sensor ID returns 0xFF then no more events */
+ While (LNotEqual (Local0, EC_TEMP_SENSOR_NOT_PRESENT))
+ {
+ /* Keep reaading sensor ID for event */
+ Store (^PATI, Local0)
}
+
+ Release (^PATM)
}
#include "ac.asl"