summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2021-08-06 11:50:05 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-16 22:45:33 +0000
commit87490a70aaece31f9a315a44c3de4904a76ea90a (patch)
treeefe92eeaf6db77a42c3916c056c09c220fe857c9 /include
parent7e84bc29b291e4d7456783754cdf84dbd056ef34 (diff)
downloadchrome-ec-87490a70aaece31f9a315a44c3de4904a76ea90a.tar.gz
driver/amd_stt: Add AMD STT driver
Add a driver for writing Skin Temperature Tracking (STT) sensor readings to the SB-RMI interface. STT readings are used to maximize the SOc performance while keeping the skin temperature within specification. BUG=b:176994331 TEST=Build and run on guybrush BRANCH=None Change-Id: If655545158e7dc05946bc67686b1b0b40a40a713 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078050 Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Commit-Queue: Raul E Rangel <rrangel@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h8
-rw-r--r--include/driver/amd_stt.h27
2 files changed, 35 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index a6bd31276d..4e83e96f9c 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3876,6 +3876,9 @@
*/
#undef CONFIG_TEMP_SENSOR_POWER_GPIO
+/* AMD STT (Skin Temperature Tracking) */
+#undef CONFIG_AMD_STT
+
/* Compile common code for throttling the CPU based on the temp sensors */
#undef CONFIG_THROTTLE_AP
@@ -6434,4 +6437,9 @@
* !CONFIG_ACCELGYRO_BMI_I2C
*/
+/* AMD STT requires AMD SB-RMI to be enabled */
+#if defined(CONFIG_AMD_STT) && !defined(CONFIG_AMD_SB_RMI)
+#define CONFIG_AMD_SB_RMI
+#endif
+
#endif /* __CROS_EC_CONFIG_H */
diff --git a/include/driver/amd_stt.h b/include/driver/amd_stt.h
new file mode 100644
index 0000000000..3d382a6c0a
--- /dev/null
+++ b/include/driver/amd_stt.h
@@ -0,0 +1,27 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* AMD STT (Skin Temperature Tracking) Manager */
+
+#ifndef __CROS_EC_AMD_STT_H
+#define __CROS_EC_AMD_STT_H
+
+#define AMD_STT_WRITE_SENSOR_VALUE_CMD 0x3A
+
+enum amd_stt_pcb_sensor {
+ AMD_STT_PCB_SENSOR_APU = 0x0,
+ AMD_STT_PCB_SENSOR_REMOTE = 0x1,
+ AMD_STT_PCB_SENSOR_GPU = 0x2
+};
+
+/**
+ * Boards must implement these callbacks for SOC and Ambient temperature.
+ * Temperature must be returned in Milli Kelvin.
+ * TODO(b/192391025): Replace with direct calls to temp_sensor_read_mk
+ */
+int board_get_soc_temp_mk(int *temp_mk);
+int board_get_ambient_temp_mk(int *temp_mk);
+
+#endif /* __CROS_EC_AMD_STT_H */