···11-Tegra124 SOCTHERM thermal management system22-33-The SOCTHERM IP block contains thermal sensors, support for polled44-or interrupt-based thermal monitoring, CPU and GPU throttling based55-on temperature trip points, and handling external overcurrent66-notifications. It is also used to manage emergency shutdown in an77-overheating situation.88-99-Required properties :1010-- compatible : For Tegra124, must contain "nvidia,tegra124-soctherm".1111- For Tegra132, must contain "nvidia,tegra132-soctherm".1212- For Tegra210, must contain "nvidia,tegra210-soctherm".1313-- reg : Should contain at least 2 entries for each entry in reg-names:1414- - SOCTHERM register set1515- - Tegra CAR register set: Required for Tegra124 and Tegra210.1616- - CCROC register set: Required for Tegra132.1717-- reg-names : Should contain at least 2 entries:1818- - soctherm-reg1919- - car-reg2020- - ccroc-reg2121-- interrupts : Defines the interrupt used by SOCTHERM2222-- clocks : Must contain an entry for each entry in clock-names.2323- See ../clocks/clock-bindings.txt for details.2424-- clock-names : Must include the following entries:2525- - tsensor2626- - soctherm2727-- resets : Must contain an entry for each entry in reset-names.2828- See ../reset/reset.txt for details.2929-- reset-names : Must include the following entries:3030- - soctherm3131-- #thermal-sensor-cells : Should be 1. For a description of this property, see3232- Documentation/devicetree/bindings/thermal/thermal-sensor.yaml.3333- See <dt-bindings/thermal/tegra124-soctherm.h> for a list of valid values3434- when referring to thermal sensors.3535-- throttle-cfgs: A sub-node which is a container of configuration for each3636- hardware throttle events. These events can be set as cooling devices.3737- * throttle events: Sub-nodes must be named as "light" or "heavy".3838- Properties:3939- - nvidia,priority: Each throttles has its own throttle settings, so the4040- SW need to set priorities for various throttle, the HW arbiter can select4141- the final throttle settings.4242- Bigger value indicates higher priority, In general, higher priority4343- translates to lower target frequency. SW needs to ensure that critical4444- thermal alarms are given higher priority, and ensure that there is4545- no race if priority of two vectors is set to the same value.4646- The range of this value is 1~100.4747- - nvidia,cpu-throt-percent: This property is for Tegra124 and Tegra210.4848- It is the throttling depth of pulse skippers, it's the percentage4949- throttling.5050- - nvidia,cpu-throt-level: This property is only for Tegra132, it is the5151- level of pulse skippers, which used to throttle clock frequencies. It5252- indicates cpu clock throttling depth, and the depth can be programmed.5353- Must set as following values:5454- TEGRA_SOCTHERM_THROT_LEVEL_LOW, TEGRA_SOCTHERM_THROT_LEVEL_MED5555- TEGRA_SOCTHERM_THROT_LEVEL_HIGH, TEGRA_SOCTHERM_THROT_LEVEL_NONE5656- - nvidia,gpu-throt-level: This property is for Tegra124 and Tegra210.5757- It is the level of pulse skippers, which used to throttle clock5858- frequencies. It indicates gpu clock throttling depth and can be5959- programmed to any of the following values which represent a throttling6060- percentage:6161- TEGRA_SOCTHERM_THROT_LEVEL_NONE (0%)6262- TEGRA_SOCTHERM_THROT_LEVEL_LOW (50%),6363- TEGRA_SOCTHERM_THROT_LEVEL_MED (75%),6464- TEGRA_SOCTHERM_THROT_LEVEL_HIGH (85%).6565- - #cooling-cells: Should be 1. This cooling device only support on/off state.6666- For a description of this property see:6767- Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml6868-6969- Optional properties: The following properties are T210 specific and7070- valid only for OCx throttle events.7171- - nvidia,count-threshold: Specifies the number of OC events that are7272- required for triggering an interrupt. Interrupts are not triggered if7373- the property is missing. A value of 0 will interrupt on every OC alarm.7474- - nvidia,polarity-active-low: Configures the polarity of the OC alaram7575- signal. If present, this means assert low, otherwise assert high.7676- - nvidia,alarm-filter: Number of clocks to filter event. When the filter7777- expires (which means the OC event has not occurred for a long time),7878- the counter is cleared and filter is rearmed. Default value is 0.7979- - nvidia,throttle-period-us: Specifies the number of uSec for which8080- throttling is engaged after the OC event is deasserted. Default value8181- is 0.8282-8383-Optional properties:8484-- nvidia,thermtrips : When present, this property specifies the temperature at8585- which the soctherm hardware will assert the thermal trigger signal to the8686- Power Management IC, which can be configured to reset or shutdown the device.8787- It is an array of pairs where each pair represents a tsensor id followed by a8888- temperature in milli Celcius. In the absence of this property the critical8989- trip point will be used for thermtrip temperature.9090-9191-Note:9292-- the "critical" type trip points will be used to set the temperature at which9393-the SOC_THERM hardware will assert a thermal trigger if the "nvidia,thermtrips"9494-property is missing. When the thermtrips property is present, the breach of a9595-critical trip point is reported back to the thermal framework to implement9696-software shutdown.9797-9898-- the "hot" type trip points will be set to SOC_THERM hardware as the throttle9999-temperature. Once the temperature of this thermal zone is higher100100-than it, it will trigger the HW throttle event.101101-102102-Example :103103-104104- soctherm@700e2000 {105105- compatible = "nvidia,tegra124-soctherm";106106- reg = <0x0 0x700e2000 0x0 0x600 /* SOC_THERM reg_base */107107- 0x0 0x60006000 0x0 0x400 /* CAR reg_base */108108- reg-names = "soctherm-reg", "car-reg";109109- interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;110110- clocks = <&tegra_car TEGRA124_CLK_TSENSOR>,111111- <&tegra_car TEGRA124_CLK_SOC_THERM>;112112- clock-names = "tsensor", "soctherm";113113- resets = <&tegra_car 78>;114114- reset-names = "soctherm";115115-116116- #thermal-sensor-cells = <1>;117117-118118- nvidia,thermtrips = <TEGRA124_SOCTHERM_SENSOR_CPU 102500119119- TEGRA124_SOCTHERM_SENSOR_GPU 103000>;120120-121121- throttle-cfgs {122122- /*123123- * When the "heavy" cooling device triggered,124124- * the HW will skip cpu clock's pulse in 85% depth,125125- * skip gpu clock's pulse in 85% level126126- */127127- throttle_heavy: heavy {128128- nvidia,priority = <100>;129129- nvidia,cpu-throt-percent = <85>;130130- nvidia,gpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_HIGH>;131131-132132- #cooling-cells = <1>;133133- };134134-135135- /*136136- * When the "light" cooling device triggered,137137- * the HW will skip cpu clock's pulse in 50% depth,138138- * skip gpu clock's pulse in 50% level139139- */140140- throttle_light: light {141141- nvidia,priority = <80>;142142- nvidia,cpu-throt-percent = <50>;143143- nvidia,gpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_LOW>;144144-145145- #cooling-cells = <1>;146146- };147147-148148- /*149149- * If these two devices are triggered in same time, the HW throttle150150- * arbiter will select the highest priority as the final throttle151151- * settings to skip cpu pulse.152152- */153153-154154- throttle_oc1: oc1 {155155- nvidia,priority = <50>;156156- nvidia,polarity-active-low;157157- nvidia,count-threshold = <100>;158158- nvidia,alarm-filter = <5100000>;159159- nvidia,throttle-period-us = <0>;160160- nvidia,cpu-throt-percent = <75>;161161- nvidia,gpu-throt-level =162162- <TEGRA_SOCTHERM_THROT_LEVEL_MED>;163163- };164164- };165165- };166166-167167-Example: referring to Tegra132's "reg", "reg-names" and "throttle-cfgs" :168168-169169- soctherm@700e2000 {170170- compatible = "nvidia,tegra132-soctherm";171171- reg = <0x0 0x700e2000 0x0 0x600 /* SOC_THERM reg_base */172172- 0x0 0x70040000 0x0 0x200>; /* CCROC reg_base */;173173- reg-names = "soctherm-reg", "ccroc-reg";174174-175175- throttle-cfgs {176176- /*177177- * When the "heavy" cooling device triggered,178178- * the HW will skip cpu clock's pulse in HIGH level179179- */180180- throttle_heavy: heavy {181181- nvidia,priority = <100>;182182- nvidia,cpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_HIGH>;183183-184184- #cooling-cells = <1>;185185- };186186-187187- /*188188- * When the "light" cooling device triggered,189189- * the HW will skip cpu clock's pulse in MED level190190- */191191- throttle_light: light {192192- nvidia,priority = <80>;193193- nvidia,cpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_MED>;194194-195195- #cooling-cells = <1>;196196- };197197-198198- /*199199- * If these two devices are triggered in same time, the HW throttle200200- * arbiter will select the highest priority as the final throttle201201- * settings to skip cpu pulse.202202- */203203-204204- };205205- };206206-207207-Example: referring to thermal sensors :208208-209209- thermal-zones {210210- cpu {211211- polling-delay-passive = <1000>;212212- polling-delay = <1000>;213213-214214- thermal-sensors =215215- <&soctherm TEGRA124_SOCTHERM_SENSOR_CPU>;216216-217217- trips {218218- cpu_shutdown_trip: shutdown-trip {219219- temperature = <102500>;220220- hysteresis = <1000>;221221- type = "critical";222222- };223223-224224- cpu_throttle_trip: throttle-trip {225225- temperature = <100000>;226226- hysteresis = <1000>;227227- type = "hot";228228- };229229- };230230-231231- cooling-maps {232232- map0 {233233- trip = <&cpu_throttle_trip>;234234- cooling-device = <&throttle_heavy 1 1>;235235- };236236- };237237- };238238- };
···11+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/thermal/nvidia,tegra124-soctherm.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: NVIDIA Tegra124 SOCTHERM Thermal Management System88+99+maintainers:1010+ - Thierry Reding <thierry.reding@gmail.com>1111+ - Jon Hunter <jonathanh@nvidia.com>1212+1313+description: The SOCTHERM IP block contains thermal sensors, support for1414+ polled or interrupt-based thermal monitoring, CPU and GPU throttling based1515+ on temperature trip points, and handling external overcurrent notifications.1616+ It is also used to manage emergency shutdown in an overheating situation.1717+1818+properties:1919+ compatible:2020+ enum:2121+ - nvidia,tegra124-soctherm2222+ - nvidia,tegra132-soctherm2323+ - nvidia,tegra210-soctherm2424+2525+ reg:2626+ maxItems: 22727+2828+ reg-names:2929+ maxItems: 23030+3131+ interrupts:3232+ items:3333+ - description: module interrupt3434+ - description: EDP interrupt3535+3636+ interrupt-names:3737+ items:3838+ - const: thermal3939+ - const: edp4040+4141+ clocks:4242+ items:4343+ - description: thermal sensor clock4444+ - description: module clock4545+4646+ clock-names:4747+ items:4848+ - const: tsensor4949+ - const: soctherm5050+5151+ resets:5252+ items:5353+ - description: module reset5454+5555+ reset-names:5656+ items:5757+ - const: soctherm5858+5959+ "#thermal-sensor-cells":6060+ const: 16161+6262+ throttle-cfgs:6363+ $ref: thermal-cooling-devices.yaml6464+ description: A sub-node which is a container of configuration for each6565+ hardware throttle events. These events can be set as cooling devices.6666+ Throttle event sub-nodes must be named as "light" or "heavy".6767+ unevaluatedProperties: false6868+ patternProperties:6969+ "^(light|heavy|oc1)$":7070+ type: object7171+ properties:7272+ nvidia,priority:7373+ $ref: /schemas/types.yaml#/definitions/uint327474+ minimum: 17575+ maximum: 1007676+ description: Each throttles has its own throttle settings, so the7777+ SW need to set priorities for various throttle, the HW arbiter7878+ can select the final throttle settings. Bigger value indicates7979+ higher priority, In general, higher priority translates to lower8080+ target frequency. SW needs to ensure that critical thermal8181+ alarms are given higher priority, and ensure that there is no8282+ race if priority of two vectors is set to the same value.8383+8484+ nvidia,cpu-throt-percent:8585+ description: This property is for Tegra124 and Tegra210. It is the8686+ throttling depth of pulse skippers, it's the percentage8787+ throttling.8888+ minimum: 08989+ maximum: 1009090+9191+ nvidia,cpu-throt-level:9292+ $ref: /schemas/types.yaml#/definitions/uint329393+ description: This property is only for Tegra132, it is the level9494+ of pulse skippers, which used to throttle clock frequencies. It9595+ indicates cpu clock throttling depth, and the depth can be9696+ programmed.9797+ enum:9898+ # none (TEGRA_SOCTHERM_THROT_LEVEL_NONE)9999+ - 0100100+ # low (TEGRA_SOCTHERM_THROT_LEVEL_LOW)101101+ - 1102102+ # medium (TEGRA_SOCTHERM_THROT_LEVEL_MED)103103+ - 2104104+ # high (TEGRA_SOCTHERM_THROT_LEVEL_HIGH)105105+ - 3106106+107107+ nvidia,gpu-throt-level:108108+ $ref: /schemas/types.yaml#/definitions/uint32109109+ description: This property is for Tegra124 and Tegra210. It is the110110+ level of pulse skippers, which used to throttle clock111111+ frequencies. It indicates gpu clock throttling depth and can be112112+ programmed to any of the following values which represent a113113+ throttling percentage.114114+ enum:115115+ # none (0%, TEGRA_SOCTHERM_THROT_LEVEL_NONE)116116+ - 0117117+ # low (50%, TEGRA_SOCTHERM_THROT_LEVEL_LOW)118118+ - 1119119+ # medium (75%, TEGRA_SOCTHERM_THROT_LEVEL_MED)120120+ - 2121121+ # high (85%, TEGRA_SOCTHERM_THROT_LEVEL_HIGH)122122+ - 3123123+124124+ # optional125125+ # Tegra210 specific and valid only for OCx throttle events126126+ nvidia,count-threshold:127127+ $ref: /schemas/types.yaml#/definitions/uint32128128+ description: Specifies the number of OC events that are required129129+ for triggering an interrupt. Interrupts are not triggered if the130130+ property is missing. A value of 0 will interrupt on every OC131131+ alarm.132132+133133+ nvidia,polarity-active-low:134134+ $ref: /schemas/types.yaml#/definitions/flag135135+ description: Configures the polarity of the OC alaram signal. If136136+ present, this means assert low, otherwise assert high.137137+138138+ nvidia,alarm-filter:139139+ $ref: /schemas/types.yaml#/definitions/uint32140140+ description: Number of clocks to filter event. When the filter141141+ expires (which means the OC event has not occurred for a long142142+ time), the counter is cleared and filter is rearmed.143143+ default: 0144144+145145+ nvidia,throttle-period-us:146146+ description: Specifies the number of microseconds for which147147+ throttling is engaged after the OC event is deasserted.148148+ default: 0149149+150150+ # optional151151+ nvidia,thermtrips:152152+ $ref: /schemas/types.yaml#/definitions/uint32-matrix153153+ description: |154154+ When present, this property specifies the temperature at which the155155+ SOCTHERM hardware will assert the thermal trigger signal to the Power156156+ Management IC, which can be configured to reset or shutdown the device.157157+ It is an array of pairs where each pair represents a tsensor ID followed158158+ by a temperature in milli Celcius. In the absence of this property the159159+ critical trip point will be used for thermtrip temperature.160160+161161+ Note:162162+ - the "critical" type trip points will be used to set the temperature at163163+ which the SOCTHERM hardware will assert a thermal trigger if the164164+ "nvidia,thermtrips" property is missing. When the thermtrips property165165+ is present, the breach of a critical trip point is reported back to166166+ the thermal framework to implement software shutdown.167167+168168+ - the "hot" type trip points will be set to SOCTHERM hardware as the169169+ throttle temperature. Once the temperature of this thermal zone is170170+ higher than it, it will trigger the HW throttle event.171171+ items:172172+ items:173173+ - description: sensor ID174174+ oneOf:175175+ - description: CPU sensor176176+ const: 0177177+ - description: MEM sensor178178+ const: 1179179+ - description: GPU sensor180180+ const: 2181181+ - description: PLLX sensor182182+ const: 3183183+ - description: temperature threshold (in millidegree Celsius)184184+185185+required:186186+ - compatible187187+ - reg188188+ - reg-names189189+ - interrupts190190+ - interrupt-names191191+ - clocks192192+ - clock-names193193+ - resets194194+ - reset-names195195+ - "#thermal-sensor-cells"196196+197197+allOf:198198+ - $ref: thermal-sensor.yaml199199+ - if:200200+ properties:201201+ compatible:202202+ contains:203203+ enum:204204+ - nvidia,tegra124-soctherm205205+ - nvidia,tegra210-soctherm206206+ then:207207+ properties:208208+ reg:209209+ items:210210+ - description: SOCTHERM register set211211+ - description: clock and reset controller registers212212+213213+ reg-names:214214+ items:215215+ - const: soctherm-reg216216+ - const: car-reg217217+218218+ else:219219+ properties:220220+ reg:221221+ items:222222+ - description: SOCTHERM register set223223+ - description: CCROC registers224224+225225+ reg-names:226226+ items:227227+ - const: soctherm-reg228228+ - const: ccroc-reg229229+230230+additionalProperties: false231231+232232+examples:233233+ - |234234+ #include <dt-bindings/clock/tegra124-car.h>235235+ #include <dt-bindings/interrupt-controller/arm-gic.h>236236+ #include <dt-bindings/thermal/tegra124-soctherm.h>237237+238238+ soctherm@700e2000 {239239+ compatible = "nvidia,tegra124-soctherm";240240+ reg = <0x700e2000 0x600>, /* SOC_THERM reg_base */241241+ <0x60006000 0x400>; /* CAR reg_base */242242+ reg-names = "soctherm-reg", "car-reg";243243+ interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>,244244+ <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;245245+ interrupt-names = "thermal", "edp";246246+ clocks = <&tegra_car TEGRA124_CLK_TSENSOR>,247247+ <&tegra_car TEGRA124_CLK_SOC_THERM>;248248+ clock-names = "tsensor", "soctherm";249249+ resets = <&tegra_car 78>;250250+ reset-names = "soctherm";251251+252252+ #thermal-sensor-cells = <1>;253253+254254+ nvidia,thermtrips = <TEGRA124_SOCTHERM_SENSOR_CPU 102500>,255255+ <TEGRA124_SOCTHERM_SENSOR_GPU 103000>;256256+257257+ throttle-cfgs {258258+ /*259259+ * When the "heavy" cooling device triggered,260260+ * the HW will skip cpu clock's pulse in 85% depth,261261+ * skip gpu clock's pulse in 85% level262262+ */263263+ heavy {264264+ nvidia,priority = <100>;265265+ nvidia,cpu-throt-percent = <85>;266266+ nvidia,gpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_HIGH>;267267+268268+ #cooling-cells = <2>;269269+ };270270+271271+ /*272272+ * When the "light" cooling device triggered,273273+ * the HW will skip cpu clock's pulse in 50% depth,274274+ * skip gpu clock's pulse in 50% level275275+ */276276+ light {277277+ nvidia,priority = <80>;278278+ nvidia,cpu-throt-percent = <50>;279279+ nvidia,gpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_LOW>;280280+281281+ #cooling-cells = <2>;282282+ };283283+284284+ /*285285+ * If these two devices are triggered in same time, the HW throttle286286+ * arbiter will select the highest priority as the final throttle287287+ * settings to skip cpu pulse.288288+ */289289+290290+ oc1 {291291+ nvidia,priority = <50>;292292+ nvidia,polarity-active-low;293293+ nvidia,count-threshold = <100>;294294+ nvidia,alarm-filter = <5100000>;295295+ nvidia,throttle-period-us = <0>;296296+ nvidia,cpu-throt-percent = <75>;297297+ nvidia,gpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_MED>;298298+ };299299+ };300300+ };301301+302302+ # referring to Tegra132's "reg", "reg-names" and "throttle-cfgs"303303+ - |304304+ thermal-sensor@700e2000 {305305+ compatible = "nvidia,tegra132-soctherm";306306+ reg = <0x700e2000 0x600>, /* SOC_THERM reg_base */307307+ <0x70040000 0x200>; /* CCROC reg_base */308308+ reg-names = "soctherm-reg", "ccroc-reg";309309+ interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>,310310+ <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;311311+ interrupt-names = "thermal", "edp";312312+ clocks = <&tegra_car TEGRA124_CLK_TSENSOR>,313313+ <&tegra_car TEGRA124_CLK_SOC_THERM>;314314+ clock-names = "tsensor", "soctherm";315315+ resets = <&tegra_car 78>;316316+ reset-names = "soctherm";317317+ #thermal-sensor-cells = <1>;318318+319319+ throttle-cfgs {320320+ /*321321+ * When the "heavy" cooling device triggered,322322+ * the HW will skip cpu clock's pulse in HIGH level323323+ */324324+ heavy {325325+ nvidia,priority = <100>;326326+ nvidia,cpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_HIGH>;327327+328328+ #cooling-cells = <2>;329329+ };330330+331331+ /*332332+ * When the "light" cooling device triggered,333333+ * the HW will skip cpu clock's pulse in MED level334334+ */335335+ light {336336+ nvidia,priority = <80>;337337+ nvidia,cpu-throt-level = <TEGRA_SOCTHERM_THROT_LEVEL_MED>;338338+339339+ #cooling-cells = <2>;340340+ };341341+342342+ /*343343+ * If these two devices are triggered in same time, the HW throttle344344+ * arbiter will select the highest priority as the final throttle345345+ * settings to skip cpu pulse.346346+ */347347+ };348348+ };349349+350350+ # referring to thermal sensors351351+ - |352352+ thermal-zones {353353+ cpu-thermal {354354+ polling-delay-passive = <1000>;355355+ polling-delay = <1000>;356356+357357+ thermal-sensors = <&soctherm TEGRA124_SOCTHERM_SENSOR_CPU>;358358+359359+ trips {360360+ cpu_shutdown_trip: shutdown-trip {361361+ temperature = <102500>;362362+ hysteresis = <1000>;363363+ type = "critical";364364+ };365365+366366+ cpu_throttle_trip: throttle-trip {367367+ temperature = <100000>;368368+ hysteresis = <1000>;369369+ type = "hot";370370+ };371371+ };372372+373373+ cooling-maps {374374+ map0 {375375+ trip = <&cpu_throttle_trip>;376376+ cooling-device = <&throttle_heavy 1 1>;377377+ };378378+ };379379+ };380380+ };