summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yeh <rcy@google.com>2022-11-28 04:08:24 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-31 04:00:20 +0000
commit41497123d484b33620f4adc9387f65722797b0f0 (patch)
tree35112f6342b30cc0d157f8d7cf44baee0e65fb2c
parentda770c44e6481758085af8d17efe731622a92c66 (diff)
downloadchrome-ec-firmware-puff-13324.B-master.tar.gz
{ambassador,genesis,moonbuggy,scout}: Increase fan to reduce throttling.firmware-puff-13324.B-master
Chromebox for Meetings (CfM) devices are videoconferencing appliances. Discovering that a significant fraction of our fleet was throttling the CPU due to temperature, resulting in bad video quality, we have decided that these devices should never throttle. The present change reduces the temperature thresholds at which we increase fan speeds. For most of the time, when the CfM is idle, we expect no or little change in fan speeds. During calls, the CfM CPU can exceed 60 C, and the sensors controlling the fan are typically 10-20 degrees C cooler than the CPU, so we set the maximum-fan temperature to 50-55 C in an attempt to arrest any temperature increase before the CPU reaches throttling temperatures. We add fan tables to enable hysteresis in the fan speed setting. Fan RPMs are chosen to span the min-to-max range, while avoiding 50 Hz and 60 Hz line frequencies. fizz and kalista boards are shared with non-CfM versions, while the other boards are CfM-only. Since those boards are several years old, we plan to build these firmware changes only into CfM-branch releases, not all fizz and kalista devices. Additional details at go/cfm-overheating . Temperature traces with load testing on both top-of-tree and firmware with this change are shown at go/cfm-overheating#heading=h.ykpzxotgnu2j BRANCH=update-fan-tables BUG=b:252966838,b:191187610,chromium:1383859 TEST=Confirmed validity of settings with `ectool thermalset`. Built firmware, flashed to endeavour and excelsior (fizz), verified that fan turns on earlier. This does not completely prevent throttling from 47.25 W to 15.00 W on Kaby Lake boards (endeavour, fizz, kalista), but it does prevent dropping below 15.00 W. Comet Lake boards (ambassador, genesis, moonbuggy, scout) start at 15.00 W and rarely throttle anyway. Signed-off-by: Richard Yeh <rcy@google.com> Change-Id: I7f23583ca1b85d3b8b9da43918880f68b41538c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060610 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> (cherry picked from commit 5e2e4a52a1b2d5231285a7ff5081f291b8adad1a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4200717 Reviewed-by: Kyle Williams <kdgwill@chromium.org>
-rw-r--r--board/ambassador/board.c39
-rw-r--r--board/ambassador/board.h1
-rw-r--r--board/genesis/board.c39
-rw-r--r--board/genesis/board.h1
-rw-r--r--board/moonbuggy/board.c39
-rw-r--r--board/moonbuggy/board.h1
-rw-r--r--board/scout/board.c39
-rw-r--r--board/scout/board.h1
8 files changed, 152 insertions, 8 deletions
diff --git a/board/ambassador/board.c b/board/ambassador/board.c
index 866623b4d8..8ecd03688a 100644
--- a/board/ambassador/board.c
+++ b/board/ambassador/board.c
@@ -380,6 +380,8 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT);
/******************************************************************************/
/* Thermal control; drive fan based on temperature sensors. */
+static const int temp_fan_off = C_TO_K(35);
+static const int temp_fan_max = C_TO_K(55);
const static struct ec_thermal_config thermal_a = {
.temp_host = {
[EC_TEMP_THRESH_WARN] = 0,
@@ -391,8 +393,8 @@ const static struct ec_thermal_config thermal_a = {
[EC_TEMP_THRESH_HIGH] = C_TO_K(70),
[EC_TEMP_THRESH_HALT] = 0,
},
- .temp_fan_off = C_TO_K(25),
- .temp_fan_max = C_TO_K(84),
+ .temp_fan_off = temp_fan_off,
+ .temp_fan_max = temp_fan_max,
};
const static struct ec_thermal_config thermal_b = {
@@ -413,6 +415,39 @@ struct ec_thermal_config thermal_params[] = {
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+static const struct fan_step_1_1 fan_table0[] = {
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(35),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(41),
+ .rpm = 2500 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(40),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .rpm = 2900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(42),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .rpm = 3400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .rpm = 3900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .rpm = 4400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(52),
+ .rpm = 4900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(55),
+ .rpm = 5200 },
+};
+#define NUM_FAN_LEVELS ARRAY_SIZE(fan_table0)
+
+static const struct fan_step_1_1 *fan_table = fan_table0;
+
+int fan_percent_to_rpm(int fan_index, int temp_ratio)
+{
+ return temp_ratio_to_rpm_hysteresis(fan_table, NUM_FAN_LEVELS,
+ fan_index, temp_ratio, NULL);
+}
+
/* Power sensors */
const struct ina3221_t ina3221[] = {
{ I2C_PORT_INA, 0x40, { "PP3300_G", "PP5000_A", "PP3300_WLAN" } },
diff --git a/board/ambassador/board.h b/board/ambassador/board.h
index db9463a276..da7906ad58 100644
--- a/board/ambassador/board.h
+++ b/board/ambassador/board.h
@@ -120,6 +120,7 @@
#define CONFIG_FANS 1
#undef CONFIG_FAN_INIT_SPEED
#define CONFIG_FAN_INIT_SPEED 0
+#define CONFIG_FAN_RPM_CUSTOM
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_ROA_RAILS
#define CONFIG_THERMISTOR
diff --git a/board/genesis/board.c b/board/genesis/board.c
index 22bed97fe7..7c56544390 100644
--- a/board/genesis/board.c
+++ b/board/genesis/board.c
@@ -228,6 +228,8 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT);
/******************************************************************************/
/* Thermal control; drive fan based on temperature sensors. */
+static const int temp_fan_off = C_TO_K(35);
+static const int temp_fan_max = C_TO_K(55);
const static struct ec_thermal_config thermal_a = {
.temp_host = {
[EC_TEMP_THRESH_WARN] = 0,
@@ -239,8 +241,8 @@ const static struct ec_thermal_config thermal_a = {
[EC_TEMP_THRESH_HIGH] = C_TO_K(70),
[EC_TEMP_THRESH_HALT] = 0,
},
- .temp_fan_off = C_TO_K(25),
- .temp_fan_max = C_TO_K(84),
+ .temp_fan_off = temp_fan_off,
+ .temp_fan_max = temp_fan_max,
};
struct ec_thermal_config thermal_params[] = {
@@ -248,6 +250,39 @@ struct ec_thermal_config thermal_params[] = {
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+static const struct fan_step_1_1 fan_table0[] = {
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(35),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(41),
+ .rpm = 2500 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(40),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .rpm = 2900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(42),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .rpm = 3400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .rpm = 3900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .rpm = 4400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(52),
+ .rpm = 4900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(55),
+ .rpm = 5200 },
+};
+#define NUM_FAN_LEVELS ARRAY_SIZE(fan_table0)
+
+static const struct fan_step_1_1 *fan_table = fan_table0;
+
+int fan_percent_to_rpm(int fan_index, int temp_ratio)
+{
+ return temp_ratio_to_rpm_hysteresis(fan_table, NUM_FAN_LEVELS,
+ fan_index, temp_ratio, NULL);
+}
+
/* Power sensors */
const struct ina3221_t ina3221[] = {
{ I2C_PORT_INA, 0x40, { "PP3300_G", "PP5000_A", "PP3300_WLAN" } },
diff --git a/board/genesis/board.h b/board/genesis/board.h
index eba2fd52e4..1688152739 100644
--- a/board/genesis/board.h
+++ b/board/genesis/board.h
@@ -106,6 +106,7 @@
#define CONFIG_FANS 1
#undef CONFIG_FAN_INIT_SPEED
#define CONFIG_FAN_INIT_SPEED 0
+#define CONFIG_FAN_RPM_CUSTOM
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_ROA_RAILS
#define CONFIG_THERMISTOR
diff --git a/board/moonbuggy/board.c b/board/moonbuggy/board.c
index 5a9069135e..6f55a206e0 100644
--- a/board/moonbuggy/board.c
+++ b/board/moonbuggy/board.c
@@ -264,6 +264,8 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT);
/******************************************************************************/
/* Thermal control; drive fan based on temperature sensors. */
+static const int temp_fan_off = C_TO_K(35);
+static const int temp_fan_max = C_TO_K(55);
const static struct ec_thermal_config thermal_a = {
.temp_host = {
[EC_TEMP_THRESH_WARN] = 0,
@@ -275,8 +277,8 @@ const static struct ec_thermal_config thermal_a = {
[EC_TEMP_THRESH_HIGH] = C_TO_K(78),
[EC_TEMP_THRESH_HALT] = 0,
},
- .temp_fan_off = C_TO_K(25),
- .temp_fan_max = C_TO_K(89),
+ .temp_fan_off = temp_fan_off,
+ .temp_fan_max = temp_fan_max,
};
struct ec_thermal_config thermal_params[] = {
@@ -284,6 +286,39 @@ struct ec_thermal_config thermal_params[] = {
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+static const struct fan_step_1_1 fan_table0[] = {
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(35),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(41),
+ .rpm = 2500 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(40),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .rpm = 2900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(42),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .rpm = 3400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .rpm = 3900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .rpm = 4400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(52),
+ .rpm = 4900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(55),
+ .rpm = 5300 },
+};
+#define NUM_FAN_LEVELS ARRAY_SIZE(fan_table0)
+
+static const struct fan_step_1_1 *fan_table = fan_table0;
+
+int fan_percent_to_rpm(int fan_index, int temp_ratio)
+{
+ return temp_ratio_to_rpm_hysteresis(fan_table, NUM_FAN_LEVELS,
+ fan_index, temp_ratio, NULL);
+}
+
/* Power sensors */
const struct ina3221_t ina3221[] = {
{ I2C_PORT_INA, 0x40, { "PP3300_G", "PP5000_A", "PP3300_WLAN" } },
diff --git a/board/moonbuggy/board.h b/board/moonbuggy/board.h
index 993719a70c..598c1bf940 100644
--- a/board/moonbuggy/board.h
+++ b/board/moonbuggy/board.h
@@ -106,6 +106,7 @@
#define CONFIG_FANS 1
#undef CONFIG_FAN_INIT_SPEED
#define CONFIG_FAN_INIT_SPEED 0
+#define CONFIG_FAN_RPM_CUSTOM
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_ROA_RAILS
#define CONFIG_THERMISTOR
diff --git a/board/scout/board.c b/board/scout/board.c
index 6758828ae0..5ca703c76b 100644
--- a/board/scout/board.c
+++ b/board/scout/board.c
@@ -341,6 +341,8 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT);
/******************************************************************************/
/* Thermal control; drive fan based on temperature sensors. */
+static const int temp_fan_off = C_TO_K(35);
+static const int temp_fan_max = C_TO_K(55);
const static struct ec_thermal_config thermal_a = {
.temp_host = {
[EC_TEMP_THRESH_WARN] = 0,
@@ -352,8 +354,8 @@ const static struct ec_thermal_config thermal_a = {
[EC_TEMP_THRESH_HIGH] = C_TO_K(78),
[EC_TEMP_THRESH_HALT] = 0,
},
- .temp_fan_off = C_TO_K(25),
- .temp_fan_max = C_TO_K(89),
+ .temp_fan_off = temp_fan_off,
+ .temp_fan_max = temp_fan_max,
};
const static struct ec_thermal_config thermal_b = {
@@ -375,6 +377,39 @@ struct ec_thermal_config thermal_params[] = {
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+static const struct fan_step_1_1 fan_table0[] = {
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(35),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(41),
+ .rpm = 2400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(40),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .rpm = 2900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(42),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .rpm = 3400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(44),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .rpm = 3900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(46),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .rpm = 4400 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(48),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(52),
+ .rpm = 4900 },
+ { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(50),
+ .increasing_temp_ratio_threshold = TEMP_TO_RATIO(55),
+ .rpm = 5300 },
+};
+#define NUM_FAN_LEVELS ARRAY_SIZE(fan_table0)
+
+static const struct fan_step_1_1 *fan_table = fan_table0;
+
+int fan_percent_to_rpm(int fan_index, int temp_ratio)
+{
+ return temp_ratio_to_rpm_hysteresis(fan_table, NUM_FAN_LEVELS,
+ fan_index, temp_ratio, NULL);
+}
+
/* Power sensors */
const struct ina3221_t ina3221[] = {
{ I2C_PORT_INA, 0x40, { "PP3300_G", "PP5000_A", "PP3300_WLAN" } },
diff --git a/board/scout/board.h b/board/scout/board.h
index 802a4a3b1f..d83ccfd1d7 100644
--- a/board/scout/board.h
+++ b/board/scout/board.h
@@ -128,6 +128,7 @@
#define CONFIG_FANS 1
#undef CONFIG_FAN_INIT_SPEED
#define CONFIG_FAN_INIT_SPEED 0
+#define CONFIG_FAN_RPM_CUSTOM
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_ROA_RAILS
#define CONFIG_THERMISTOR