summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2020-11-11 14:19:17 +1100
committerCommit Bot <commit-bot@chromium.org>2020-11-12 03:12:52 +0000
commit9676f9291f60efdfb31373aeb77385ebb6e9f6e5 (patch)
tree7166cf51fefa07430c2056765871440c3895c140
parentc91428f889dcf63a2ffd37d2eebbb7a6a356168f (diff)
downloadchrome-ec-9676f9291f60efdfb31373aeb77385ebb6e9f6e5.tar.gz
dalboz: enable thermal control
Dalboz (and variants) has temperature sensors, but they weren't used. Enable CONFIG_THROTTLE_AP for dalboz as well as trembyle, and define some default thermal parameters (the same as the trembyle reference board, but without fan options because dalboz devices are fanless) to have the EC do platform thermal control. Devices may override the default thermal options by defining a non-__overridable thermal_params in their own board files: struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT] = { /* Copy defaults, modify as desired. */ } BUG=b:172025135 TEST=Setting temperature thresholds with `thermalset` on dirinboz EC console causes AP throttling as expected, `temps` reports reasonable actual temperature measurements. BRANCH=zork Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I641bb8cae3b416bf8a76b4853e2053fad14aed1c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530817 Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--baseboard/zork/baseboard.h2
-rw-r--r--baseboard/zork/variant_dalboz.c31
2 files changed, 32 insertions, 1 deletions
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h
index adda3d044d..a827a44474 100644
--- a/baseboard/zork/baseboard.h
+++ b/baseboard/zork/baseboard.h
@@ -100,12 +100,12 @@
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_POWER_BUTTON_TO_PCH_CUSTOM
+#define CONFIG_THROTTLE_AP
#ifdef VARIANT_ZORK_TREMBYLE
#define CONFIG_FANS FAN_CH_COUNT
#undef CONFIG_FAN_INIT_SPEED
#define CONFIG_FAN_INIT_SPEED 50
- #define CONFIG_THROTTLE_AP
#endif
#define CONFIG_LED_COMMON
diff --git a/baseboard/zork/variant_dalboz.c b/baseboard/zork/variant_dalboz.c
index 6e76034ced..d0daf7a4d5 100644
--- a/baseboard/zork/variant_dalboz.c
+++ b/baseboard/zork/variant_dalboz.c
@@ -112,6 +112,37 @@ const struct temp_sensor_t temp_sensors[] = {
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+__overridable struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT] = {
+ [TEMP_SENSOR_CHARGER] = {
+ .temp_host = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(90),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(92),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(80),
+ }
+ },
+ [TEMP_SENSOR_SOC] = {
+ .temp_host = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(90),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(92),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(80),
+ }
+ },
+ [TEMP_SENSOR_CPU] = {
+ .temp_host = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(90),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(92),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(80),
+ }
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+
const struct i2c_port_t i2c_ports[] = {
{
.name = "tcpc0",