← Documents Documentation/devicetree/bindings/timer/arm,sp804.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / Timer

ARM SP804 Dual Timers

SP804 dual timer의 IRQ 선택, clock 구성과 Hisilicon variant를 설명합니다.

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

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

1. 요약·해설

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

요약과 해설

arm,sp804.yaml:1-97

SP804 dual timer의 IRQ 선택, clock 구성과 Hisilicon variant를 설명합니다. 접을 수 있는 영어 원문 전체와 한국어 전문 번역을 함께 제공하며 compatible, interrupt, clock, register, phandle, 수치와 줄 좌표를 원형대로 보존합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/timer/arm,sp804.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: ARM sp804 Dual Timers
8
9 maintainers:
10 - Haojian Zhuang <haojian.zhuang@linaro.org>
11
12 description: |+
13 The Arm SP804 IP implements two independent timers, configurable for
14 16 or 32 bit operation and capable of running in one-shot, periodic, or
15 free-running mode. The input clock is shared, but can be gated and prescaled
16 independently for each timer.
17
18 There is a viriant of Arm SP804: Hisilicon 64-bit SP804 timer. Some Hisilicon
19 SoCs, such as Hi1212, should use the dedicated compatible: "hisilicon,sp804".
20
21 # Need a custom select here or 'arm,primecell' will match on lots of nodes
22 select:
23 properties:
24 compatible:
25 contains:
26 enum:
27 - arm,sp804
28 - hisilicon,sp804
29 required:
30 - compatible
31
32 properties:
33 compatible:
34 items:
35 - enum:
36 - arm,sp804
37 - hisilicon,sp804
38 - const: arm,primecell
39
40 interrupts:
41 description: |
42 If two interrupts are listed, those are the interrupts for timer
43 1 and 2, respectively. If there is only a single interrupt, it is
44 either a combined interrupt or the sole interrupt of one timer, as
45 specified by the "arm,sp804-has-irq" property.
46 minItems: 1
47 maxItems: 2
48
49 reg:
50 description: The physical base address of the SP804 IP.
51 maxItems: 1
52
53 clocks:
54 description: |
55 Clocks driving the dual timer hardware. This list should
56 be 1 or 3 clocks. With 3 clocks, the order is timer0 clock, timer1
57 clock, apb_pclk. A single clock can also be specified if the same
58 clock is used for all clock inputs.
59 oneOf:
60 - items:
61 - description: clock for timer 1
62 - description: clock for timer 2
63 - description: bus clock
64 - items:
65 - description: unified clock for both timers and the bus
66
67 clock-names: true
68 # The original binding did not specify any clock names, and there is no
69 # consistent naming used in the existing DTs. The primecell binding
70 # requires the "apb_pclk" name, so we need this property.
71 # Use "timer0clk", "timer1clk", "apb_pclk" for new DTs.
72
73 arm,sp804-has-irq:
74 description: If only one interrupt line is connected to the interrupt
75 controller, this property specifies which timer is connected to this
76 line.
77 $ref: /schemas/types.yaml#/definitions/uint32
78 minimum: 1
79 maximum: 2
80
81 required:
82 - compatible
83 - interrupts
84 - reg
85 - clocks
86
87 additionalProperties: false
88
89 examples:
90 - |
91 timer0: timer@fc800000 {
92 compatible = "arm,sp804", "arm,primecell";
93 reg = <0xfc800000 0x1000>;
94 interrupts = <0 0 4>, <0 1 4>;
95 clocks = <&timclk1>, <&timclk2>, <&pclk>;
96 clock-names = "timer1", "timer2", "apb_pclk";
97 };
98

3. 한국어 전문 번역

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

ARM SP804 dual timer

1-20

GPL-2.0 라이선스의 이 스키마는 ARM SP804 Dual Timer를 정의합니다. SP804 IP는 16-bit 또는 32-bit로 구성할 수 있는 독립 timer 두 개를 구현하며 one-shot, periodic, free-running mode를 지원합니다. 두 timer는 input clock을 공유하지만 각 timer에서 독립적으로 gate와 prescale을 적용할 수 있습니다. Hi1212 같은 일부 Hisilicon SoC의 64-bit SP804 variant는 전용 `hisilicon,sp804` compatible을 사용합니다. Maintainer는 Haojian Zhuang입니다.

PrimeCell 선택과 compatible

21-39

일반 `arm,primecell`만으로 많은 node가 잘못 일치하지 않도록 custom select가 `arm,sp804` 또는 `hisilicon,sp804`를 포함하는 node만 선택합니다. 실제 compatible 목록은 이 SoC별 값 뒤에 `arm,primecell`을 둡니다.

# Need a custom select here or 'arm,primecell' will match on lots of nodes
select:
  properties:
    compatible:
      contains:
        enum:
          - arm,sp804
          - hisilicon,sp804
  required:
    - compatible

properties:
  compatible:
    items:
      - enum:
          - arm,sp804
          - hisilicon,sp804
      - const: arm,primecell

IRQ 개수와 1개·3개 clock 구성

40-88

Interrupt가 두 개이면 순서대로 timer 1과 timer 2용입니다. 하나뿐이면 combined interrupt이거나 `arm,sp804-has-irq`가 지정한 한 timer의 단독 interrupt입니다. 이 속성 값은 1 또는 2입니다. `reg`는 SP804 IP의 physical base address 한 항목입니다.

`clocks`는 1개 또는 3개입니다. 세 clock의 순서는 timer0 clock, timer1 clock, `apb_pclk`이고, 모든 입력이 같은 clock이면 하나만 지정할 수 있습니다. 기존 DT의 clock name이 일관되지 않고 PrimeCell binding이 `apb_pclk`를 요구하므로 `clock-names`를 허용하며, 새 DT에는 `timer0clk`, `timer1clk`, `apb_pclk`를 권장합니다. `compatible`, `interrupts`, `reg`, `clocks`가 필수이고 추가 속성은 허용되지 않습니다.

  interrupts:
    description: |
      If two interrupts are listed, those are the interrupts for timer
      1 and 2, respectively. If there is only a single interrupt, it is
      either a combined interrupt or the sole interrupt of one timer, as
      specified by the "arm,sp804-has-irq" property.
    minItems: 1
    maxItems: 2

  reg:
    description: The physical base address of the SP804 IP.
    maxItems: 1

  clocks:
    description: |
      Clocks driving the dual timer hardware. This list should
      be 1 or 3 clocks. With 3 clocks, the order is timer0 clock, timer1
      clock, apb_pclk. A single clock can also be specified if the same
      clock is used for all clock inputs.
    oneOf:
      - items:
          - description: clock for timer 1
          - description: clock for timer 2
          - description: bus clock
      - items:
          - description: unified clock for both timers and the bus

  clock-names: true
    # The original binding did not specify any clock names, and there is no
    # consistent naming used in the existing DTs. The primecell binding
    # requires the "apb_pclk" name, so we need this property.
    # Use "timer0clk", "timer1clk", "apb_pclk" for new DTs.

  arm,sp804-has-irq:
    description: If only one interrupt line is connected to the interrupt
      controller, this property specifies which timer is connected to this
      line.
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    maximum: 2

required:
  - compatible
  - interrupts
  - reg
  - clocks

additionalProperties: false

두 IRQ·세 clock SP804 예제

89-97

예제는 `timer@fc800000`에 0x1000-byte 영역과 interrupt 두 개를 지정합니다. `timclk1`, `timclk2`, `pclk` 세 phandle은 원문 예제의 `timer1`, `timer2`, `apb_pclk` 이름에 대응합니다.

- |
  timer0: timer@fc800000 {
      compatible = "arm,sp804", "arm,primecell";
      reg = <0xfc800000 0x1000>;
      interrupts = <0 0 4>, <0 1 4>;
      clocks = <&timclk1>, <&timclk2>, <&pclk>;
      clock-names = "timer1", "timer2", "apb_pclk";
  };