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>
This commit is contained in:
Duncan Laurie
2013-12-10 07:41:33 -08:00
committed by Kyösti Mälkki
parent 4cc4b04d8a
commit ad8d913f42
8 changed files with 468 additions and 4 deletions

View File

@ -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"
}