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>
#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>;
};
/* AQR113C */
compatible = "ethernet-phy-ieee802.3-c45";
reg = <0>;
+ #thermal-sensor-cells = <0>;
leds {
#address-cells = <1>;
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>;
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>;
*/
#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"; \
}; \
};