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

Linux 6.18.37 · Devicetree Bindings / Timer

RISC-V Timer

RISC-V supervisor timer의 time CSR·SBI·Sstc 구성을 설명합니다.

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

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

1. 요약·해설

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

요약과 해설

riscv,timer.yaml:1-52

RISC-V supervisor timer의 time CSR·SBI·Sstc 구성을 설명합니다. 접을 수 있는 영어 원문 전체와 한국어 전문 번역을 함께 제공하며 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/riscv,timer.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: RISC-V timer
8
9 maintainers:
10 - Anup Patel <anup@brainfault.org>
11
12 description: |+
13 RISC-V platforms always have a RISC-V timer device for the supervisor-mode
14 based on the time CSR defined by the RISC-V privileged specification. The
15 timer interrupts of this device are configured using the RISC-V SBI Time
16 extension or the RISC-V Sstc extension.
17
18 The clock frequency of RISC-V timer device is specified via the
19 "timebase-frequency" DT property of "/cpus" DT node which is described
20 in Documentation/devicetree/bindings/riscv/cpus.yaml
21
22 properties:
23 compatible:
24 enum:
25 - riscv,timer
26
27 interrupts-extended:
28 minItems: 1
29 maxItems: 4096 # Should be enough?
30
31 riscv,timer-cannot-wake-cpu:
32 type: boolean
33 description:
34 If present, the timer interrupt cannot wake up the CPU from one or
35 more suspend/idle states.
36
37 additionalProperties: false
38
39 required:
40 - compatible
41 - interrupts-extended
42
43 examples:
44 - |
45 timer {
46 compatible = "riscv,timer";
47 interrupts-extended = <&cpu1intc 5>,
48 <&cpu2intc 5>,
49 <&cpu3intc 5>,
50 <&cpu4intc 5>;
51 };
52 ...
53

3. 한국어 전문 번역

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

RISC-V supervisor timer

1-21

GPL-2.0-only 또는 BSD-2-Clause 라이선스의 이 스키마는 RISC-V timer를 정의합니다. RISC-V platform에는 privileged specification의 `time` CSR을 기반으로 하는 supervisor-mode timer device가 항상 존재합니다. Timer interrupt는 RISC-V SBI Time extension 또는 RISC-V Sstc extension으로 설정합니다. Timer clock frequency는 `/cpus` DT node의 `timebase-frequency` 속성으로 지정하며 이 속성은 `Documentation/devicetree/bindings/riscv/cpus.yaml`에 정의되어 있습니다. Maintainer는 Anup Patel입니다.

Extended interrupt와 wake 제한

22-42

`compatible`은 `riscv,timer`입니다. `interrupts-extended`는 1~4096개 항목을 허용합니다. Boolean `riscv,timer-cannot-wake-cpu`가 있으면 하나 이상의 suspend 또는 idle state에서 timer interrupt가 CPU를 깨울 수 없음을 뜻합니다. `compatible`과 `interrupts-extended`가 필수이며 추가 속성은 허용되지 않습니다.

properties:
  compatible:
    enum:
      - riscv,timer

  interrupts-extended:
    minItems: 1
    maxItems: 4096   # Should be enough?

  riscv,timer-cannot-wake-cpu:
    type: boolean
    description:
      If present, the timer interrupt cannot wake up the CPU from one or
      more suspend/idle states.

additionalProperties: false

required:
  - compatible
  - interrupts-extended

네 CPU interrupt controller 예제

43-52

예제는 `timer` node에서 CPU1~CPU4의 interrupt controller에 local interrupt 5를 각각 연결합니다.

examples:
  - |
    timer {
      compatible = "riscv,timer";
      interrupts-extended = <&cpu1intc 5>,
                            <&cpu2intc 5>,
                            <&cpu3intc 5>,
                            <&cpu4intc 5>;
    };
...