]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: mt-stuart: drive fan from AQR113C temperature
authorChad Monroe <chad@monroe.io>
Tue, 11 Aug 2026 02:59:44 +0000 (19:59 -0700)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 11 Aug 2026 20:13:10 +0000 (22:13 +0200)
The AQR113C PHYs run hot and sit away from the SoC sensor. Export
the PHY hwmon sensor as a thermal sensor and add a thermal zone per
AQR113C on all three boards. The zones drive the fan with trips at
108/104/100/90/80/40 C.

Set critical-action "reboot" so a runaway zone restarts the board
instead of an unclean thermal shutdown. Raise the trip hysteresis
from 2 C to 4 C to stop the fan from cycling near a trip point.
Stop passive polling; the zones use active cooling only.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/mediatek/dts/mt7988a-smartrg-SDG-8733.dtsi
target/linux/mediatek/dts/mt7988a-smartrg-mt-stuart-phase1.dtsi
target/linux/mediatek/dts/mt7988d-smartrg-SDG-8733A.dts
target/linux/mediatek/dts/mt798x-smartrg-common.dtsi

index 6608286601d0a28c1a77b5e7f1f7e9961c546279..c02a96007752d900a14b3cfa107339e9da40f80a 100644 (file)
@@ -8,6 +8,18 @@
 
 #include "mt7988a-smartrg-mt-stuart-phase1.dtsi"
 
+/ {
+       thermal-zones {
+               aqr_wan_thermal: aqr-wan-thermal {
+                       thermal-sensors = <&phy0>;
+                       SDG_1FAN_THERMAL_MAP(aqr_wan_thermal, &fan,
+                                            108000, 104000,
+                                            100000, 90000,
+                                            80000, 40000);
+               };
+       };
+};
+
 &gmac1 {
        phy = <&phy0>;
 };
@@ -17,6 +29,7 @@
                /* AQR113C */
                compatible = "ethernet-phy-ieee802.3-c45";
                reg = <0>;
+               #thermal-sensor-cells = <0>;
 
                leds {
                        #address-cells = <1>;
index d85cd0b2dcd4a95d232adc7bd275d2f2e666fc92..beed10343959cd1f82e48647e6cc885d5c9453c4 100644 (file)
                                             110000, 80000,
                                             60000, 40000);
                };
+
+               aqr_lan_thermal: aqr-lan-thermal {
+                       thermal-sensors = <&phy8>;
+                       SDG_1FAN_THERMAL_MAP(aqr_lan_thermal, &fan,
+                                            108000, 104000,
+                                            100000, 90000,
+                                            80000, 40000);
+               };
        };
 };
 
                /* AQR113C */
                compatible = "ethernet-phy-ieee802.3-c45";
                reg = <8>;
+               #thermal-sensor-cells = <0>;
 
                leds {
                        #address-cells = <1>;
index 1e7b72e701587062c04f6adba19dc7dcba5d6cad..8ca235c2e9b567ec6819d4d43186d15ef6c839a0 100644 (file)
                                             60000, 40000);
                };
 
+               aqr_wan_thermal: aqr-wan-thermal {
+                       thermal-sensors = <&phy8>;
+                       SDG_1FAN_THERMAL_MAP(aqr_wan_thermal, &fan,
+                                            108000, 104000,
+                                            100000, 90000,
+                                            80000, 40000);
+               };
        };
 };
 
                /* AQR113C */
                compatible = "ethernet-phy-ieee802.3-c45";
                reg = <8>;
+               #thermal-sensor-cells = <0>;
 
                marvell,mdi-cfg-order = <0>;
 
index 38d66736846382966e395adb430f68a8eae1a22f..eb5b295a08f3b2fec1d70d72304c5eb4f86e3067 100644 (file)
@@ -5,8 +5,9 @@
  */
 
 #define SDG_THERMAL_HEADER                                                                     \
-       polling-delay-passive = <1000>;                                                         \
+       polling-delay-passive = <0>;                                                            \
        polling-delay = <1000>;                                                                 \
+       critical-action = "reboot";                                                             \
        /delete-node/cooling-maps;                                                              \
        /delete-node/trips;
 
        trips {                                                                                 \
                _cname##_critical: critical {                                                   \
                        temperature = <_crit>;                                                  \
-                       hysteresis = <2000>;                                                    \
+                       hysteresis = <4000>;                                                    \
                        type = "critical";                                                      \
                };                                                                              \
                _cname##_hot: hot {                                                             \
                        temperature = <_hot>;                                                   \
-                       hysteresis = <2000>;                                                    \
+                       hysteresis = <4000>;                                                    \
                        type = "hot";                                                           \
                };                                                                              \
                _cname##_active_high: active-high {                                             \
                        temperature = <_high>;                                                  \
-                       hysteresis = <2000>;                                                    \
+                       hysteresis = <4000>;                                                    \
                        type = "active";                                                        \
                };                                                                              \
                _cname##_active_med: active-med {                                               \
                        temperature = <_med>;                                                   \
-                       hysteresis = <2000>;                                                    \
+                       hysteresis = <4000>;                                                    \
                        type = "active";                                                        \
                };                                                                              \
                _cname##_active_low: active-low {                                               \
                        temperature = <_low>;                                                   \
-                       hysteresis = <2000>;                                                    \
+                       hysteresis = <4000>;                                                    \
                        type = "active";                                                        \
                };                                                                              \
                _cname##_active_silent: active-silent {                                         \
                        temperature = <_silent>;                                                \
-                       hysteresis = <2000>;                                                    \
+                       hysteresis = <4000>;                                                    \
                        type = "active";                                                        \
                };                                                                              \
        };