realtek: add thermal zones for SFP sensors on GS1900-10HP
authorBjørn Mork <bjorn@mork.no>
Fri, 14 Feb 2025 09:58:39 +0000 (10:58 +0100)
committerSander Vanheule <sander@svanheule.net>
Thu, 27 Feb 2025 18:24:45 +0000 (19:24 +0100)
Create thermal zones for SFP internal sensors, enabling shutdown
on critical temperatures.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/17967
Signed-off-by: Sander Vanheule <sander@svanheule.net>
target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts

index d21b7483922246b88d0612e7cb7f150a394fbaff..5e9aac0aeffbd3772c6bbe9f6ccaa486ea8480b4 100644 (file)
@@ -24,6 +24,7 @@
                tx-fault-gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
                mod-def0-gpio = <&gpio1 26 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+               #thermal-sensor-cells = <0>;
        };
 
        /* i2c of the right SFP cage: port 10 */
@@ -43,6 +44,7 @@
                tx-fault-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
                mod-def0-gpio = <&gpio1 32 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>;
+               #thermal-sensor-cells = <0>;
        };
 };
 
                };
        };
 };
+
+&thermal_zones {
+       sfp-thermal {
+               polling-delay-passive = <10000>;
+               polling-delay = <10000>;
+               thermal-sensors = <&sfp0>, <&sfp1>;
+               trips {
+                       sfp-crit {
+                               temperature = <110000>;
+                               hysteresis = <1000>;
+                               type = "critical";
+                       };
+               };
+       };
+};