요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/rockchip-thermal.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Temperature Sensor ADC (TSADC) on Rockchip SoCs
maintainers:
- Heiko Stuebner <[email protected]>
$ref: thermal-sensor.yaml#
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-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
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]
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
required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- resets
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
examples:
- |
#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>;
};
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-73Controller-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-120Controller에는 `compatible`, `reg`, `interrupts`, `clocks`, `clock-names`, `resets`가 필수입니다.
required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- resets
SoC별 GRF·NVMEM·child 조건
121-160PX30, 조건 목록의 `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>;
};
요약과 해설
rockchip-thermal.yaml:1-178Rockchip TSADC의 trim, shutdown 설정과 SoC별 GRF·child 조건을 설명합니다. 접을 수 있는 영어 원문 전체는 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·register·interrupt·clock·reset·수치·예제 코드를 원형대로 유지합니다.