From a5a81dca4579961b9d78c7c85442d76b3c87dbbb Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Wed, 17 Feb 2021 12:15:21 +0100 Subject: zephyr: add shim thermal support Add thermal support to Zephyr which includes handling temperature threshold for certain events. The thresholds are defined in the dts file as temperature sensor parameters - there are limits per temperature sensor. The struct ec_thermal_config thermal_params[] array with all parameters is generated automatically based on named_temp_sensors node. Enable "thermalget" and "thermalset" console commands along with EC_CMD_THERMAL_GET_THRESHOLD and EC_CMD_THERMAL_SET_THRESHOLD host commands. Also, add a few functions to utils needed to verify if an event occurred (falling/rising edge). BUG=b:179886912 BRANCH=none TEST=build Zephyr TEST=Run "thermalget" command to check current thresholds. Change the thresholds with "thermalset" to verify if AP throttling is requested. Signed-off-by: Dawid Niedzwiecki Change-Id: I5f527ceecab2427b3034fd8baa62bb8482f99ff3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2698845 Reviewed-by: Simon Glass --- zephyr/shim/src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'zephyr/shim/src/CMakeLists.txt') diff --git a/zephyr/shim/src/CMakeLists.txt b/zephyr/shim/src/CMakeLists.txt index 38955f65d4..0311299074 100644 --- a/zephyr/shim/src/CMakeLists.txt +++ b/zephyr/shim/src/CMakeLists.txt @@ -27,7 +27,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_MPU mpu.c) zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PANIC panic.c) zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PWM pwm.c) zephyr_sources_ifdef(CONFIG_PLATFORM_EC_RTC rtc.c) -zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TEMP_SENSOR temp_sensors.c) +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TEMP_SENSOR temp_sensors.c + thermal.c) zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TIMER hwtimer.c) zephyr_sources_ifdef(CONFIG_PLATFORM_EC_I2C i2c.c) zephyr_sources_ifdef(CONFIG_SHIMMED_TASKS tasks.c) -- cgit v1.2.1