Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5091

Device Tree • NVMe temp sensor - using hwmon for cooling an NVMe drive is non working

$
0
0
want to write an dtoverlay to control a PWM fan based on the NVMe temperature sensor data.

The overlay source is

Code:

/* * Overlay for a PWM Fan - used to cool NVMe drive * uses HW PWM on GPIO19 by default * References:  * * Optional parameters: * * nvme-pwm-fan-overlay.dts *//dts-v1/;/plugin/;#include <dt-bindings/gpio/gpio.h>#include <dt-bindings/thermal/thermal.h>#include <dt-bindings/pinctrl/bcm2835.h>/ {compatible = "brcm,bcm2835";fragment@0 {target = <&gpio>;__overlay__ {pwm_pins: pwm_pins {brcm,pins = <19>;brcm,function = <BCM2835_FSEL_ALT5>;brcm,pull = <0>;};};};fragment@1 {target = <&pwm>;frag1: __overlay__ {pinctrl-names = "default";pinctrl-0 = <&pwm_pins>;/* in Hz */assigned-clock-rates = <100000000>;status = "okay";};};fragment@2 {target-path = "/";__overlay__ {fan: pwm-fan {compatible = "pwm-fan";#cooling-cells = <2>;/* in ns */pwms = <&pwm 0 20000000 0>;cooling-min-state = <0>;cooling-max-state = <4>;/* PWM duty cycle values in a range from 0 to 255 * which correspond to thermal cooling states */cooling-levels = <0 75 125 150 200>;};};};fragment@3 {target = <&nvme>;__overlay__ {polling-delay = <2000>; /* milliseconds */};};fragment@4 {target = <&thermal_trips>;__overlay__ {trip0: trip0 {temperature = <35000>;hysteresis = <2000>;type = "active";};trip1: trip1 {temperature = <40000>;hysteresis = <2000>;type = "active";};trip2: trip2 {temperature = <45000>;hysteresis = <2000>;type = "active";};trip3: trip3 {temperature = <55000>;hysteresis = <5000>;type = "active";};};};fragment@5 {target = <&cooling_maps>;__overlay__ {map0 {trip = <&trip0>;cooling-device = <&fan 0 1>;};map1 {trip = <&trip1>;cooling-device = <&fan 1 2>;};map2 {trip = <&trip2>;cooling-device = <&fan 2 3>;};map3 {trip = <&trip3>;cooling-device = <&fan 3 4>;};};};__overrides__ {fan_nvme_temp0 = <&trip0>,"temperature:0";fan_nvme_temp0_hyst = <&trip0>,"hysteresis:0";fan_nvme_temp0_speed = <&fan>, "cooling-levels:4";fan_nvme_temp1 = <&trip1>,"temperature:0";fan_nvme_temp1_hyst = <&trip1>,"hysteresis:0";fan_nvme_temp1_speed = <&fan>, "cooling-levels:8";fan_nvme_temp2 = <&trip2>,"temperature:0";fan_nvme_temp2_hyst = <&trip2>,"hysteresis:0";fan_nvme_temp2_speed = <&fan>, "cooling-levels:12";fan_nvme_temp3 = <&trip3>,"temperature:0";fan_nvme_temp3_hyst = <&trip3>,"hysteresis:0";fan_nvme_temp3_speed = <&fan>, "cooling-levels:16";};};
Overlay compiles without issues but is not applied because of the unresolved symbol 'nvme' in fragment3

Code:

target = <&nvme>;
Checking my hwmon providers lists nvme as available device.

Code:

pi@Pi5-SN530-256:~ $ cat /sys/class/hwmon/hwmon*/namecpu_thermalnvmerp1_adcpwmfanrpi_voltpi@Pi5-SN530-256:~ $ grep -l "nvme" /sys/class/hwmon/hwmon*/name/sys/class/hwmon/hwmon1/namepi@Pi5-SN530-256:~ $ cat /sys/class/hwmon/hwmon1/temp1_input38850pi@Pi5-SN530-256:~ $ cat /sys/class/hwmon/hwmon1/device/modelWDC PC SN530 SDBPMPZ-256G-1101 
Why is 'nvme' the incorrect target and which one needs to be used instead to make that work?

Statistics: Posted by aBUGSworstnightmare — Tue Aug 20, 2024 6:12 pm



Viewing all articles
Browse latest Browse all 5091

Trending Articles