summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorRyan Zhang <Ryan.Zhang@quanta.corp-partner.google.com>2018-01-25 14:35:37 +0800
committerDaisuke Nojiri <dnojiri@chromium.org>2018-02-08 13:57:12 -0800
commitd7f557a29c16cf39356a9717e5a46ccce8e2ce0b (patch)
tree494d3b3b389d3e8840ac584ece06ac390d17611c /board
parent0542682efdd90678895e7f03cffea7f045127653 (diff)
downloadchrome-ec-d7f557a29c16cf39356a9717e5a46ccce8e2ce0b.tar.gz
Fizz: Update thermal table by project
1. Prochot/Shutdown Point a. Prochot on: >=81C, off: <=77C b. Shutodwn: >=82C 2. custom fan table There are three projects sharing two tables, and use Kench & Teemo's table before getting correct OEM ID because it raises fan speed quicker than the other one. a. Kench & Teemo & default b. Sion BUG=b:70294260 BRANCH=master TEST=EC can get two fan tables with different cbi value. Change-Id: Ie1bffbcf5c353a9aae5806f6c2b41554eed22b7d Signed-off-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/886121 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/fizz/board.c58
1 files changed, 44 insertions, 14 deletions
diff --git a/board/fizz/board.c b/board/fizz/board.c
index 6bbaf25e70..d3de09dc05 100644
--- a/board/fizz/board.c
+++ b/board/fizz/board.c
@@ -291,8 +291,8 @@ struct ec_thermal_config thermal_params[] = {
* {Twarn, Thigh, X }, <off>
* fan_off, fan_max
*/
- {{0, C_TO_K(87), C_TO_K(89)}, {0, C_TO_K(86), 0},
- C_TO_K(44), C_TO_K(81)},/* TMP432_Internal */
+ {{0, C_TO_K(80), C_TO_K(81)}, {0, C_TO_K(78), 0},
+ C_TO_K(4), C_TO_K(76)}, /* TMP432_Internal */
{{0, 0, 0}, {0, 0, 0}, 0, 0}, /* TMP432_Sensor_1 */
{{0, 0, 0}, {0, 0, 0}, 0, 0}, /* TMP432_Sensor_2 */
};
@@ -600,23 +600,43 @@ struct fan_step {
int rpm;
};
-/* Do not make the fan on/off point equal to 0 or 100 */
-const struct fan_step fan_table[] = {
- {.off = 2, .rpm = 0},
- {.on = 16, .off = 2, .rpm = 2800},
- {.on = 27, .off = 18, .rpm = 3200},
- {.on = 35, .off = 29, .rpm = 3400},
- {.on = 43, .off = 37, .rpm = 4200},
- {.on = 54, .off = 45, .rpm = 4800},
- {.on = 64, .off = 56, .rpm = 5200},
- {.on = 97, .off = 83, .rpm = 5600},
+/* Note: Do not make the fan on/off point equal to 0 or 100 */
+static const struct fan_step fan_table0[] = {
+ {.on = 0, .off = 1, .rpm = 0},
+ {.on = 36, .off = 1, .rpm = 2800},
+ {.on = 58, .off = 58, .rpm = 3200},
+ {.on = 66, .off = 61, .rpm = 3400},
+ {.on = 75, .off = 69, .rpm = 4200},
+ {.on = 81, .off = 76, .rpm = 4800},
+ {.on = 88, .off = 83, .rpm = 5200},
+ {.on = 98, .off = 91, .rpm = 5600},
+};
+static const struct fan_step fan_table1[] = {
+ {.on = 0, .off = 1, .rpm = 0},
+ {.on = 36, .off = 1, .rpm = 2800},
+ {.on = 62, .off = 58, .rpm = 3200},
+ {.on = 68, .off = 63, .rpm = 3400},
+ {.on = 75, .off = 69, .rpm = 4200},
+ {.on = 81, .off = 76, .rpm = 4800},
+ {.on = 88, .off = 83, .rpm = 5200},
+ {.on = 98, .off = 91, .rpm = 5600},
+};
+/* All fan tables must have the same number of levels */
+#define NUM_FAN_LEVELS ARRAY_SIZE(fan_table0)
+BUILD_ASSERT(ARRAY_SIZE(fan_table1) == NUM_FAN_LEVELS);
+
+/* Default uses table0 due to its smaller active point */
+static const struct fan_step *fan_tables[] = {
+ fan_table0, /* Kench & Default */
+ fan_table0, /* Teemo */
+ fan_table1, /* Sion */
};
-#define NUM_FAN_LEVELS ARRAY_SIZE(fan_table)
-int fan_percent_to_rpm(int fan, int pct)
+static int get_custom_rpm(int fan, int pct, int oem_id)
{
static int current_level;
static int previous_pct;
+ const struct fan_step *fan_table = fan_tables[oem_id];
int i;
/*
@@ -653,3 +673,13 @@ int fan_percent_to_rpm(int fan, int pct)
return fan_table[current_level].rpm;
}
+
+int fan_percent_to_rpm(int fan, int pct)
+{
+ uint32_t oem_id;
+ if (cbi_get_oem_id(&oem_id) || oem_id >= ARRAY_SIZE(fan_tables)) {
+ CPRINTF("Fan OEM%d not supported or failed to get OEM", oem_id);
+ oem_id = 0;
+ }
+ return get_custom_rpm(fan, pct, oem_id);
+}