summaryrefslogtreecommitdiff
path: root/zephyr/program/skyrim/winterhold/src
diff options
context:
space:
mode:
authorShou-Chieh Hsu <shouchieh@google.com>2023-01-31 16:48:25 +0800
committerShou-Chieh Hsu <shouchieh@chromium.org>2023-01-31 08:59:49 +0000
commitdce247e97903a2464ff8884106bffa43587c1dcb (patch)
treee20629e33a27c322b1c569a4f929cb240eab3d1b /zephyr/program/skyrim/winterhold/src
parent2962a79f0aac5845ca29a04cfe90f9728d0a91e9 (diff)
parent9011f4f3f23078f6099e170c1661b12218d778b0 (diff)
downloadchrome-ec-dce247e97903a2464ff8884106bffa43587c1dcb.tar.gz
Merge remote-tracking branch cros/main into firmware-nissa-15217.B-main
Generated by: util/update_release_branch.py -r --zephyr --board nissa firmware- nissa-15217.B-main Relevant changes: git log --oneline 2962a79f0a..9011f4f3f2 -- zephyr/program/nissa util/getversion.sh af02307a26 xivu: modify form_factor motionsene function 0f7b43a563 pujjo: Increase OCP level margin to prevent OCP 221c98d97c craask: Config to reduce flash size BRANCH=None BUG=b:265752765 b:263996465 b:266867807 TEST=`make -j buildall` Force-Relevant-Builds: all Cq-Depend: chromium:4207308 Change-Id: Ia93d05dd17ed0d94820c222ce5b30ef60877b866 Signed-off-by: Shou-Chieh Hsu <shouchieh@google.com>
Diffstat (limited to 'zephyr/program/skyrim/winterhold/src')
-rw-r--r--zephyr/program/skyrim/winterhold/src/thermal.c101
1 files changed, 99 insertions, 2 deletions
diff --git a/zephyr/program/skyrim/winterhold/src/thermal.c b/zephyr/program/skyrim/winterhold/src/thermal.c
index dcc0562fff..e2c5e13298 100644
--- a/zephyr/program/skyrim/winterhold/src/thermal.c
+++ b/zephyr/program/skyrim/winterhold/src/thermal.c
@@ -13,7 +13,11 @@
#define CPRINTS(format, args...) cprints(CC_THERMAL, format, ##args)
#define CPRINTF(format, args...) cprintf(CC_THERMAL, format, ##args)
+/*AMB sensor for thermal tabel control*/
#define TEMP_AMB TEMP_SENSOR_ID(DT_NODELABEL(temp_sensor_amb))
+/*SOC and CPU sensor for fan tabel control*/
+#define TEMP_SOC TEMP_SENSOR_ID(DT_NODELABEL(temp_sensor_soc))
+#define TEMP_CPU TEMP_SENSOR_ID(DT_NODELABEL(temp_sensor_cpu))
/*
* TODO(b/202062363): Remove when clang is fixed.
@@ -59,12 +63,12 @@ __maybe_unused static const struct ec_thermal_config thermal_desktop_lid_close =
#define THERMAL_LAPTOP \
{ \
.temp_host = { \
- [EC_TEMP_THRESH_WARN] = C_TO_K(44), \
+ [EC_TEMP_THRESH_WARN] = C_TO_K(42), \
[EC_TEMP_THRESH_HIGH] = C_TO_K(105), \
[EC_TEMP_THRESH_HALT] = C_TO_K(110), \
}, \
.temp_host_release = { \
- [EC_TEMP_THRESH_WARN] = C_TO_K(40), \
+ [EC_TEMP_THRESH_WARN] = C_TO_K(38), \
[EC_TEMP_THRESH_HIGH] = C_TO_K(95), \
[EC_TEMP_THRESH_HALT] = C_TO_K(100), \
}, \
@@ -72,6 +76,93 @@ __maybe_unused static const struct ec_thermal_config thermal_desktop_lid_close =
__maybe_unused static const struct ec_thermal_config thermal_laptop =
THERMAL_LAPTOP;
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define FAN_SOC_DESKTOP_LID_OPEN \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(105), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(110), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(95), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(100), \
+ }, \
+ .temp_fan_off = C_TO_K(55), \
+ .temp_fan_max = C_TO_K(75), \
+ }
+__maybe_unused static const struct ec_thermal_config fan_soc_desktop_lid_open =
+ FAN_SOC_DESKTOP_LID_OPEN;
+
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define FAN_SOC_DESKTOP_LID_CLOSE \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(105), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(110), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(95), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(100), \
+ }, \
+ .temp_fan_off = C_TO_K(55), \
+ .temp_fan_max = C_TO_K(75), \
+ }
+__maybe_unused static const struct ec_thermal_config fan_soc_desktop_lid_close =
+ FAN_SOC_DESKTOP_LID_CLOSE;
+
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define FAN_SOC_LAPTOP \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(105), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(110), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(95), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(100), \
+ }, \
+ .temp_fan_off = C_TO_K(51), \
+ .temp_fan_max = C_TO_K(71), \
+ }
+__maybe_unused static const struct ec_thermal_config fan_soc_laptop =
+ FAN_SOC_LAPTOP;
+
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define FAN_CPU_DESKTOP_LID_OPEN \
+ { \
+ .temp_fan_off = C_TO_K(62), .temp_fan_max = C_TO_K(72), \
+ }
+__maybe_unused static const struct ec_thermal_config fan_cpu_desktop_lid_open =
+ FAN_CPU_DESKTOP_LID_OPEN;
+
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define FAN_CPU_DESKTOP_LID_CLOSE \
+ { \
+ .temp_fan_off = C_TO_K(62), .temp_fan_max = C_TO_K(72), \
+ }
+__maybe_unused static const struct ec_thermal_config fan_cpu_desktop_lid_close =
+ FAN_CPU_DESKTOP_LID_CLOSE;
+
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define FAN_CPU_LAPTOP \
+ { \
+ .temp_fan_off = C_TO_K(58), .temp_fan_max = C_TO_K(68), \
+ }
+__maybe_unused static const struct ec_thermal_config fan_cpu_laptop =
+ FAN_CPU_LAPTOP;
+
static int last_amb_temp = -1;
/* Switch thermal table when mode change */
@@ -82,13 +173,19 @@ static void thermal_table_switch(void)
if (body_state == BODY_DETECTION_OFF_BODY) {
if (lid_is_open()) {
thermal_params[TEMP_AMB] = thermal_desktop_lid_open;
+ thermal_params[TEMP_SOC] = fan_soc_desktop_lid_open;
+ thermal_params[TEMP_CPU] = fan_cpu_desktop_lid_open;
CPRINTS("Thermal: Desktop lid open mode");
} else {
thermal_params[TEMP_AMB] = thermal_desktop_lid_close;
+ thermal_params[TEMP_SOC] = fan_soc_desktop_lid_close;
+ thermal_params[TEMP_CPU] = fan_cpu_desktop_lid_close;
CPRINTS("Thermal: Desktop lid close mode");
}
} else {
thermal_params[TEMP_AMB] = thermal_laptop;
+ thermal_params[TEMP_SOC] = fan_soc_laptop;
+ thermal_params[TEMP_CPU] = fan_cpu_laptop;
CPRINTS("Thermal: Laptop mode");
}
}