From: Chad Monroe Date: Tue, 11 Aug 2026 02:59:44 +0000 (-0700) Subject: mediatek: filogic: mt-stuart: drive fan from AQR113C temperature X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfec67f9ffbcd6603ee45022673c1ba849a1ed36;p=thirdparty%2Fopenwrt.git mediatek: filogic: mt-stuart: drive fan from AQR113C temperature 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 Link: https://github.com/openwrt/openwrt/pull/24352 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/mediatek/dts/mt7988a-smartrg-SDG-8733.dtsi b/target/linux/mediatek/dts/mt7988a-smartrg-SDG-8733.dtsi index 6608286601d..c02a9600775 100644 --- a/target/linux/mediatek/dts/mt7988a-smartrg-SDG-8733.dtsi +++ b/target/linux/mediatek/dts/mt7988a-smartrg-SDG-8733.dtsi @@ -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>; diff --git a/target/linux/mediatek/dts/mt7988a-smartrg-mt-stuart-phase1.dtsi b/target/linux/mediatek/dts/mt7988a-smartrg-mt-stuart-phase1.dtsi index d85cd0b2dcd..beed1034395 100644 --- a/target/linux/mediatek/dts/mt7988a-smartrg-mt-stuart-phase1.dtsi +++ b/target/linux/mediatek/dts/mt7988a-smartrg-mt-stuart-phase1.dtsi @@ -89,6 +89,14 @@ 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); + }; }; }; @@ -124,6 +132,7 @@ /* AQR113C */ compatible = "ethernet-phy-ieee802.3-c45"; reg = <8>; + #thermal-sensor-cells = <0>; leds { #address-cells = <1>; diff --git a/target/linux/mediatek/dts/mt7988d-smartrg-SDG-8733A.dts b/target/linux/mediatek/dts/mt7988d-smartrg-SDG-8733A.dts index 1e7b72e7015..8ca235c2e9b 100644 --- a/target/linux/mediatek/dts/mt7988d-smartrg-SDG-8733A.dts +++ b/target/linux/mediatek/dts/mt7988d-smartrg-SDG-8733A.dts @@ -96,6 +96,13 @@ 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); + }; }; }; @@ -147,6 +154,7 @@ /* AQR113C */ compatible = "ethernet-phy-ieee802.3-c45"; reg = <8>; + #thermal-sensor-cells = <0>; marvell,mdi-cfg-order = <0>; diff --git a/target/linux/mediatek/dts/mt798x-smartrg-common.dtsi b/target/linux/mediatek/dts/mt798x-smartrg-common.dtsi index 38d66736846..eb5b295a08f 100644 --- a/target/linux/mediatek/dts/mt798x-smartrg-common.dtsi +++ b/target/linux/mediatek/dts/mt798x-smartrg-common.dtsi @@ -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; @@ -14,32 +15,32 @@ 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"; \ }; \ };