[openwrt/openwrt] realtek: add thermal zones for SFP sensors on SKS8300-8X

LEDE Commits lede-commits at lists.infradead.org
Thu Feb 27 10:26:14 PST 2025


svanheule pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/be181cb3b31ebed14245046b2a084fa9e844b84e

commit be181cb3b31ebed14245046b2a084fa9e844b84e
Author: Bjørn Mork <bjorn at mork.no>
AuthorDate: Fri Feb 14 10:59:36 2025 +0100

    realtek: add thermal zones for SFP sensors on SKS8300-8X
    
    Create thermal zones for SFP internal sensors, enabling shutdown
    on critical temperatures.
    
    Signed-off-by: Bjørn Mork <bjorn at mork.no>
    Link: https://github.com/openwrt/openwrt/pull/17967
    Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 .../realtek/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";
+			};
+		};
+	};
+};




More information about the lede-commits mailing list