← Documents Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / Thermal

Rockchip Temperature Sensor ADC

Rockchip TSADC의 trim, shutdown 설정과 SoC별 GRF·child 조건을 설명합니다.

Source pathDocumentation/devicetree/bindings/thermal/rockchip-thermal.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

rockchip-thermal.yaml:1-178

Rockchip TSADC의 trim, shutdown 설정과 SoC별 GRF·child 조건을 설명합니다. 접을 수 있는 영어 원문 전체는 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·register·interrupt·clock·reset·수치·예제 코드를 원형대로 유지합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 # SPDX-License-Identifier: GPL-2.0-only
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/thermal/rockchip-thermal.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Temperature Sensor ADC (TSADC) on Rockchip SoCs
8
9 maintainers:
10 - Heiko Stuebner <[email protected]>
11
12 $ref: thermal-sensor.yaml#
13
14 properties:
15 compatible:
16 enum:
17 - rockchip,px30-tsadc
18 - rockchip,rk3228-tsadc
19 - rockchip,rk3288-tsadc
20 - rockchip,rk3328-tsadc
21 - rockchip,rk3368-tsadc
22 - rockchip,rk3399-tsadc
23 - rockchip,rk3568-tsadc
24 - rockchip,rk3576-tsadc
25 - rockchip,rk3588-tsadc
26 - rockchip,rv1108-tsadc
27
28 reg:
29 maxItems: 1
30
31 interrupts:
32 maxItems: 1
33
34 clocks:
35 minItems: 2
36 maxItems: 2
37
38 clock-names:
39 items:
40 - const: tsadc
41 - const: apb_pclk
42
43 nvmem-cells:
44 items:
45 - description: cell handle to where the trim's base temperature is stored
46 - description:
47 cell handle to where the trim's tenths of Celsius base value is stored
48
49 nvmem-cell-names:
50 items:
51 - const: trim_base
52 - const: trim_base_frac
53
54 resets:
55 minItems: 1
56 maxItems: 3
57
58 reset-names:
59 minItems: 1
60 items:
61 - const: tsadc-apb
62 - const: tsadc
63 - const: tsadc-phy
64
65 "#address-cells":
66 const: 1
67
68 "#size-cells":
69 const: 0
70
71 "#thermal-sensor-cells":
72 const: 1
73
74 rockchip,grf:
75 description: The phandle of the syscon node for the general register file.
76 $ref: /schemas/types.yaml#/definitions/phandle
77
78 rockchip,hw-tshut-temp:
79 description: The hardware-controlled shutdown temperature value.
80 $ref: /schemas/types.yaml#/definitions/uint32
81
82 rockchip,hw-tshut-mode:
83 description: The hardware-controlled shutdown mode 0:CRU 1:GPIO.
84 $ref: /schemas/types.yaml#/definitions/uint32
85 enum: [0, 1]
86
87 rockchip,hw-tshut-polarity:
88 description: The hardware-controlled active polarity 0:LOW 1:HIGH.
89 $ref: /schemas/types.yaml#/definitions/uint32
90 enum: [0, 1]
91
92 patternProperties:
93 "@[0-9a-f]+$":
94 type: object
95 properties:
96 reg:
97 maxItems: 1
98 description: sensor ID, a.k.a. channel number
99
100 nvmem-cells:
101 items:
102 - description: handle of cell containing calibration data
103
104 nvmem-cell-names:
105 items:
106 - const: trim
107
108 required:
109 - reg
110
111 unevaluatedProperties: false
112
113 required:
114 - compatible
115 - reg
116 - interrupts
117 - clocks
118 - clock-names
119 - resets
120
121 allOf:
122 - if:
123 properties:
124 compatible:
125 contains:
126 enum:
127 - rockchip,px30-tsadc
128 - rockchip,rk3366-tsadc
129 - rockchip,rk3399-tsadc
130 - rockchip,rk3568-tsadc
131 then:
132 required:
133 - rockchip,grf
134 else:
135 properties:
136 rockchip,grf: false
137 - if:
138 not:
139 properties:
140 compatible:
141 contains:
142 const: rockchip,rk3568-tsadc
143 then:
144 properties:
145 nvmem-cells: false
146 nvmem-cell-names: false
147 - if:
148 not:
149 properties:
150 compatible:
151 contains:
152 enum:
153 - rockchip,rk3568-tsadc
154 - rockchip,rk3576-tsadc
155 then:
156 patternProperties:
157 "@[0-9a-f]+$": false
158
159 unevaluatedProperties: false
160
161 examples:
162 - |
163 #include <dt-bindings/interrupt-controller/arm-gic.h>
164 #include <dt-bindings/clock/rk3288-cru.h>
165
166 tsadc: tsadc@ff280000 {
167 compatible = "rockchip,rk3288-tsadc";
168 reg = <0xff280000 0x100>;
169 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
170 clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
171 clock-names = "tsadc", "apb_pclk";
172 resets = <&cru SRST_TSADC>;
173 reset-names = "tsadc-apb";
174 #thermal-sensor-cells = <1>;
175 rockchip,hw-tshut-temp = <95000>;
176 rockchip,hw-tshut-mode = <0>;
177 rockchip,hw-tshut-polarity = <0>;
178 };
179

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Rockchip Temperature Sensor ADC

1-13

이 GPL-2.0-only YAML 스키마는 Rockchip SoC의 Temperature Sensor ADC(TSADC)를 정의합니다. Maintainer는 Heiko Stuebner이며 공통 `thermal-sensor.yaml#` 스키마를 사용합니다.

지원 SoC와 TSADC clock

14-42

지원 compatible은 PX30, RK3228, RK3288, RK3328, RK3368, RK3399, RK3568, RK3576, RK3588, RV1108의 `rockchip,*-tsadc`입니다. `reg`와 `interrupts`는 각각 최대 한 항목입니다. Clock은 정확히 두 개이며 이름과 순서는 TSADC functional clock인 `tsadc`, APB peripheral clock인 `apb_pclk`입니다.

properties:
  compatible:
    enum:
      - rockchip,px30-tsadc
      - rockchip,rk3228-tsadc
      - rockchip,rk3288-tsadc
      - rockchip,rk3328-tsadc
      - rockchip,rk3368-tsadc
      - rockchip,rk3399-tsadc
      - rockchip,rk3568-tsadc
      - rockchip,rk3576-tsadc
      - rockchip,rk3588-tsadc
      - rockchip,rv1108-tsadc

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    minItems: 2
    maxItems: 2

  clock-names:
    items:
      - const: tsadc
      - const: apb_pclk

NVMEM trim, reset과 cell 수

43-73

Controller-level `nvmem-cells`는 trim의 base temperature와 0.1°C 단위 fractional base 값을 저장한 두 셀을 받으며 이름은 `trim_base`, `trim_base_frac`입니다. Reset은 1~3개이고 이름은 `tsadc-apb`, `tsadc`, `tsadc-phy` 순서입니다. Child address를 위해 `#address-cells = 1`, `#size-cells = 0`을 사용하고 consumer sensor ID를 위해 `#thermal-sensor-cells = 1`을 사용합니다.

nvmem-cells:
  items:
    - description: cell handle to where the trim's base temperature is stored
    - description:
        cell handle to where the trim's tenths of Celsius base value is stored

nvmem-cell-names:
  items:
    - const: trim_base
    - const: trim_base_frac

resets:
  minItems: 1
  maxItems: 3

reset-names:
  minItems: 1
  items:
    - const: tsadc-apb
    - const: tsadc
    - const: tsadc-phy

"#address-cells":
  const: 1

"#size-cells":
  const: 0

"#thermal-sensor-cells":
  const: 1

GRF와 hardware thermal shutdown

74-91

`rockchip,grf`는 general register file을 제공하는 syscon node의 phandle입니다. `rockchip,hw-tshut-temp`는 hardware가 제어하는 shutdown temperature입니다. `rockchip,hw-tshut-mode`는 0일 때 CRU, 1일 때 GPIO를 사용하고, `rockchip,hw-tshut-polarity`는 0일 때 active-low, 1일 때 active-high입니다.

rockchip,grf:
  description: The phandle of the syscon node for the general register file.
  $ref: /schemas/types.yaml#/definitions/phandle

rockchip,hw-tshut-temp:
  description: The hardware-controlled shutdown temperature value.
  $ref: /schemas/types.yaml#/definitions/uint32

rockchip,hw-tshut-mode:
  description: The hardware-controlled shutdown mode 0:CRU 1:GPIO.
  $ref: /schemas/types.yaml#/definitions/uint32
  enum: [0, 1]

rockchip,hw-tshut-polarity:
  description: The hardware-controlled active polarity 0:LOW 1:HIGH.
  $ref: /schemas/types.yaml#/definitions/uint32
  enum: [0, 1]

Sensor channel child node

92-112

`@[0-9a-f]+$` 형식의 child node는 개별 TSADC sensor channel을 나타냅니다. `reg`는 sensor ID, 즉 channel number이며 필수입니다. 선택적인 `nvmem-cells` 하나는 channel calibration data를 담고 이름은 `trim`입니다. Child에는 평가되지 않은 추가 속성을 허용하지 않습니다.

patternProperties:
  "@[0-9a-f]+$":
    type: object
    properties:
      reg:
        maxItems: 1
        description: sensor ID, a.k.a. channel number

      nvmem-cells:
        items:
          - description: handle of cell containing calibration data

      nvmem-cell-names:
        items:
          - const: trim

    required:
      - reg

    unevaluatedProperties: false

Controller 필수 속성

113-120

Controller에는 `compatible`, `reg`, `interrupts`, `clocks`, `clock-names`, `resets`가 필수입니다.

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - resets

SoC별 GRF·NVMEM·child 조건

121-160

PX30, 조건 목록의 `rockchip,rk3366-tsadc`, RK3399, RK3568에는 `rockchip,grf`가 필수이고 그 밖의 compatible에서는 이 속성을 금지합니다. RK3568이 아니면 controller-level `nvmem-cells`와 `nvmem-cell-names`를 금지합니다. RK3568과 RK3576이 아니면 sensor child node 자체를 금지합니다. 최종적으로 `unevaluatedProperties: false`를 적용합니다.

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - rockchip,px30-tsadc
              - rockchip,rk3366-tsadc
              - rockchip,rk3399-tsadc
              - rockchip,rk3568-tsadc
    then:
      required:
        - rockchip,grf
    else:
      properties:
        rockchip,grf: false
  - if:
      not:
        properties:
          compatible:
            contains:
              const: rockchip,rk3568-tsadc
    then:
      properties:
        nvmem-cells: false
        nvmem-cell-names: false
  - if:
      not:
        properties:
          compatible:
            contains:
              enum:
                - rockchip,rk3568-tsadc
                - rockchip,rk3576-tsadc
    then:
      patternProperties:
        "@[0-9a-f]+$": false

unevaluatedProperties: false

RK3288 TSADC 예제

161-178

예제는 `0xff280000`의 0x100-byte RK3288 TSADC, GIC SPI 37 level-high interrupt, `SCLK_TSADC`와 `PCLK_TSADC`, `SRST_TSADC`를 연결합니다. Hardware shutdown temperature는 95000 millidegree, mode는 CRU를 뜻하는 0, polarity는 active-low를 뜻하는 0이며 1-cell sensor provider로 선언합니다.

- |
  #include <dt-bindings/interrupt-controller/arm-gic.h>
  #include <dt-bindings/clock/rk3288-cru.h>

  tsadc: tsadc@ff280000 {
      compatible = "rockchip,rk3288-tsadc";
      reg = <0xff280000 0x100>;
      interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
      clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
      clock-names = "tsadc", "apb_pclk";
      resets = <&cru SRST_TSADC>;
      reset-names = "tsadc-apb";
      #thermal-sensor-cells = <1>;
      rockchip,hw-tshut-temp = <95000>;
      rockchip,hw-tshut-mode = <0>;
      rockchip,hw-tshut-polarity = <0>;
  };