0001 # SPDX-License-Identifier: GPL-2.0-only
0002 # Copyright (C) 2020 Renesas Electronics Corp.
0003 %YAML 1.2
0004 ---
0005 $id: http://devicetree.org/schemas/thermal/rcar-thermal.yaml#
0006 $schema: http://devicetree.org/meta-schemas/core.yaml#
0007
0008 title: Renesas R-Car Thermal
0009
0010 maintainers:
0011 - Niklas Söderlund <niklas.soderlund@ragnatech.se>
0012
0013 properties:
0014 compatible:
0015 oneOf:
0016 - items:
0017 - enum:
0018 - renesas,thermal-r8a73a4 # R-Mobile APE6
0019 - renesas,thermal-r8a7779 # R-Car H1
0020 - const: renesas,rcar-thermal # Generic without thermal-zone
0021 - items:
0022 - enum:
0023 - renesas,thermal-r8a7742 # RZ/G1H
0024 - renesas,thermal-r8a7743 # RZ/G1M
0025 - renesas,thermal-r8a7744 # RZ/G1N
0026 - const: renesas,rcar-gen2-thermal # Generic thermal-zone
0027 - items:
0028 - enum:
0029 - renesas,thermal-r8a7790 # R-Car H2
0030 - renesas,thermal-r8a7791 # R-Car M2-W
0031 - renesas,thermal-r8a7792 # R-Car V2H
0032 - renesas,thermal-r8a7793 # R-Car M2-N
0033 - const: renesas,rcar-gen2-thermal # Generic thermal-zone
0034 - const: renesas,rcar-thermal # Generic without thermal-zone
0035 - items:
0036 - enum:
0037 - renesas,thermal-r8a774c0 # RZ/G2E
0038 - renesas,thermal-r8a77970 # R-Car V3M
0039 - renesas,thermal-r8a77990 # R-Car E3
0040 - renesas,thermal-r8a77995 # R-Car D3
0041 reg:
0042 description:
0043 Address ranges of the thermal registers. If more then one range is given
0044 the first one must be the common registers followed by each sensor
0045 according to the datasheet.
0046 minItems: 1
0047 maxItems: 4
0048
0049 interrupts:
0050 minItems: 1
0051 maxItems: 3
0052
0053 clocks:
0054 maxItems: 1
0055
0056 power-domains:
0057 maxItems: 1
0058
0059 resets:
0060 maxItems: 1
0061
0062 "#thermal-sensor-cells":
0063 const: 0
0064
0065 required:
0066 - compatible
0067 - reg
0068
0069 allOf:
0070 - if:
0071 not:
0072 properties:
0073 compatible:
0074 contains:
0075 enum:
0076 - renesas,thermal-r8a73a4 # R-Mobile APE6
0077 - renesas,thermal-r8a7779 # R-Car H1
0078 then:
0079 required:
0080 - resets
0081 - '#thermal-sensor-cells'
0082
0083 - if:
0084 not:
0085 properties:
0086 compatible:
0087 contains:
0088 const: renesas,thermal-r8a7779 # R-Car H1
0089 then:
0090 required:
0091 - interrupts
0092 - clocks
0093 - power-domains
0094
0095 additionalProperties: false
0096
0097 examples:
0098 # Example (non interrupt support)
0099 - |
0100 thermal@ffc48000 {
0101 compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal";
0102 reg = <0xffc48000 0x38>;
0103 };
0104
0105 # Example (interrupt support)
0106 - |
0107 #include <dt-bindings/clock/r8a73a4-clock.h>
0108 #include <dt-bindings/interrupt-controller/arm-gic.h>
0109 #include <dt-bindings/interrupt-controller/irq.h>
0110
0111 thermal@e61f0000 {
0112 compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal";
0113 reg = <0xe61f0000 0x14>, <0xe61f0100 0x38>,
0114 <0xe61f0200 0x38>, <0xe61f0300 0x38>;
0115 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
0116 clocks = <&mstp5_clks R8A73A4_CLK_THERMAL>;
0117 power-domains = <&pd_c5>;
0118 };
0119
0120 # Example (with thermal-zone)
0121 - |
0122 #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
0123 #include <dt-bindings/interrupt-controller/arm-gic.h>
0124 #include <dt-bindings/power/r8a7790-sysc.h>
0125
0126 thermal: thermal@e61f0000 {
0127 compatible = "renesas,thermal-r8a7790",
0128 "renesas,rcar-gen2-thermal",
0129 "renesas,rcar-thermal";
0130 reg = <0xe61f0000 0x10>, <0xe61f0100 0x38>;
0131 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
0132 clocks = <&cpg CPG_MOD 522>;
0133 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
0134 resets = <&cpg 522>;
0135 #thermal-sensor-cells = <0>;
0136 };
0137
0138 thermal-zones {
0139 cpu_thermal: cpu-thermal {
0140 polling-delay-passive = <1000>;
0141 polling-delay = <5000>;
0142
0143 thermal-sensors = <&thermal>;
0144
0145 trips {
0146 cpu-crit {
0147 temperature = <115000>;
0148 hysteresis = <0>;
0149 type = "critical";
0150 };
0151 };
0152 cooling-maps {
0153 };
0154 };
0155 };