diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-12-12 11:03:17 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-12-13 01:13:44 +0000 |
commit | d3fdf5e6f3243484328d3d954a1924b355ff9c21 (patch) | |
tree | 209bbeb6cc1f4e65457f2600d11a51ef04f5ef09 /common/thermal.c | |
parent | df50fccf8e87bbf0328e58bd012b577bd4c7658a (diff) | |
download | chrome-ec-d3fdf5e6f3243484328d3d954a1924b355ff9c21.tar.gz |
Add stubs for DPTF thermal thresholds
This adds three new registers to the ACPI->EC interface, which will allow
the AP to set/clear two DPTF thermal threshold points for each temp sensor.
The registers are
EC_ACPI_MEM_TEMP_ID 0x05
EC_ACPI_MEM_TEMP_THRESHOLD 0x06
EC_ACPI_MEM_TEMP_COMMIT 0x07
It doesn't actually do anything yet, but the AP can now write those values.
BUG=chrome-os-partner:23970
BRANCH=none
TEST=manual
On the host:
dptf() {
[ "$#" -eq "2" ] || return;
iotools io_write8 0x66 0x81
iotools io_write8 0x62 $1
iotools io_write8 0x62 $2
}
Now watch the EC console while running on the host:
dptf 5 1
dptf 6 80
dptf 7 2
dptf 7 3
The EC should say
DPTF sensor 1, threshold 7 C, index 0, enabled
DPTF sensor 1, threshold 7 C, index 1, enabled
Change-Id: I71fa57e3ca7c7b5bb8892e63212bf294b44dece5
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/179778
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/thermal.c')
-rw-r--r-- | common/thermal.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/thermal.c b/common/thermal.c index 97c12412e0..873a8a1981 100644 --- a/common/thermal.c +++ b/common/thermal.c @@ -23,6 +23,19 @@ #define CPUTS(outstr) cputs(CC_THERMAL, outstr) #define CPRINTF(format, args...) cprintf(CC_THERMAL, format, ## args) +/*****************************************************************************/ +/* DPTF temperature thresholds */ + +void dptf_set_temp_threshold(int sensor_id, int temp, int idx, int enable) +{ + /* TODO(crosbug.com/p/23970) */ + CPRINTF("[%T DPTF sensor %d, threshold %d C, index %d, %sabled]\n", + sensor_id, K_TO_C(temp), idx, enable ? "en" : "dis"); +} + +/*****************************************************************************/ +/* EC-specific thermal controls */ + test_mockable_static void smi_sensor_failure_warning(void) { CPRINTF("[%T can't read any temp sensors!]\n"); |