Merge branch 'pm-cpufreq'
[cascardo/linux.git] / Documentation / devicetree / bindings / thermal / nvidia,tegra124-soctherm.txt
1 Tegra124 SOCTHERM thermal management system
2
3 The SOCTHERM IP block contains thermal sensors, support for polled
4 or interrupt-based thermal monitoring, CPU and GPU throttling based
5 on temperature trip points, and handling external overcurrent
6 notifications. It is also used to manage emergency shutdown in an
7 overheating situation.
8
9 Required properties :
10 - compatible : For Tegra124, must contain "nvidia,tegra124-soctherm".
11   For Tegra132, must contain "nvidia,tegra132-soctherm".
12   For Tegra210, must contain "nvidia,tegra210-soctherm".
13 - reg : Should contain at least 2 entries for each entry in reg-names:
14   - SOCTHERM register set
15   - Tegra CAR register set: Required for Tegra124 and Tegra210.
16   - CCROC register set: Required for Tegra132.
17 - reg-names :  Should contain at least 2 entries:
18   - soctherm-reg
19   - car-reg
20   - ccroc-reg
21 - interrupts : Defines the interrupt used by SOCTHERM
22 - clocks : Must contain an entry for each entry in clock-names.
23   See ../clocks/clock-bindings.txt for details.
24 - clock-names : Must include the following entries:
25   - tsensor
26   - soctherm
27 - resets : Must contain an entry for each entry in reset-names.
28   See ../reset/reset.txt for details.
29 - reset-names : Must include the following entries:
30   - soctherm
31 - #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description
32     of this property. See <dt-bindings/thermal/tegra124-soctherm.h> for a
33     list of valid values when referring to thermal sensors.
34 - throttle-cfgs: A sub-node which is a container of configuration for each
35     hardware throttle events. These events can be set as cooling devices.
36   * throttle events: Sub-nodes must be named as "light" or "heavy".
37       Properties:
38       - nvidia,priority: Each throttles has its own throttle settings, so the
39         SW need to set priorities for various throttle, the HW arbiter can select
40         the final throttle settings.
41         Bigger value indicates higher priority, In general, higher priority
42         translates to lower target frequency. SW needs to ensure that critical
43         thermal alarms are given higher priority, and ensure that there is
44         no race if priority of two vectors is set to the same value.
45         The range of this value is 1~100.
46       - nvidia,cpu-throt-percent: This property is for Tegra124 and Tegra210.
47         It is the throttling depth of pulse skippers, it's the percentage
48         throttling.
49       - nvidia,cpu-throt-level: This property is only for Tegra132, it is the
50         level of pulse skippers, which used to throttle clock frequencies. It
51         indicates cpu clock throttling depth, and the depth can be programmed.
52         Must set as following values:
53         TEGRA_SOCTHERM_THROT_LEVEL_LOW, TEGRA_SOCTHERM_THROT_LEVEL_MED
54         TEGRA_SOCTHERM_THROT_LEVEL_HIGH, TEGRA_SOCTHERM_THROT_LEVEL_NONE
55       - #cooling-cells: Should be 1. This cooling device only support on/off state.
56         See ./thermal.txt for a description of this property.
57
58 Note:
59 - the "critical" type trip points will be set to SOC_THERM hardware as the
60 shut down temperature. Once the temperature of this thermal zone is higher
61 than it, the system will be shutdown or reset by hardware.
62 - the "hot" type trip points will be set to SOC_THERM hardware as the throttle
63 temperature. Once the the temperature of this thermal zone is higher
64 than it, it will trigger the HW throttle event.
65
66 Example :
67
68         soctherm@700e2000 {
69                 compatible = "nvidia,tegra124-soctherm";
70                 reg = <0x0 0x700e2000 0x0 0x600  /* SOC_THERM reg_base */
71                         0x0 0x60006000 0x0 0x400 /* CAR reg_base */
72                 reg-names = "soctherm-reg", "car-reg";
73                 interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
74                 clocks = <&tegra_car TEGRA124_CLK_TSENSOR>,
75                         <&tegra_car TEGRA124_CLK_SOC_THERM>;
76                 clock-names = "tsensor", "soctherm";
77                 resets = <&tegra_car 78>;
78                 reset-names = "soctherm";
79
80                 #thermal-sensor-cells = <1>;
81
82                 throttle-cfgs {
83                         /*
84                          * When the "heavy" cooling device triggered,
85                          * the HW will skip cpu clock's pulse in 85% depth
86                          */
87                         throttle_heavy: heavy {
88                                 nvidia,priority = <100>;
89                                 nvidia,cpu-throt-percent = <85>;
90
91                                 #cooling-cells = <1>;
92                         };
93
94                         /*
95                          * When the "light" cooling device triggered,
96                          * the HW will skip cpu clock's pulse in 50% depth
97                          */
98                         throttle_light: light {
99                                 nvidia,priority = <80>;
100                                 nvidia,cpu-throt-percent = <50>;
101
102                                 #cooling-cells = <1>;
103                         };
104
105                         /*
106                          * If these two devices are triggered in same time, the HW throttle
107                          * arbiter will select the highest priority as the final throttle
108                          * settings to skip cpu pulse.
109                          */
110                 };
111         };
112
113 Example: referring to Tegra132's "reg", "reg-names" and "throttle-cfgs" :
114
115         soctherm@700e2000 {
116                 compatible = "nvidia,tegra132-soctherm";
117                 reg = <0x0 0x700e2000 0x0 0x600  /* SOC_THERM reg_base */
118                         0x0 0x70040000 0x0 0x200>; /* CCROC reg_base */;
119                 reg-names = "soctherm-reg", "ccroc-reg";
120
121                 throttle-cfgs {
122                         /*
123                          * When the "heavy" cooling device triggered,
124                          * the HW will skip cpu clock's pulse in HIGH level
125                          */
126                         throttle_heavy: heavy {
127                                 nvidia,priority = <100>;
128                                 nvidia,cpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_HIGH>;
129
130                                 #cooling-cells = <1>;
131                         };
132
133                         /*
134                          * When the "light" cooling device triggered,
135                          * the HW will skip cpu clock's pulse in MED level
136                          */
137                         throttle_light: light {
138                                 nvidia,priority = <80>;
139                                 nvidia,cpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_MED>;
140
141                                 #cooling-cells = <1>;
142                         };
143
144                         /*
145                          * If these two devices are triggered in same time, the HW throttle
146                          * arbiter will select the highest priority as the final throttle
147                          * settings to skip cpu pulse.
148                          */
149
150                 };
151         };
152
153 Example: referring to thermal sensors :
154
155        thermal-zones {
156                 cpu {
157                         polling-delay-passive = <1000>;
158                         polling-delay = <1000>;
159
160                         thermal-sensors =
161                                 <&soctherm TEGRA124_SOCTHERM_SENSOR_CPU>;
162
163                         trips {
164                                 cpu_shutdown_trip: shutdown-trip {
165                                         temperature = <102500>;
166                                         hysteresis = <1000>;
167                                         type = "critical";
168                                 };
169
170                                 cpu_throttle_trip: throttle-trip {
171                                         temperature = <100000>;
172                                         hysteresis = <1000>;
173                                         type = "hot";
174                                 };
175                         };
176
177                         cooling-maps {
178                                 map0 {
179                                         trip = <&cpu_throttle_trip>;
180                                         cooling-device = <&throttle_heavy 1 1>;
181                                 };
182                         };
183                 };
184         };