From d3fdf5e6f3243484328d3d954a1924b355ff9c21 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 12 Dec 2013 11:03:17 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/179778 Reviewed-by: Duncan Laurie Reviewed-by: Randall Spangler --- common/thermal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'common/thermal.c') 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"); -- cgit v1.2.1