← Documents Documentation/devicetree/bindings/timer/ingenic,tcu.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / Timer

Ingenic SoCs Timer/Counter Unit

Ingenic TCU parent provider와 watchdog·PWM·OST child node 구성을 설명합니다.

Source pathDocumentation/devicetree/bindings/timer/ingenic,tcu.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

ingenic,tcu.yaml:1-302

Ingenic TCU parent provider와 watchdog·PWM·OST child node 구성을 설명합니다. 접을 수 있는 영어 원문 전체와 한국어 전문 번역을 함께 제공하며 compatible, interrupt, clock, register, phandle, 수치와 줄 좌표를 원형대로 보존합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/timer/ingenic,tcu.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Ingenic SoCs Timer/Counter Unit (TCU)
8
9 description: |
10 For a description of the TCU hardware and drivers, have a look at
11 Documentation/arch/mips/ingenic-tcu.rst.
12
13 maintainers:
14 - Paul Cercueil <paul@crapouillou.net>
15
16 select:
17 properties:
18 compatible:
19 contains:
20 enum:
21 - ingenic,jz4740-tcu
22 - ingenic,jz4725b-tcu
23 - ingenic,jz4760-tcu
24 - ingenic,jz4760b-tcu
25 - ingenic,jz4770-tcu
26 - ingenic,jz4780-tcu
27 - ingenic,x1000-tcu
28 required:
29 - compatible
30
31 properties:
32 $nodename:
33 pattern: "^timer@[0-9a-f]+$"
34
35 "#address-cells":
36 const: 1
37
38 "#size-cells":
39 const: 1
40
41 "#clock-cells":
42 const: 1
43
44 "#interrupt-cells":
45 const: 1
46
47 interrupt-controller: true
48
49 ranges: true
50
51 compatible:
52 oneOf:
53 - items:
54 - enum:
55 - ingenic,jz4740-tcu
56 - ingenic,jz4725b-tcu
57 - ingenic,jz4760-tcu
58 - ingenic,x1000-tcu
59 - const: simple-mfd
60 - items:
61 - enum:
62 - ingenic,jz4780-tcu
63 - ingenic,jz4770-tcu
64 - ingenic,jz4760b-tcu
65 - const: ingenic,jz4760-tcu
66 - const: simple-mfd
67
68 reg:
69 maxItems: 1
70
71 clocks:
72 items:
73 - description: RTC clock
74 - description: EXT clock
75 - description: PCLK clock
76 - description: TCU clock
77 minItems: 3
78
79 clock-names:
80 items:
81 - const: rtc
82 - const: ext
83 - const: pclk
84 - const: tcu
85 minItems: 3
86
87 interrupts:
88 items:
89 - description: TCU0 interrupt
90 - description: TCU1 interrupt
91 - description: TCU2 interrupt
92 minItems: 1
93
94 assigned-clocks:
95 minItems: 1
96 maxItems: 8
97
98 assigned-clock-parents:
99 minItems: 1
100 maxItems: 8
101
102 assigned-clock-rates:
103 minItems: 1
104 maxItems: 8
105
106 ingenic,pwm-channels-mask:
107 description: Bitmask of TCU channels reserved for PWM use.
108 $ref: /schemas/types.yaml#/definitions/uint32
109 minimum: 0x00
110 maximum: 0xff
111 default: 0xfc
112
113 patternProperties:
114 "^watchdog@[a-f0-9]+$":
115 type: object
116 $ref: /schemas/watchdog/watchdog.yaml#
117 unevaluatedProperties: false
118
119 properties:
120 compatible:
121 oneOf:
122 - enum:
123 - ingenic,jz4740-watchdog
124 - ingenic,jz4780-watchdog
125 - items:
126 - enum:
127 - ingenic,jz4770-watchdog
128 - ingenic,jz4760b-watchdog
129 - ingenic,jz4760-watchdog
130 - ingenic,jz4725b-watchdog
131 - const: ingenic,jz4740-watchdog
132
133 reg:
134 maxItems: 1
135
136 clocks:
137 maxItems: 1
138
139 clock-names:
140 const: wdt
141
142 required:
143 - compatible
144 - reg
145 - clocks
146 - clock-names
147
148 "^pwm@[a-f0-9]+$":
149 type: object
150 $ref: /schemas/pwm/pwm.yaml#
151 unevaluatedProperties: false
152
153 properties:
154 compatible:
155 oneOf:
156 - enum:
157 - ingenic,jz4740-pwm
158 - ingenic,jz4725b-pwm
159 - ingenic,x1000-pwm
160 - items:
161 - enum:
162 - ingenic,jz4760-pwm
163 - ingenic,jz4760b-pwm
164 - ingenic,jz4770-pwm
165 - ingenic,jz4780-pwm
166 - const: ingenic,jz4740-pwm
167
168 reg:
169 maxItems: 1
170
171 clocks:
172 minItems: 6
173 maxItems: 8
174
175 clock-names:
176 items:
177 - const: timer0
178 - const: timer1
179 - const: timer2
180 - const: timer3
181 - const: timer4
182 - const: timer5
183 - const: timer6
184 - const: timer7
185 minItems: 6
186
187 required:
188 - compatible
189 - reg
190 - clocks
191 - clock-names
192
193 "^timer@[a-f0-9]+$":
194 type: object
195 properties:
196 compatible:
197 oneOf:
198 - enum:
199 - ingenic,jz4725b-ost
200 - ingenic,jz4760b-ost
201 - items:
202 - const: ingenic,jz4760-ost
203 - const: ingenic,jz4725b-ost
204 - items:
205 - enum:
206 - ingenic,jz4780-ost
207 - ingenic,jz4770-ost
208 - const: ingenic,jz4760b-ost
209
210 reg:
211 maxItems: 1
212
213 clocks:
214 maxItems: 1
215
216 clock-names:
217 const: ost
218
219 interrupts:
220 maxItems: 1
221
222 required:
223 - compatible
224 - reg
225 - clocks
226 - clock-names
227 - interrupts
228
229 additionalProperties: false
230
231 required:
232 - "#clock-cells"
233 - "#interrupt-cells"
234 - interrupt-controller
235 - compatible
236 - reg
237 - clocks
238 - clock-names
239 - interrupts
240
241 additionalProperties: false
242
243 examples:
244 - |
245 #include <dt-bindings/clock/ingenic,jz4770-cgu.h>
246 #include <dt-bindings/clock/ingenic,tcu.h>
247 tcu: timer@10002000 {
248 compatible = "ingenic,jz4770-tcu", "ingenic,jz4760-tcu", "simple-mfd";
249 reg = <0x10002000 0x1000>;
250 #address-cells = <1>;
251 #size-cells = <1>;
252 ranges = <0x0 0x10002000 0x1000>;
253
254 #clock-cells = <1>;
255
256 clocks = <&cgu JZ4770_CLK_RTC>,
257 <&cgu JZ4770_CLK_EXT>,
258 <&cgu JZ4770_CLK_PCLK>;
259 clock-names = "rtc", "ext", "pclk";
260
261 interrupt-controller;
262 #interrupt-cells = <1>;
263
264 interrupt-parent = <&intc>;
265 interrupts = <27 26 25>;
266
267 watchdog: watchdog@0 {
268 compatible = "ingenic,jz4770-watchdog", "ingenic,jz4740-watchdog";
269 reg = <0x0 0xc>;
270
271 clocks = <&tcu TCU_CLK_WDT>;
272 clock-names = "wdt";
273 };
274
275 pwm: pwm@40 {
276 compatible = "ingenic,jz4770-pwm", "ingenic,jz4740-pwm";
277 reg = <0x40 0x80>;
278
279 #pwm-cells = <3>;
280
281 clocks = <&tcu TCU_CLK_TIMER0>,
282 <&tcu TCU_CLK_TIMER1>,
283 <&tcu TCU_CLK_TIMER2>,
284 <&tcu TCU_CLK_TIMER3>,
285 <&tcu TCU_CLK_TIMER4>,
286 <&tcu TCU_CLK_TIMER5>,
287 <&tcu TCU_CLK_TIMER6>,
288 <&tcu TCU_CLK_TIMER7>;
289 clock-names = "timer0", "timer1", "timer2", "timer3",
290 "timer4", "timer5", "timer6", "timer7";
291 };
292
293 ost: timer@e0 {
294 compatible = "ingenic,jz4770-ost", "ingenic,jz4760b-ost";
295 reg = <0xe0 0x20>;
296
297 clocks = <&tcu TCU_CLK_OST>;
298 clock-names = "ost";
299
300 interrupts = <15>;
301 };
302 };
303

3. 한국어 전문 번역

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

Ingenic Timer/Counter Unit

1-15

GPL-2.0-only 또는 BSD-2-Clause 라이선스의 이 스키마는 Ingenic SoC의 Timer/Counter Unit(TCU)을 정의합니다. TCU hardware와 driver에 관한 설명은 `Documentation/arch/mips/ingenic-tcu.rst`를 참고합니다. Maintainer는 Paul Cercueil입니다.

적용 대상 SoC

16-30

이 스키마는 `compatible`에 JZ4740, JZ4725B, JZ4760, JZ4760B, JZ4770, JZ4780 또는 X1000 TCU compatible 중 하나가 포함된 node에 적용됩니다. 스키마 선택을 위해 `compatible` 속성이 반드시 있어야 합니다.

select:
  properties:
    compatible:
      contains:
        enum:
          - ingenic,jz4740-tcu
          - ingenic,jz4725b-tcu
          - ingenic,jz4760-tcu
          - ingenic,jz4760b-tcu
          - ingenic,jz4770-tcu
          - ingenic,jz4780-tcu
          - ingenic,x1000-tcu
  required:
    - compatible

Parent node와 compatible fallback

31-67

Node 이름은 `timer@<hex-address>` 형식입니다. `#address-cells`, `#size-cells`, `#clock-cells`, `#interrupt-cells`는 모두 1이며, TCU는 interrupt controller이자 clock provider이고 child address 변환용 `ranges`를 지원합니다. JZ4740·JZ4725B·JZ4760·X1000은 각 SoC TCU compatible 뒤에 `simple-mfd`를 둡니다. JZ4780·JZ4770·JZ4760B는 각 SoC compatible 뒤에 `ingenic,jz4760-tcu`, `simple-mfd` fallback을 순서대로 둡니다.

properties:
  $nodename:
    pattern: "^timer@[0-9a-f]+$"

  "#address-cells":
    const: 1

  "#size-cells":
    const: 1

  "#clock-cells":
    const: 1

  "#interrupt-cells":
    const: 1

  interrupt-controller: true

  ranges: true

  compatible:
    oneOf:
      - items:
          - enum:
              - ingenic,jz4740-tcu
              - ingenic,jz4725b-tcu
              - ingenic,jz4760-tcu
              - ingenic,x1000-tcu
          - const: simple-mfd
      - items:
          - enum:
              - ingenic,jz4780-tcu
              - ingenic,jz4770-tcu
              - ingenic,jz4760b-tcu
          - const: ingenic,jz4760-tcu
          - const: simple-mfd

Clock·interrupt와 PWM channel mask

68-112

`reg`는 최대 한 영역입니다. `clocks`와 `clock-names`는 RTC, EXT, PCLK의 최소 세 항목을 순서대로 담고, SoC가 제공하면 네 번째 TCU clock을 추가합니다. `interrupts`는 TCU0, TCU1, TCU2 interrupt 중 최소 하나를 담습니다. `assigned-clocks`, `assigned-clock-parents`, `assigned-clock-rates`는 각각 1~8개를 허용합니다. `ingenic,pwm-channels-mask`는 PWM 전용으로 예약할 TCU channel의 8-bit mask이며 범위는 `0x00`~`0xff`, 기본값은 `0xfc`입니다.

reg:
  maxItems: 1

clocks:
  items:
    - description: RTC clock
    - description: EXT clock
    - description: PCLK clock
    - description: TCU clock
  minItems: 3

clock-names:
  items:
    - const: rtc
    - const: ext
    - const: pclk
    - const: tcu
  minItems: 3

interrupts:
  items:
    - description: TCU0 interrupt
    - description: TCU1 interrupt
    - description: TCU2 interrupt
  minItems: 1

assigned-clocks:
  minItems: 1
  maxItems: 8

assigned-clock-parents:
  minItems: 1
  maxItems: 8

assigned-clock-rates:
  minItems: 1
  maxItems: 8

ingenic,pwm-channels-mask:
  description: Bitmask of TCU channels reserved for PWM use.
  $ref: /schemas/types.yaml#/definitions/uint32
  minimum: 0x00
  maximum: 0xff
  default: 0xfc

Watchdog child node

113-147

`watchdog@<offset>` child는 공통 watchdog schema를 따르며 다른 속성은 허용되지 않습니다. JZ4740과 JZ4780 watchdog은 독립 compatible을 사용합니다. JZ4770·JZ4760B·JZ4760·JZ4725B watchdog은 각 SoC compatible 뒤에 `ingenic,jz4740-watchdog` fallback을 둡니다. `reg`와 `clocks`는 각각 최대 한 항목이고 clock 이름은 `wdt`입니다. `compatible`, `reg`, `clocks`, `clock-names`가 모두 필수입니다.

patternProperties:
  "^watchdog@[a-f0-9]+$":
    type: object
    $ref: /schemas/watchdog/watchdog.yaml#
    unevaluatedProperties: false

    properties:
      compatible:
        oneOf:
          - enum:
              - ingenic,jz4740-watchdog
              - ingenic,jz4780-watchdog
          - items:
              - enum:
                  - ingenic,jz4770-watchdog
                  - ingenic,jz4760b-watchdog
                  - ingenic,jz4760-watchdog
                  - ingenic,jz4725b-watchdog
              - const: ingenic,jz4740-watchdog

      reg:
        maxItems: 1

      clocks:
        maxItems: 1

      clock-names:
        const: wdt

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

PWM child node

148-192

`pwm@<offset>` child는 공통 PWM schema를 따르며 다른 속성은 허용되지 않습니다. JZ4740·JZ4725B·X1000 PWM은 독립 compatible을 사용하고, JZ4760·JZ4760B·JZ4770·JZ4780 PWM은 각 SoC compatible 뒤에 `ingenic,jz4740-pwm` fallback을 둡니다. `reg`는 최대 한 영역입니다. Clock은 `timer0`부터 `timer7`까지 순서대로 6~8개를 사용하며 `compatible`, `reg`, `clocks`, `clock-names`가 필수입니다.

"^pwm@[a-f0-9]+$":
  type: object
  $ref: /schemas/pwm/pwm.yaml#
  unevaluatedProperties: false

  properties:
    compatible:
      oneOf:
        - enum:
            - ingenic,jz4740-pwm
            - ingenic,jz4725b-pwm
            - ingenic,x1000-pwm
        - items:
            - enum:
                - ingenic,jz4760-pwm
                - ingenic,jz4760b-pwm
                - ingenic,jz4770-pwm
                - ingenic,jz4780-pwm
            - const: ingenic,jz4740-pwm

    reg:
      maxItems: 1

    clocks:
      minItems: 6
      maxItems: 8

    clock-names:
      items:
        - const: timer0
        - const: timer1
        - const: timer2
        - const: timer3
        - const: timer4
        - const: timer5
        - const: timer6
        - const: timer7
      minItems: 6

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

OST timer child node

193-230

`timer@<offset>` child는 OST를 나타냅니다. JZ4725B와 JZ4760B OST는 독립 compatible을 사용할 수 있습니다. JZ4760은 `ingenic,jz4725b-ost`로 fallback하고, JZ4780·JZ4770은 `ingenic,jz4760b-ost`로 fallback합니다. `reg`, `clocks`, `interrupts`는 각각 최대 한 항목이고 clock 이름은 `ost`입니다. 이 다섯 속성은 모두 필수이며 추가 속성은 허용되지 않습니다.

"^timer@[a-f0-9]+$":
  type: object
  properties:
    compatible:
      oneOf:
        - enum:
            - ingenic,jz4725b-ost
            - ingenic,jz4760b-ost
        - items:
            - const: ingenic,jz4760-ost
            - const: ingenic,jz4725b-ost
        - items:
            - enum:
                - ingenic,jz4780-ost
                - ingenic,jz4770-ost
            - const: ingenic,jz4760b-ost

    reg:
      maxItems: 1

    clocks:
      maxItems: 1

    clock-names:
      const: ost

    interrupts:
      maxItems: 1

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

  additionalProperties: false

Parent 필수 속성

231-242

TCU parent node에는 `#clock-cells`, `#interrupt-cells`, `interrupt-controller`, `compatible`, `reg`, `clocks`, `clock-names`, `interrupts`가 반드시 있어야 합니다. 스키마에 정의되지 않은 추가 parent 속성은 허용되지 않습니다.

required:
  - "#clock-cells"
  - "#interrupt-cells"
  - interrupt-controller
  - compatible
  - reg
  - clocks
  - clock-names
  - interrupts

additionalProperties: false

JZ4770 TCU parent 예제

243-266

예제의 `tcu: timer@10002000`은 JZ4770 compatible 뒤에 JZ4760과 `simple-mfd` fallback을 둡니다. 0x1000-byte register 영역을 child bus로 노출하고 address·size cell을 각각 1로 설정합니다. RTC, EXT, PCLK 세 clock을 연결하며 clock provider와 interrupt controller를 선언합니다. `intc`를 parent로 사용해 TCU interrupt 27·26·25를 지정합니다.

examples:
  - |
    #include <dt-bindings/clock/ingenic,jz4770-cgu.h>
    #include <dt-bindings/clock/ingenic,tcu.h>
    tcu: timer@10002000 {
      compatible = "ingenic,jz4770-tcu", "ingenic,jz4760-tcu", "simple-mfd";
      reg = <0x10002000 0x1000>;
      #address-cells = <1>;
      #size-cells = <1>;
      ranges = <0x0 0x10002000 0x1000>;

      #clock-cells = <1>;

      clocks = <&cgu JZ4770_CLK_RTC>,
               <&cgu JZ4770_CLK_EXT>,
               <&cgu JZ4770_CLK_PCLK>;
      clock-names = "rtc", "ext", "pclk";

      interrupt-controller;
      #interrupt-cells = <1>;

      interrupt-parent = <&intc>;
      interrupts = <27 26 25>;

Watchdog child 예제

267-274

`watchdog@0` child는 JZ4770 watchdog과 JZ4740 fallback을 사용하고 offset 0x0의 0xc-byte 영역을 차지합니다. TCU의 `TCU_CLK_WDT` 출력을 `wdt` clock으로 연결합니다.

watchdog: watchdog@0 {
  compatible = "ingenic,jz4770-watchdog", "ingenic,jz4740-watchdog";
  reg = <0x0 0xc>;

  clocks = <&tcu TCU_CLK_WDT>;
  clock-names = "wdt";
};

PWM child 예제

275-292

`pwm@40` child는 JZ4770 PWM과 JZ4740 fallback을 사용하고 offset 0x40의 0x80-byte 영역을 차지합니다. `#pwm-cells = <3>`을 선언하고 `TCU_CLK_TIMER0`부터 `TCU_CLK_TIMER7`까지 여덟 clock을 `timer0`~`timer7` 이름에 맞춰 연결합니다.

pwm: pwm@40 {
  compatible = "ingenic,jz4770-pwm", "ingenic,jz4740-pwm";
  reg = <0x40 0x80>;

  #pwm-cells = <3>;

  clocks = <&tcu TCU_CLK_TIMER0>,
           <&tcu TCU_CLK_TIMER1>,
           <&tcu TCU_CLK_TIMER2>,
           <&tcu TCU_CLK_TIMER3>,
           <&tcu TCU_CLK_TIMER4>,
           <&tcu TCU_CLK_TIMER5>,
           <&tcu TCU_CLK_TIMER6>,
           <&tcu TCU_CLK_TIMER7>;
  clock-names = "timer0", "timer1", "timer2", "timer3",
          "timer4", "timer5", "timer6", "timer7";
};

OST child 예제

293-302

`ost: timer@e0` child는 JZ4770 OST와 JZ4760B fallback을 사용하고 offset 0xe0의 0x20-byte 영역을 차지합니다. `TCU_CLK_OST`를 `ost` clock으로 연결하고 interrupt 15를 지정합니다.

  ost: timer@e0 {
    compatible = "ingenic,jz4770-ost", "ingenic,jz4760b-ost";
    reg = <0xe0 0x20>;

    clocks = <&tcu TCU_CLK_OST>;
    clock-names = "ost";

    interrupts = <15>;
  };
};