From be181cb3b31ebed14245046b2a084fa9e844b84e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B8rn=20Mork?= Date: Fri, 14 Feb 2025 10:59:36 +0100 Subject: [PATCH] realtek: add thermal zones for SFP sensors on SKS8300-8X MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Create thermal zones for SFP internal sensors, enabling shutdown on critical temperatures. Signed-off-by: Bjørn Mork Link: https://github.com/openwrt/openwrt/pull/17967 Signed-off-by: Sander Vanheule --- .../dts/rtl9303_xikestor_sks8300-8x.dts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8x.dts b/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8x.dts index 9632159368..e62636776b 100644 --- a/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8x.dts +++ b/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8x.dts @@ -132,6 +132,7 @@ 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 { @@ -141,6 +142,7 @@ 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 { @@ -150,6 +152,7 @@ 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 { @@ -159,6 +162,7 @@ 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 { @@ -168,6 +172,7 @@ 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 { @@ -177,6 +182,7 @@ 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 { @@ -186,6 +192,7 @@ 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 { @@ -195,6 +202,7 @@ mod-def0-gpio = <&gpio1 28 GPIO_ACTIVE_LOW>; tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>; maximum-power-milliwatt = <2900>; + #thermal-sensor-cells = <0>; }; }; @@ -432,3 +440,18 @@ }; }; }; + +&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"; + }; + }; + }; +}; -- 2.30.2