summaryrefslogtreecommitdiff
path: root/board/morphius/board.c
diff options
context:
space:
mode:
authorZick Wei <zick.wei@quanta.corp-partner.google.com>2020-03-20 14:51:02 +0800
committerCommit Bot <commit-bot@chromium.org>2020-04-07 08:27:11 +0000
commit62e4ff1b2ace788736a37e7fc26b297bd8954eb5 (patch)
treea49d6d902a4efe7b410bb1e03adff5ac5c14d39e /board/morphius/board.c
parent5e61cf5d90823c422004e96b120a0660919da91b (diff)
downloadchrome-ec-62e4ff1b2ace788736a37e7fc26b297bd8954eb5.tar.gz
zork: move thermal setting to variant
This CL move thermal setting from baseboard to variant. BUG=b:153277249 BRANCH=none TEST=make buildall Change-Id: I456a00f2b72a079b875267bfa0a56dc7f87b7f9b Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2120765 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/morphius/board.c')
-rw-r--r--board/morphius/board.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/board/morphius/board.c b/board/morphius/board.c
index 13c8319760..93d93e05d4 100644
--- a/board/morphius/board.c
+++ b/board/morphius/board.c
@@ -265,3 +265,61 @@ void setup_fw_config(void)
setup_mux();
}
DECLARE_HOOK(HOOK_INIT, setup_fw_config, HOOK_PRIO_INIT_I2C + 2);
+
+/*****************************************************************************
+ * Fan
+ */
+
+/* Physical fans. These are logically separate from pwm_channels. */
+const struct fan_conf fan_conf_0 = {
+ .flags = FAN_USE_RPM_MODE,
+ .ch = MFT_CH_0, /* Use MFT id to control fan */
+ .pgood_gpio = -1,
+ .enable_gpio = -1,
+};
+const struct fan_rpm fan_rpm_0 = {
+ .rpm_min = 3100,
+ .rpm_start = 3100,
+ .rpm_max = 6900,
+};
+const struct fan_t fans[] = {
+ [FAN_CH_0] = {
+ .conf = &fan_conf_0,
+ .rpm = &fan_rpm_0,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);
+
+const static struct ec_thermal_config thermal_thermistor = {
+ .temp_host = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(75),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(80),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
+ },
+ .temp_fan_off = C_TO_K(25),
+ .temp_fan_max = C_TO_K(50),
+};
+
+const static struct ec_thermal_config thermal_cpu = {
+ .temp_host = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(85),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(95),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
+ },
+ .temp_fan_off = C_TO_K(25),
+ .temp_fan_max = C_TO_K(50),
+};
+
+struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT];
+
+static void setup_fans(void)
+{
+ thermal_params[TEMP_SENSOR_CHARGER] = thermal_thermistor;
+ thermal_params[TEMP_SENSOR_SOC] = thermal_thermistor;
+ thermal_params[TEMP_SENSOR_CPU] = thermal_cpu;
+}
+DECLARE_HOOK(HOOK_INIT, setup_fans, HOOK_PRIO_DEFAULT);