summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/CMakeLists.txt
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-03-02 14:46:32 +0100
committerCommit Bot <commit-bot@chromium.org>2021-03-08 17:31:52 +0000
commitcfbbbb93b44799c61f5591b9658d650136ab5ac4 (patch)
tree40c0a2598c3c8b46f3fb187812d399e5fa3fc2a6 /zephyr/shim/src/CMakeLists.txt
parent1a7ba0f3822829ad69d860ee41bb4ae756c4756d (diff)
downloadchrome-ec-cfbbbb93b44799c61f5591b9658d650136ab5ac4.tar.gz
zephyr: add shim fan
Add fan support to Zephyr. The fan is controlled with PWM and the fan speed is measured with the tachometer. Fan properties are defied in the dts file. The struct fan_t fans[] array and enum fan_channel are generated automatically according to named-fans node in the device tree. The implementation is based on the npxc driver, but it is platform-independent. It assumes that there are PWM channel to control the fan and the tachometer sensor to measure RPM (in RPM mode). If it is not the case in the future, the shim may be split per chip. Enable fan related console commands - fanduty, fanset, faninfo, fanauto and host commands - EC_CMD_PWM_GET_FAN_TARGET_RPM, EC_CMD_PWM_SET_FAN_TARGET_RPM, EC_CMD_PWM_SET_FAN_DUTY, EC_CMD_THERMAL_AUTO_FAN_CTRL. BUG=b:174851463 BRANCH=none TEST=build Zephyr TEST=Run "fanset"/"fanduty" commands and check with "faninfo" if the fan follows the command. Then run "fanauto" and verify that the fan controls the temperature correctly. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I52255848e271fb5b204cd1eb8a797e2fbc81130d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2729375 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/src/CMakeLists.txt')
-rw-r--r--zephyr/shim/src/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/zephyr/shim/src/CMakeLists.txt b/zephyr/shim/src/CMakeLists.txt
index 0311299074..c93736d14e 100644
--- a/zephyr/shim/src/CMakeLists.txt
+++ b/zephyr/shim/src/CMakeLists.txt
@@ -17,6 +17,7 @@ zephyr_sources_ifdef(no_libgcc libgcc_${ARCH}.S)
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ADC adc.c)
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ESPI espi.c)
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_FAN fan.c)
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_FLASH flash.c)
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOOKS hooks.c)
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD host_command.c)