xref: /freebsd/sys/contrib/device-tree/Bindings/thermal/rcar-gen3-thermal.yaml (revision d30a1689f5b37e78ea189232a8b94a7011dc0dc8)
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-gen3-thermal.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Renesas R-Car Gen3 Thermal Sensor
9
10description:
11  On R-Car Gen3 SoCs, the thermal sensor controllers (TSC) control the thermal
12  sensors (THS) which are the analog circuits for measuring temperature (Tj)
13  inside the LSI.
14
15maintainers:
16  - Niklas Söderlund <niklas.soderlund@ragnatech.se>
17
18properties:
19  compatible:
20    enum:
21      - renesas,r8a774a1-thermal # RZ/G2M
22      - renesas,r8a774b1-thermal # RZ/G2N
23      - renesas,r8a774e1-thermal # RZ/G2H
24      - renesas,r8a7795-thermal  # R-Car H3
25      - renesas,r8a7796-thermal  # R-Car M3-W
26      - renesas,r8a77961-thermal # R-Car M3-W+
27      - renesas,r8a77965-thermal # R-Car M3-N
28      - renesas,r8a77980-thermal # R-Car V3H
29      - renesas,r8a779a0-thermal # R-Car V3U
30
31  reg: true
32
33  interrupts:
34    items:
35      - description: TEMP1 interrupt
36      - description: TEMP2 interrupt
37      - description: TEMP3 interrupt
38
39  clocks:
40    maxItems: 1
41
42  power-domains:
43    maxItems: 1
44
45  resets:
46    maxItems: 1
47
48  "#thermal-sensor-cells":
49    const: 1
50
51required:
52  - compatible
53  - reg
54  - clocks
55  - power-domains
56  - resets
57  - "#thermal-sensor-cells"
58
59if:
60  not:
61    properties:
62      compatible:
63        contains:
64          enum:
65            - renesas,r8a779a0-thermal
66then:
67  properties:
68    reg:
69      minItems: 2
70      items:
71        - description: TSC1 registers
72        - description: TSC2 registers
73        - description: TSC3 registers
74  required:
75    - interrupts
76else:
77  properties:
78    reg:
79      items:
80        - description: TSC0 registers
81        - description: TSC1 registers
82        - description: TSC2 registers
83        - description: TSC3 registers
84        - description: TSC4 registers
85
86additionalProperties: false
87
88examples:
89  - |
90    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
91    #include <dt-bindings/interrupt-controller/arm-gic.h>
92    #include <dt-bindings/power/r8a7795-sysc.h>
93
94    tsc: thermal@e6198000 {
95            compatible = "renesas,r8a7795-thermal";
96            reg = <0xe6198000 0x100>,
97                  <0xe61a0000 0x100>,
98                  <0xe61a8000 0x100>;
99            interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
100                         <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
101                         <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
102            clocks = <&cpg CPG_MOD 522>;
103            power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
104            resets = <&cpg 522>;
105            #thermal-sensor-cells = <1>;
106    };
107
108    thermal-zones {
109            sensor_thermal: sensor-thermal {
110                    polling-delay-passive = <250>;
111                    polling-delay = <1000>;
112                    thermal-sensors = <&tsc 0>;
113
114                    trips {
115                            sensor1_crit: sensor1-crit {
116                                    temperature = <90000>;
117                                    hysteresis = <2000>;
118                                    type = "critical";
119                            };
120                    };
121            };
122    };
123  - |
124    #include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
125    #include <dt-bindings/interrupt-controller/arm-gic.h>
126    #include <dt-bindings/power/r8a779a0-sysc.h>
127
128    tsc_r8a779a0: thermal@e6190000 {
129            compatible = "renesas,r8a779a0-thermal";
130            reg = <0xe6190000 0x200>,
131                  <0xe6198000 0x200>,
132                  <0xe61a0000 0x200>,
133                  <0xe61a8000 0x200>,
134                  <0xe61b0000 0x200>;
135            clocks = <&cpg CPG_MOD 919>;
136            power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
137            resets = <&cpg 919>;
138            #thermal-sensor-cells = <1>;
139    };
140