summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree
diff options
context:
space:
mode:
authormkarthik <mkarthik@nvidia.com>2020-06-17 08:01:11 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2020-09-15 11:39:29 -0400
commitf9d1658833bbd2dfd5b24bb8cfff4da88db658ce (patch)
treec6ec514c8f0e7f8d1473e895790f3ab70c6d6607 /Documentation/devicetree
parent8d0f7dcdc17f692894c11684c8cfb672d6881492 (diff)
therm-fan-est: Add support for Tmargin to drive fan
Why? Tmargin method of fan control allows multiple groups of therma-fan-est devices temperatures to be considered for the fan control algorithm/fan curve. The limitation of the existing max temp algorithm in therm-fan-est driver is that devices with different fan curves cannot be accomodated in the driver. In case, there are multple fan curves, the device which has the steepest curve wins the algoritm. Hence, taking the temperatures as a reference from their respective critical temperatures and using that value to drive the fan will help in accomodating both the devices' fan curves. How? * Calculate the effective crit temp of all the thermal zones during probe. * In the polling cycles, calculate the effective temperatures of the individual groups and use the tmargin formula to calculate the current temperature. * Since the Tmargin temp trip values are in reverse order, we need to use the reverse order in the pwm-fan dt profile. * The hysterysis is subtracted from the temp in cooling scenario to avoid frequent switching at trip temps. Since the tmargin trip values are taken in the decending order, hysterysis temps in dt should be given as negative values. Bug 200627962 Change-Id: Ideba4bfdb3d3306d1b4aff15093bcfac13d7bb86 Signed-off-by: Mantravadi Karthik <mkarthik@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2362354 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'Documentation/devicetree')
-rw-r--r--Documentation/devicetree/bindings/misc/therm_est.txt90
1 files changed, 90 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/misc/therm_est.txt b/Documentation/devicetree/bindings/misc/therm_est.txt
index 0dbcb147a..0538981a7 100644
--- a/Documentation/devicetree/bindings/misc/therm_est.txt
+++ b/Documentation/devicetree/bindings/misc/therm_est.txt
@@ -6,6 +6,8 @@ Properties :
6 - tc1 : Coefficient 1 for thermal trend calculation. 6 - tc1 : Coefficient 1 for thermal trend calculation.
7 - tc2 : Coefficient 2 for thermal trend calculation. 7 - tc2 : Coefficient 2 for thermal trend calculation.
8 - node for subdev : Node for subdevice information. Required. 8 - node for subdev : Node for subdevice information. Required.
9 - use_tmargin : if tmargin algorithm should be used for calculating the
10 effective temp. Refer Tmargin section for more info.
9 11
10Properties in subdev node : Required. 12Properties in subdev node : Required.
11 - subdev_names : list of strings. It contains list of the name of the therm 13 - subdev_names : list of strings. It contains list of the name of the therm
@@ -45,3 +47,91 @@ Example:
45 }; 47 };
46 }; 48 };
47 }; 49 };
50
51Tmargin Algorithm:
52The native max temp algorithm lacks support for accomodating multiple thermal
53fan curves. Tmargin algorithm solves this by calculating the effective
54temperature as a difference from critical temperature of the therm fan est
55group. This allows us to take a union of two fan curves and satisfy the needs
56of both the therm-fan-est groups.
57The algorithm use the effective temperature(crit_temp - sensor_reading) to
58drive the cooling device.
59
60Properties rules for therm-fan-est dt entry:
61 - use_tmargin : To use the tmargin feature.
62 - profiles : New profile tmargin should be defined and chosen as default.
63 * The trip temperatures need to be given only in ascending order for the
64 thermal framework to register therm-fan-est zone. Hence, the dt values
65 for active trip temps should be given in ascending values of tmargin
66 values.
67 * Hysterysis is used only in cooling scenario. Since tmargin is
68 considered as a diff wrt crit_Temp, hysterysis values should be taken
69 as -ve values.
70
71Properties rules for fan dt entry:
72 - profiles : New profile for tmargin should be defined and chosen as default.
73 * The trip temps are considered in a ascending order of tmargin temps.
74 Hence, the pwm values should be considered in a descending order of
75 pwms.
76 * active_steps - The tmargin trip values are considered in the ascending
77 order(hence actual trip temps will be in descending order), so the
78 pwm mapping should be in the reverse order starting from 255 for
79 index 0.
80
81Example :
82
83 thermal-fan-est {
84 compatible = "thermal-fan-est";
85 name = "thermal-fan-est";
86 status = "okay";
87 num_resources = <0>;
88 shared_data = <&thermal_fan_est_shared_data>;
89 trip_length = <10>;
90 use_tmargin;
91
92 profiles {
93 default = "tmargin";
94 quiet {
95 active_trip_temps = <0 50000 63000 72000 81000
96 140000 150000 160000 170000 180000>;
97 active_hysteresis = <0 18000 8000 8000 8000
98 0 0 0 0 0>;
99 };
100 cool {
101 active_trip_temps = <0 35000 53000 62000 73000
102 140000 150000 160000 170000 180000>;
103 active_hysteresis = <0 9000 8000 8000 9000
104 0 0 0 0 0>;
105 };
106 tmargin {
107 active_trip_temps = <0 10000 15000 25000 35000
108 45000 55000 65000 75000 105000>;
109 active_hysteresis = <0 0 0 0 (-3000)
110 (-4000) (-4000) 0 0 0>;
111 };
112 };
113 };
114
115 pwm-fan {
116 compatible = "pwm-fan";
117 status = "okay";
118 #pwm-cells = <1>;
119 pwms = <&tegra_pwm4 0 45334>;
120 shared_data = <&pwm_fan_shared_data>;
121 profiles {
122 default = "tmargin";
123 quiet {
124 state_cap = <8>;
125 active_pwm = <0 60 90 120 150 180 210 240 255 255>;
126 };
127 cool {
128 state_cap = <4>;
129 active_pwm = <0 77 120 160 255 255 255 255 255 255>;
130 };
131 tmargin {
132 state_cap = <0>;
133 active_pwm = <255 255 240 210 180 150 120 90 60 0>;
134 };
135 };
136 };
137