summaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2013-12-10 07:41:33 -0800
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-05-09 05:42:52 +0200
commitad8d913f42b4dff80502456a08aac06e7fbcd0dd (patch)
tree0ed7479199e5211cfa40d938aac5030b742385ed /src/ec/google/chromeec
parent4cc4b04d8a5c5b2bdc5b0fcd34cf4ae6352b32c2 (diff)
downloadcoreboot-ad8d913f42b4dff80502456a08aac06e7fbcd0dd.tar.xz
baytrail: Basic DPTF framework
This is not complete yet but it compiles and doesn't cause any issues by itself. It is tied into the EC pretty closely so that is part of the same commit. Once we have more of the EC support done it will need some more work to make use of those new interfaces properly. BUG=chrome-os-partner:17279 BRANCH=none TEST=build and boot on rambi, dump DSDT and look over \_SB.DPTF Change-Id: I4b27e38baae18627a275488d77944208950b98bd Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179459 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5002 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/ec/google/chromeec')
-rw-r--r--src/ec/google/chromeec/acpi/ec.asl71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl
index 31ef90520e..d0540edb08 100644
--- a/src/ec/google/chromeec/acpi/ec.asl
+++ b/src/ec/google/chromeec/acpi/ec.asl
@@ -25,6 +25,7 @@
// Mainboard specific throttle handler
External (\_TZ.THRT, MethodObj)
+External (\_SB.DPTF.TEVT, MethodObj)
Device (EC0)
{
@@ -47,6 +48,7 @@ Device (EC0)
TSTB, 8, // Test Byte
TSTC, 8, // Complement of Test Byte
KBLV, 8, // Keyboard Backlight
+ FAND, 8, // Set Fan Duty Cycle
}
OperationRegion (EMEM, SystemIO, EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE)
@@ -89,6 +91,8 @@ Device (EC0)
BMOD, 64, // Battery Model String
BSER, 64, // Battery Serial String
BTYP, 64, // Battery Type String
+ Offset (0x80),
+ ALS0, 16, // ALS reading 0 in lux
}
Method (TINS, 1, Serialized)
@@ -134,6 +138,40 @@ Device (EC0)
Store (LIDS, \LIDS)
}
+ /* Read requested temperature and check against EC error values */
+ Method (TSRD, 1, Serialized)
+ {
+ Store (\_SB.PCI0.LPCB.EC0.TINS (Arg0), Local0)
+
+ /* Check for sensor not calibrated */
+ If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TNCA)) {
+ Return (Zero)
+ }
+
+ /* Check for sensor not present */
+ If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TNPR)) {
+ Return (Zero)
+ }
+
+ /* Check for sensor not powered */
+ If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TNOP)) {
+ Return (Zero)
+ }
+
+ /* Check for sensor bad reading */
+ If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TBAD)) {
+ Return (Zero)
+ }
+
+ /* Adjust by offset to get Kelvin */
+ Add (\_SB.PCI0.LPCB.EC0.TOFS, Local0, Local0)
+
+ /* Convert to 1/10 Kelvin */
+ Multiply (Local0, 10, Local0)
+
+ Return (Local0)
+ }
+
// Lid Closed Event
Method (_Q01, 0, NotSerialized)
{
@@ -247,6 +285,39 @@ Device (EC0)
}
}
+ /*
+ * Dynamic Platform Thermal Framework support
+ */
+
+ /*
+ * Set Aux Trip Point 0
+ * Arg0 = Temp Sensor ID
+ * Arg1 = Value to set
+ */
+ Method (PAT0, 2, Serialized)
+ {
+ }
+
+ /*
+ * Set Aux Trip Point 1
+ * Arg0 = Temp Sensor ID
+ * Arg1 = Value to set
+ */
+ Method (PAT1, 2, Serialized)
+ {
+ }
+
+ /*
+ * DPTF Thermal Threshold Event
+ */
+ Method (_Q14, 0, Serialized)
+ {
+ Store ("EC: DPTF THERMAL THRESHOLD", Debug)
+ If (CondRefOf (\_SB.DPTF.TEVT, Local0)) {
+ \_SB.DPTF.TEVT ()
+ }
+ }
+
#include "ac.asl"
#include "battery.asl"
}