diff options
author | Zick Wei <zick.wei@quanta.corp-partner.google.com> | 2020-09-03 15:12:01 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-19 03:49:12 +0000 |
commit | 2f181043100a03655b2c14a1536950e27c76fbfe (patch) | |
tree | 98a60d23f2f33bb57d4cf6390c0a8ad63e785d32 /board/morphius | |
parent | f264de460f8e472aa29f8bc269f4d698b85d6cf3 (diff) | |
download | chrome-ec-2f181043100a03655b2c14a1536950e27c76fbfe.tar.gz |
morphius: update thermal table
This patch update fan curve table,
and Bag test thermal condition:
when DC mode + 0° ≦ Lid ≦ 10° Sensor 2(CPU temp) > 70℃, do CPU ProcHot
release when Sensor 2 < 60℃,
Shutdown when Sensor 1(5V) > 51℃.
BUG=b:168847050
BRANCH=zork
TEST=fan curve follow fan table
Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Change-Id: I7e73c6fa7779061b839af33c05c8d5745000bfd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2391032
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'board/morphius')
-rw-r--r-- | board/morphius/thermal.c | 223 |
1 files changed, 123 insertions, 100 deletions
diff --git a/board/morphius/thermal.c b/board/morphius/thermal.c index e7f976f681..019e377aca 100644 --- a/board/morphius/thermal.c +++ b/board/morphius/thermal.c @@ -55,39 +55,39 @@ static const struct fan_step fan1_table_clamshell[] = { }, { /* level 2 */ - .on = {-1, -1, 47, -1}, - .off = {-1, -1, 45, -1}, - .rpm = {2600}, + .on = {-1, -1, 45, -1}, + .off = {-1, -1, 43, -1}, + .rpm = {2900}, }, { /* level 3 */ - .on = {-1, -1, 50, -1}, - .off = {-1, -1, 48, -1}, - .rpm = {3400}, + .on = {-1, -1, 48, -1}, + .off = {-1, -1, 46, -1}, + .rpm = {3200}, }, { /* level 4 */ - .on = {-1, -1, 53, -1}, - .off = {-1, -1, 51, -1}, - .rpm = {3800}, + .on = {-1, -1, 51, -1}, + .off = {-1, -1, 49, -1}, + .rpm = {3550}, }, { /* level 5 */ - .on = {-1, -1, 56, -1}, - .off = {-1, -1, 54, -1}, - .rpm = {4200}, + .on = {-1, -1, 54, -1}, + .off = {-1, -1, 52, -1}, + .rpm = {3950}, }, { /* level 6 */ - .on = {-1, -1, 59, -1}, - .off = {-1, -1, 57, -1}, - .rpm = {4500}, + .on = {-1, -1, 57, -1}, + .off = {-1, -1, 55, -1}, + .rpm = {4250}, }, { /* level 7 */ - .on = {-1, -1, 62, -1}, - .off = {-1, -1, 60, -1}, - .rpm = {4850}, + .on = {-1, -1, 60, -1}, + .off = {-1, -1, 58, -1}, + .rpm = {4650}, }, }; @@ -100,44 +100,44 @@ static const struct fan_step fan1_table_tablet[] = { }, { /* level 1 */ - .on = {-1, -1, 45, -1}, + .on = {-1, -1, 41, -1}, .off = {-1, -1, 31, -1}, - .rpm = {1900}, + .rpm = {2100}, }, { /* level 2 */ - .on = {-1, -1, 48, -1}, - .off = {-1, -1, 46, -1}, + .on = {-1, -1, 50, -1}, + .off = {-1, -1, 48, -1}, .rpm = {2600}, }, { /* level 3 */ - .on = {-1, -1, 52, -1}, - .off = {-1, -1, 49, -1}, - .rpm = {3000}, + .on = {-1, -1, 54, -1}, + .off = {-1, -1, 52, -1}, + .rpm = {2800}, }, { /* level 4 */ - .on = {-1, -1, 56, -1}, - .off = {-1, -1, 53, -1}, - .rpm = {3400}, + .on = {-1, -1, 57, -1}, + .off = {-1, -1, 55, -1}, + .rpm = {3300}, }, { /* level 5 */ .on = {-1, -1, 60, -1}, - .off = {-1, -1, 57, -1}, - .rpm = {3750}, + .off = {-1, -1, 58, -1}, + .rpm = {3800}, }, { /* level 6 */ - .on = {-1, -1, 64, -1}, - .off = {-1, -1, 61, -1}, + .on = {-1, -1, 72, -1}, + .off = {-1, -1, 69, -1}, .rpm = {4000}, }, { /* level 7 */ - .on = {-1, -1, 68, -1}, - .off = {-1, -1, 65, -1}, + .on = {-1, -1, 74, -1}, + .off = {-1, -1, 73, -1}, .rpm = {4300}, }, }; @@ -151,45 +151,45 @@ static const struct fan_step fan1_table_stand[] = { }, { /* level 1 */ - .on = {-1, -1, 38, -1}, + .on = {-1, -1, 34, -1}, .off = {-1, -1, 31, -1}, .rpm = {1850}, }, { /* level 2 */ - .on = {-1, -1, 45, -1}, - .off = {-1, -1, 42, -1}, + .on = {-1, -1, 42, -1}, + .off = {-1, -1, 39, -1}, .rpm = {2550}, }, { /* level 3 */ .on = {-1, -1, 49, -1}, - .off = {-1, -1, 46, -1}, - .rpm = {3000}, + .off = {-1, -1, 48, -1}, + .rpm = {2900}, }, { /* level 4 */ - .on = {-1, -1, 53, -1}, + .on = {-1, -1, 51, -1}, .off = {-1, -1, 50, -1}, - .rpm = {3450}, + .rpm = {3350}, }, { /* level 5 */ - .on = {-1, -1, 57, -1}, - .off = {-1, -1, 54, -1}, - .rpm = {3800}, + .on = {-1, -1, 53, -1}, + .off = {-1, -1, 52, -1}, + .rpm = {3700}, }, { /* level 6 */ - .on = {-1, -1, 61, -1}, - .off = {-1, -1, 58, -1}, - .rpm = {4050}, + .on = {-1, -1, 55, -1}, + .off = {-1, -1, 54, -1}, + .rpm = {3900}, }, { /* level 7 */ - .on = {-1, -1, 65, -1}, - .off = {-1, -1, 62, -1}, - .rpm = {4400}, + .on = {-1, -1, 57, -1}, + .off = {-1, -1, 56, -1}, + .rpm = {4250}, }, }; @@ -202,45 +202,45 @@ static const struct fan_step fan0_table_clamshell[] = { }, { /* level 1 */ - .on = {-1, -1, 40, -1}, + .on = {-1, -1, 41, -1}, .off = {-1, -1, 31, -1}, - .rpm = {2200}, + .rpm = {2350}, }, { /* level 2 */ + .on = {-1, -1, 44, -1}, + .off = {-1, -1, 42, -1}, + .rpm = {3300}, + }, + { + /* level 3 */ .on = {-1, -1, 47, -1}, .off = {-1, -1, 45, -1}, - .rpm = {3000}, + .rpm = {3600}, }, { - /* level 3 */ + /* level 4 */ .on = {-1, -1, 50, -1}, .off = {-1, -1, 48, -1}, - .rpm = {3350}, + .rpm = {4050}, }, { - /* level 4 */ + /* level 5 */ .on = {-1, -1, 53, -1}, .off = {-1, -1, 51, -1}, - .rpm = {4000}, - }, - { - /* level 5 */ - .on = {-1, -1, 56, -1}, - .off = {-1, -1, 54, -1}, .rpm = {4450}, }, { /* level 6 */ - .on = {-1, -1, 59, -1}, - .off = {-1, -1, 57, -1}, + .on = {-1, -1, 56, -1}, + .off = {-1, -1, 54, -1}, .rpm = {4750}, }, { /* level 7 */ - .on = {-1, -1, 62, -1}, - .off = {-1, -1, 60, -1}, - .rpm = {5000}, + .on = {-1, -1, 59, -1}, + .off = {-1, -1, 57, -1}, + .rpm = {5150}, }, }; @@ -253,45 +253,45 @@ static const struct fan_step fan0_table_tablet[] = { }, { /* level 1 */ - .on = {-1, -1, 45, -1}, + .on = {-1, -1, 41, -1}, .off = {-1, -1, 31, -1}, - .rpm = {2200}, + .rpm = {2250}, }, { /* level 2 */ - .on = {-1, -1, 48, -1}, - .off = {-1, -1, 46, -1}, + .on = {-1, -1, 50, -1}, + .off = {-1, -1, 48, -1}, .rpm = {2850}, }, { /* level 3 */ - .on = {-1, -1, 52, -1}, - .off = {-1, -1, 49, -1}, - .rpm = {3200}, + .on = {-1, -1, 54, -1}, + .off = {-1, -1, 51, -1}, + .rpm = {3100}, }, { /* level 4 */ - .on = {-1, -1, 56, -1}, - .off = {-1, -1, 53, -1}, - .rpm = {3600}, + .on = {-1, -1, 57, -1}, + .off = {-1, -1, 55, -1}, + .rpm = {3500}, }, { /* level 5 */ .on = {-1, -1, 60, -1}, - .off = {-1, -1, 57, -1}, - .rpm = {4000}, + .off = {-1, -1, 58, -1}, + .rpm = {3900}, }, { /* level 6 */ - .on = {-1, -1, 64, -1}, - .off = {-1, -1, 61, -1}, - .rpm = {4300}, + .on = {-1, -1, 72, -1}, + .off = {-1, -1, 69, -1}, + .rpm = {4150}, }, { /* level 7 */ - .on = {-1, -1, 68, -1}, - .off = {-1, -1, 65, -1}, - .rpm = {4550}, + .on = {-1, -1, 74, -1}, + .off = {-1, -1, 73, -1}, + .rpm = {4400}, }, }; @@ -304,51 +304,52 @@ static const struct fan_step fan0_table_stand[] = { }, { /* level 1 */ - .on = {-1, -1, 38, -1}, + .on = {-1, -1, 34, -1}, .off = {-1, -1, 31, -1}, - .rpm = {2150}, + .rpm = {2250}, }, { /* level 2 */ - .on = {-1, -1, 45, -1}, - .off = {-1, -1, 42, -1}, - .rpm = {2900}, + .on = {-1, -1, 42, -1}, + .off = {-1, -1, 39, -1}, + .rpm = {2800}, }, { /* level 3 */ .on = {-1, -1, 49, -1}, - .off = {-1, -1, 46, -1}, + .off = {-1, -1, 48, -1}, .rpm = {3150}, }, { /* level 4 */ - .on = {-1, -1, 53, -1}, + .on = {-1, -1, 51, -1}, .off = {-1, -1, 50, -1}, - .rpm = {3600}, + .rpm = {3550}, }, { /* level 5 */ - .on = {-1, -1, 57, -1}, - .off = {-1, -1, 54, -1}, + .on = {-1, -1, 53, -1}, + .off = {-1, -1, 52, -1}, .rpm = {3900}, }, { /* level 6 */ - .on = {-1, -1, 61, -1}, - .off = {-1, -1, 58, -1}, + .on = {-1, -1, 55, -1}, + .off = {-1, -1, 54, -1}, .rpm = {4150}, }, { /* level 7 */ - .on = {-1, -1, 65, -1}, - .off = {-1, -1, 62, -1}, - .rpm = {4450}, + .on = {-1, -1, 57, -1}, + .off = {-1, -1, 56, -1}, + .rpm = {4400}, }, }; #define NUM_FAN_LEVELS ARRAY_SIZE(fan1_table_clamshell) #define lid_angle_tablet 340 +static int throttle_on; BUILD_ASSERT(ARRAY_SIZE(fan1_table_clamshell) == ARRAY_SIZE(fan1_table_tablet)); @@ -491,3 +492,25 @@ void board_override_fan_control(int fan, int *tmp) } } } + +void thermal_protect(void) +{ + int thermal_sensor1, thermal_sensor2; + + temp_sensor_read(TEMP_SENSOR_5V_REGULATOR, &thermal_sensor1); + temp_sensor_read(TEMP_SENSOR_CPU, &thermal_sensor2); + + if ((!lid_is_open()) && (!extpower_is_present())) { + if (thermal_sensor2 > C_TO_K(70)) { + chipset_throttle_cpu(1); + throttle_on = 1; + } else if (thermal_sensor2 < C_TO_K(60) && throttle_on) { + chipset_throttle_cpu(0); + throttle_on = 0; + } + + if (thermal_sensor1 > C_TO_K(51)) + chipset_force_shutdown(CHIPSET_SHUTDOWN_THERMAL); + } +} +DECLARE_HOOK(HOOK_SECOND, thermal_protect, HOOK_PRIO_DEFAULT); |