diff options
author | Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> | 2021-02-02 14:26:38 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-03 02:50:37 +0000 |
commit | 99e746d0c6fb815e9e39fc255c29058d705a4bdb (patch) | |
tree | 42de26c4ceb314b0cd6467915a82c29285fa42d9 /board/metaknight | |
parent | 30de86869c610f51ad20f462c064754f971cd41f (diff) | |
download | chrome-ec-99e746d0c6fb815e9e39fc255c29058d705a4bdb.tar.gz |
Metaknight: Add thermal table
Add setup_thermal for setting thermal table
BUG=b:178678269
BRANCH=main
TEST=thermal team verify value on AP
Signed-off-by: yu-an.chen@quanta.corp-partner.google.com
Change-Id: I8b55a6e8c488e3a5eee713e6d73f908def3bec00
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666558
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/metaknight')
-rw-r--r-- | board/metaknight/board.c | 37 | ||||
-rw-r--r-- | board/metaknight/board.h | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/board/metaknight/board.c b/board/metaknight/board.c index 6d8a49bd8d..a99499695c 100644 --- a/board/metaknight/board.c +++ b/board/metaknight/board.c @@ -222,6 +222,40 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); +const static struct ec_thermal_config thermal_a = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(70), + [EC_TEMP_THRESH_HALT] = C_TO_K(85), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + [EC_TEMP_THRESH_HALT] = 0, + }, +}; + +const static struct ec_thermal_config thermal_b = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(75), + [EC_TEMP_THRESH_HALT] = C_TO_K(80), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + [EC_TEMP_THRESH_HALT] = 0, + }, +}; + +struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT]; + +static void setup_thermal(void) +{ + thermal_params[TEMP_SENSOR_1] = thermal_a; + thermal_params[TEMP_SENSOR_2] = thermal_b; +} + /* Enable HDMI any time the SoC is on */ static void hdmi_enable(void) { @@ -670,6 +704,9 @@ void board_init(void) } else ccprints("LID_ACCEL is BMA253"); + /* Initial thermal */ + setup_thermal(); + } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/board/metaknight/board.h b/board/metaknight/board.h index 1f7fcdaa98..abbdf906b6 100644 --- a/board/metaknight/board.h +++ b/board/metaknight/board.h @@ -46,6 +46,7 @@ /* Temp sensor */ #define CONFIG_TEMP_SENSOR +#define CONFIG_THROTTLE_AP #define CONFIG_THERMISTOR_NCP15WB #define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B #define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_PP3300_A |