summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Hsu <Henry.Hsu@quantatw.com>2013-09-09 14:58:00 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-09-12 12:33:44 +0000
commit95494966db9009e59be7e263d26928bfac0a67be (patch)
tree4a62afaf543df17558835f75a7599fb5bff4eaa7
parent24570b30a89c60a43a00293f36bc76a43681abc2 (diff)
downloadchrome-ec-95494966db9009e59be7e263d26928bfac0a67be.tar.gz
Set the Wolf thermal table.(Wolf branch only)
This is hard code for wolf. (code base from CL Falco: set fan/thermal steps (BRANCH ONLY) ) The thermal table for wolf is Step Fan RPM trigger point (CPU Tj) unit K / 'C Step 1 0 under 318K / 45'C Step 2 3000 318K / 45'C Step 3 3500 323K / 50'C Step 4 4000 328K / 55'C Step 5 4200 332K / 59'C Step 6 4500 335K / 62'C Step 7 4800 338K / 65'C Step 8 5000 341K / 68'C 368K / 100C => assert PROCHOT 373K / 105C => give the CPU three second to cool off, then shutdown 378K / 110C => shutdown immediately BUG=none BRANCH=wolf ONLY! TEST=manual Change-Id: I2e2048b5b226a5de091bf101e23018eee031b6af Signed-off-by: Henry Hsu <Henry.Hsu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/168395 Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
-rw-r--r--common/thermal.c25
-rw-r--r--include/thermal.h9
2 files changed, 32 insertions, 2 deletions
diff --git a/common/thermal.c b/common/thermal.c
index 0015f5cca6..3f67d8d2d4 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -27,20 +27,41 @@
* temp_sensor_type. Threshold values for overheated action first (warning,
* prochot, power-down), followed by fan speed stepping thresholds.
*/
+
+/* DANGER WILL ROBINSON: This is an ugly hack, just for wolf.
+ * DO NOT USE THIS AS AN EXAMPLE OF WHAT TO DO FOR ANY OTHER BOARD!!
+ */
+#ifdef BOARD_wolf /* DON'T DO THIS */
test_export_static struct thermal_config_t
thermal_config[TEMP_SENSOR_TYPE_COUNT] = {
/* TEMP_SENSOR_TYPE_CPU */
{THERMAL_CONFIG_WARNING_ON_FAIL,
- {373, 378, 383, 327, 335, 343, 351, 359} } ,
+ {368, 373, 378,
+ 318, 323, 328, 332, 335, 338, 341} } ,
/* TEMP_SENSOR_TYPE_BOARD */
{THERMAL_CONFIG_NO_FLAG, {THERMAL_THRESHOLD_DISABLE_ALL} },
/* TEMP_SENSOR_TYPE_CASE */
{THERMAL_CONFIG_NO_FLAG, {THERMAL_THRESHOLD_DISABLE_ALL} },
};
-
/* Fan speed settings. Real max RPM is about 9300. */
test_export_static const int fan_speed[THERMAL_FAN_STEPS + 1] =
+ {0, 3000, 3500, 4000, 4200, 4500, 4800, 5000};
+#endif
+#ifdef BOARD_host /* for testing */ /* DON'T DO THIS */
+test_export_static struct thermal_config_t
+ thermal_config[TEMP_SENSOR_TYPE_COUNT] = {
+ /* TEMP_SENSOR_TYPE_CPU */
+ {THERMAL_CONFIG_WARNING_ON_FAIL,
+ {373, 378, 383,
+ 327, 335, 343, 351, 359} } ,
+ /* TEMP_SENSOR_TYPE_BOARD */
+ {THERMAL_CONFIG_NO_FLAG, {THERMAL_THRESHOLD_DISABLE_ALL} },
+ /* TEMP_SENSOR_TYPE_CASE */
+ {THERMAL_CONFIG_NO_FLAG, {THERMAL_THRESHOLD_DISABLE_ALL} },
+};
+test_export_static const int fan_speed[THERMAL_FAN_STEPS + 1] =
{0, 3000, 4575, 6150, 7725, -1};
+#endif
/* Number of consecutive overheated events for each temperature sensor. */
static int8_t ot_count[TEMP_SENSOR_COUNT][THRESHOLD_COUNT + THERMAL_FAN_STEPS];
diff --git a/include/thermal.h b/include/thermal.h
index 3e43dfcd1a..16d162f2e6 100644
--- a/include/thermal.h
+++ b/include/thermal.h
@@ -17,7 +17,16 @@
* Number of steps for fan speed control. Speed of each step is defined
* in thermal.c.
*/
+
+/* DANGER WILL ROBINSON: This is an ugly hack, just for wolf.
+ * DO NOT USE THIS AS AN EXAMPLE OF WHAT TO DO FOR ANY OTHER BOARD!!
+ */
+#ifdef BOARD_wolf /* DON'T DO THIS */
+#define THERMAL_FAN_STEPS 7
+#endif
+#ifdef BOARD_host /* for testing */ /* DON'T DO THIS */
#define THERMAL_FAN_STEPS 5
+#endif
/* Set a threshold temperature to this value to disable the threshold limit. */
#define THERMAL_THRESHOLD_DISABLE 0