diff options
Diffstat (limited to 'zephyr/projects')
-rw-r--r-- | zephyr/projects/guybrush/BUILD.py | 2 | ||||
-rw-r--r-- | zephyr/projects/guybrush/fan.dts | 29 | ||||
-rw-r--r-- | zephyr/projects/guybrush/gpio.dts | 2 | ||||
-rw-r--r-- | zephyr/projects/guybrush/prj.conf | 11 | ||||
-rw-r--r-- | zephyr/projects/guybrush/pwm.dts | 22 |
5 files changed, 64 insertions, 2 deletions
diff --git a/zephyr/projects/guybrush/BUILD.py b/zephyr/projects/guybrush/BUILD.py index 6b718fb788..03f3abe37f 100644 --- a/zephyr/projects/guybrush/BUILD.py +++ b/zephyr/projects/guybrush/BUILD.py @@ -5,5 +5,5 @@ register_npcx_project( project_name="guybrush", zephyr_board="npcx9", - dts_overlays=["battery.dts", "gpio.dts", "i2c.dts"], + dts_overlays=["battery.dts", "fan.dts", "gpio.dts", "i2c.dts", "pwm.dts"], ) diff --git a/zephyr/projects/guybrush/fan.dts b/zephyr/projects/guybrush/fan.dts new file mode 100644 index 0000000000..7ab15229e1 --- /dev/null +++ b/zephyr/projects/guybrush/fan.dts @@ -0,0 +1,29 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/ { + named-fans { + compatible = "named-fans"; + + fan_0 { + label = "FAN_0"; + pwm = <&pwm_fan>; + rpm_min = <1000>; + rpm_start = <1000>; + rpm_max = <6500>; + tach = <&tach1>; + pgood_gpio = <&gpio_s0_pgood>; + }; + }; +}; + +/* Tachemeter for fan speed measurement */ +&tach1 { + status = "okay"; + pinctrl-0 = <&alt3_ta1_sl1>; /* Use TA1 as input pin */ + port = <NPCX_TACH_PORT_A>; /* port-A is selected */ + sample-clk = <NPCX_TACH_FREQ_LFCLK>; /* Use LFCLK as sampling clock */ + pulses-per-round = <2>; /* number of pulses per round of encoder */ +}; diff --git a/zephyr/projects/guybrush/gpio.dts b/zephyr/projects/guybrush/gpio.dts index e3be6833c7..ce0b307686 100644 --- a/zephyr/projects/guybrush/gpio.dts +++ b/zephyr/projects/guybrush/gpio.dts @@ -45,7 +45,7 @@ label = "PG_PWR_S5"; enum-name = "GPIO_S5_PGOOD"; }; - pg_pcore_s0_r_od { + gpio_s0_pgood: pg_pcore_s0_r_od { gpios = <&gpiob 6 GPIO_INPUT>; label = "PG_PCORE_S0_R_OD"; enum-name = "GPIO_S0_PGOOD"; diff --git a/zephyr/projects/guybrush/prj.conf b/zephyr/projects/guybrush/prj.conf index 8d077520eb..754f369abd 100644 --- a/zephyr/projects/guybrush/prj.conf +++ b/zephyr/projects/guybrush/prj.conf @@ -30,6 +30,12 @@ CONFIG_PLATFORM_EC_HOSTCMD=y CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y CONFIG_PLATFORM_EC_BACKLIGHT_LID=n +# Fan +CONFIG_PLATFORM_EC_FAN=y +CONFIG_SENSOR=y +CONFIG_SENSOR_SHELL=n +CONFIG_TACH_NPCX=y + # Lid switch CONFIG_PLATFORM_EC_LID_ANGLE=y CONFIG_PLATFORM_EC_LID_ANGLE_UPDATE=y @@ -40,6 +46,11 @@ CONFIG_PLATFORM_EC_KEYBOARD=y CONFIG_PLATFORM_EC_KEYBOARD_COL2_INVERTED=y CONFIG_PLATFORM_EC_VOLUME_BUTTONS=y +# PWM +CONFIG_PWM=y +CONFIG_PWM_SHELL=n +CONFIG_PLATFORM_EC_PWM=y + CONFIG_SYSCON=y # Battery diff --git a/zephyr/projects/guybrush/pwm.dts b/zephyr/projects/guybrush/pwm.dts new file mode 100644 index 0000000000..d31af74170 --- /dev/null +++ b/zephyr/projects/guybrush/pwm.dts @@ -0,0 +1,22 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/ { + named-pwms { + compatible = "named-pwms"; + + pwm_fan: fan { + pwms = <&pwm0 0 0>; + label = "FAN"; + frequency = <25000>; + }; + }; +}; + +/* Fan control */ +&pwm0 { + status = "okay"; + drive-open-drain; +}; |