realtek: add thermal zones for SFP sensors on SKS8300-8X main master
authorBjørn Mork <bjorn@mork.no>
Fri, 14 Feb 2025 09:59:36 +0000 (10:59 +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/rtl9303_xikestor_sks8300-8x.dts

index 963215936839b0438d82c13912a75ca57b97e578..e62636776b77973b7804240486d8427990e891df 100644 (file)
                mod-def0-gpio = <&gpio1 1 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <2900>;
+               #thermal-sensor-cells = <0>;
        };
 
        sfp1: sfp-p2 {
                mod-def0-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <1500>;
+               #thermal-sensor-cells = <0>;
        };
 
        sfp2: sfp-p3 {
                mod-def0-gpio = <&gpio1 7 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <1500>;
+               #thermal-sensor-cells = <0>;
        };
 
        sfp3: sfp-p4 {
                mod-def0-gpio = <&gpio1 10 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <2000>;
+               #thermal-sensor-cells = <0>;
        };
 
        sfp4: sfp-p5 {
                mod-def0-gpio = <&gpio1 13 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <2000>;
+               #thermal-sensor-cells = <0>;
        };
 
        sfp5: sfp-p6 {
                mod-def0-gpio = <&gpio1 22 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <1500>;
+               #thermal-sensor-cells = <0>;
        };
 
        sfp6: sfp-p7 {
                mod-def0-gpio = <&gpio1 25 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <1500>;
+               #thermal-sensor-cells = <0>;
        };
 
        sfp7: sfp-p8 {
                mod-def0-gpio = <&gpio1 28 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <2900>;
+               #thermal-sensor-cells = <0>;
        };
 };
 
                };
        };
 };
+
+&thermal_zones {
+       sfp-thermal {
+               polling-delay-passive = <10000>;
+               polling-delay = <10000>;
+               thermal-sensors = <&sfp0>, <&sfp1>, <&sfp2>, <&sfp3>, <&sfp4>, <&sfp5>, <&sfp6>, <&sfp7>;
+               trips {
+                       sfp-crit {
+                               temperature = <110000>;
+                               hysteresis = <1000>;
+                               type = "critical";
+                       };
+               };
+       };
+};