summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml
blob: bebd930daa8a0a23d9bddfa72f9b387b788026fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2020 Renesas Electronics Corp.
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/rcar-thermal.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Renesas R-Car Thermal

maintainers:
  - Niklas Söderlund <niklas.soderlund@ragnatech.se>

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - renesas,thermal-r8a73a4 # R-Mobile APE6
              - renesas,thermal-r8a7779 # R-Car H1
          - const: renesas,rcar-thermal # Generic without thermal-zone
      - items:
          - enum:
              - renesas,thermal-r8a7743 # RZ/G1M
              - renesas,thermal-r8a7744 # RZ/G1N
          - const: renesas,rcar-gen2-thermal # Generic thermal-zone
      - items:
          - enum:
              - renesas,thermal-r8a7790 # R-Car H2
              - renesas,thermal-r8a7791 # R-Car M2-W
              - renesas,thermal-r8a7792 # R-Car V2H
              - renesas,thermal-r8a7793 # R-Car M2-N
          - const: renesas,rcar-gen2-thermal # Generic thermal-zone
          - const: renesas,rcar-thermal # Generic without thermal-zone
      - items:
          - enum:
              - renesas,thermal-r8a774c0 # RZ/G2E
              - renesas,thermal-r8a77970 # R-Car V3M
              - renesas,thermal-r8a77990 # R-Car E3
              - renesas,thermal-r8a77995 # R-Car D3
  reg:
    description:
      Address ranges of the thermal registers. If more then one range is given
      the first one must be the common registers followed by each sensor
      according the the datasheet.
    minItems: 1
    maxItems: 4

  interrupts:
    minItems: 1
    maxItems: 3

  clocks:
    maxItems: 1

  power-domains:
    maxItems: 1

  resets:
    maxItems: 1

if:
  properties:
    compatible:
      contains:
        enum:
          - renesas,thermal-r8a73a4 # R-Mobile APE6
          - renesas,thermal-r8a7779 # R-Car H1
then:
  required:
    - compatible
    - reg
else:
  required:
    - compatible
    - reg
    - interrupts
    - clocks
    - power-domains
    - resets

examples:
  # Example (non interrupt support)
  - |
    thermal@ffc48000 {
            compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal";
            reg = <0xffc48000 0x38>;
    };

  # Example (interrupt support)
  - |
    #include <dt-bindings/clock/r8a73a4-clock.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    thermal@e61f0000 {
            compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal";
            reg = <0xe61f0000 0x14>, <0xe61f0100 0x38>,
                  <0xe61f0200 0x38>, <0xe61f0300 0x38>;
            interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&mstp5_clks R8A73A4_CLK_THERMAL>;
            power-domains = <&pd_c5>;
    };

  # Example (with thermal-zone)
  - |
    #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/power/r8a7790-sysc.h>

    thermal: thermal@e61f0000 {
      compatible = "renesas,thermal-r8a7790",
                   "renesas,rcar-gen2-thermal",
                   "renesas,rcar-thermal";
            reg = <0xe61f0000 0x10>, <0xe61f0100 0x38>;
            interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&cpg CPG_MOD 522>;
            power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
            resets = <&cpg 522>;
            #thermal-sensor-cells = <0>;
    };

    thermal-zones {
            cpu_thermal: cpu-thermal {
                    polling-delay-passive = <1000>;
                    polling-delay = <5000>;

                    thermal-sensors = <&thermal>;

                    trips {
                            cpu-crit {
                                    temperature = <115000>;
                                    hysteresis = <0>;
                                    type = "critical";
                            };
                    };
                    cooling-maps {
                    };
            };
    };