1# SPDX-License-Identifier: GPL-2.0-only
2# Copyright (C) 2020 Renesas Electronics Corp.
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/thermal/rcar-thermal.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Renesas R-Car Thermal
9
10maintainers:
11  - Niklas Söderlund <niklas.soderlund@ragnatech.se>
12
13properties:
14  compatible:
15    oneOf:
16      - items:
17          - enum:
18              - renesas,thermal-r8a73a4 # R-Mobile APE6
19              - renesas,thermal-r8a7779 # R-Car H1
20          - const: renesas,rcar-thermal # Generic without thermal-zone
21      - items:
22          - enum:
23              - renesas,thermal-r8a7742 # RZ/G1H
24              - renesas,thermal-r8a7743 # RZ/G1M
25              - renesas,thermal-r8a7744 # RZ/G1N
26          - const: renesas,rcar-gen2-thermal # Generic thermal-zone
27      - items:
28          - enum:
29              - renesas,thermal-r8a7790 # R-Car H2
30              - renesas,thermal-r8a7791 # R-Car M2-W
31              - renesas,thermal-r8a7792 # R-Car V2H
32              - renesas,thermal-r8a7793 # R-Car M2-N
33          - const: renesas,rcar-gen2-thermal # Generic thermal-zone
34          - const: renesas,rcar-thermal # Generic without thermal-zone
35      - items:
36          - enum:
37              - renesas,thermal-r8a774c0 # RZ/G2E
38              - renesas,thermal-r8a77970 # R-Car V3M
39              - renesas,thermal-r8a77990 # R-Car E3
40              - renesas,thermal-r8a77995 # R-Car D3
41  reg:
42    description:
43      Address ranges of the thermal registers. If more then one range is given
44      the first one must be the common registers followed by each sensor
45      according the the datasheet.
46    minItems: 1
47    maxItems: 4
48
49  interrupts:
50    minItems: 1
51    maxItems: 3
52
53  clocks:
54    maxItems: 1
55
56  power-domains:
57    maxItems: 1
58
59  resets:
60    maxItems: 1
61
62if:
63  properties:
64    compatible:
65      contains:
66        enum:
67          - renesas,thermal-r8a73a4 # R-Mobile APE6
68          - renesas,thermal-r8a7779 # R-Car H1
69then:
70  required:
71    - compatible
72    - reg
73else:
74  required:
75    - compatible
76    - reg
77    - interrupts
78    - clocks
79    - power-domains
80    - resets
81
82examples:
83  # Example (non interrupt support)
84  - |
85    thermal@ffc48000 {
86            compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal";
87            reg = <0xffc48000 0x38>;
88    };
89
90  # Example (interrupt support)
91  - |
92    #include <dt-bindings/clock/r8a73a4-clock.h>
93    #include <dt-bindings/interrupt-controller/arm-gic.h>
94    #include <dt-bindings/interrupt-controller/irq.h>
95
96    thermal@e61f0000 {
97            compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal";
98            reg = <0xe61f0000 0x14>, <0xe61f0100 0x38>,
99                  <0xe61f0200 0x38>, <0xe61f0300 0x38>;
100            interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
101            clocks = <&mstp5_clks R8A73A4_CLK_THERMAL>;
102            power-domains = <&pd_c5>;
103    };
104
105  # Example (with thermal-zone)
106  - |
107    #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
108    #include <dt-bindings/interrupt-controller/arm-gic.h>
109    #include <dt-bindings/power/r8a7790-sysc.h>
110
111    thermal: thermal@e61f0000 {
112      compatible = "renesas,thermal-r8a7790",
113                   "renesas,rcar-gen2-thermal",
114                   "renesas,rcar-thermal";
115            reg = <0xe61f0000 0x10>, <0xe61f0100 0x38>;
116            interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
117            clocks = <&cpg CPG_MOD 522>;
118            power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
119            resets = <&cpg 522>;
120            #thermal-sensor-cells = <0>;
121    };
122
123    thermal-zones {
124            cpu_thermal: cpu-thermal {
125                    polling-delay-passive = <1000>;
126                    polling-delay = <5000>;
127
128                    thermal-sensors = <&thermal>;
129
130                    trips {
131                            cpu-crit {
132                                    temperature = <115000>;
133                                    hysteresis = <0>;
134                                    type = "critical";
135                            };
136                    };
137                    cooling-maps {
138                    };
139            };
140    };
141