← Documents Documentation/devicetree/bindings/spi/omap-spi.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / SPI

OMAP and K3 McSPI controller

OMAP·K3 McSPI의 chip-select, legacy hwmod와 DMA naming을 설명합니다.

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

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

1. 요약·해설

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

요약과 해설

omap-spi.yaml:1-117

OMAP·K3 McSPI의 chip-select, legacy hwmod와 DMA naming을 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·clock/DMA 순서·수치·예제 코드를 원형대로 유지합니다.

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/spi/omap-spi.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: SPI Controller on OMAP and K3 SoCs
8
9 maintainers:
10 - Aswath Govindraju <[email protected]>
11
12 allOf:
13 - $ref: spi-controller.yaml#
14
15 properties:
16 compatible:
17 oneOf:
18 - items:
19 - enum:
20 - ti,am654-mcspi
21 - ti,am4372-mcspi
22 - const: ti,omap4-mcspi
23 - items:
24 - enum:
25 - ti,omap2-mcspi
26 - ti,omap4-mcspi
27
28 reg:
29 maxItems: 1
30
31 interrupts:
32 maxItems: 1
33
34 clocks:
35 maxItems: 1
36
37 power-domains:
38 maxItems: 1
39
40 ti,spi-num-cs:
41 $ref: /schemas/types.yaml#/definitions/uint32
42 description: Number of chipselect supported by the instance.
43 minimum: 1
44 maximum: 4
45
46 ti,hwmods:
47 $ref: /schemas/types.yaml#/definitions/string
48 description:
49 Must be "mcspi<n>", n being the instance number (1-based).
50 This property is applicable only on legacy platforms mainly omap2/3
51 and ti81xx and should not be used on other platforms.
52 deprecated: true
53
54 ti,pindir-d0-out-d1-in:
55 description:
56 Select the D0 pin as output and D1 as input. The default is D0
57 as input and D1 as output.
58 type: boolean
59
60 dmas:
61 description:
62 List of DMA specifiers with the controller specific format as
63 described in the generic DMA client binding. A tx and rx
64 specifier is required for each chip select.
65 minItems: 1
66 maxItems: 8
67
68 dma-names:
69 description:
70 List of DMA request names. These strings correspond 1:1 with
71 the DMA specifiers listed in dmas. The string names is to be
72 "rxN" and "txN" for RX and TX requests, respectively. Where N
73 is the chip select number.
74 minItems: 1
75 maxItems: 8
76
77 required:
78 - compatible
79 - reg
80 - interrupts
81
82 unevaluatedProperties: false
83
84 if:
85 properties:
86 compatible:
87 enum:
88 - ti,omap2-mcspi
89 - ti,omap4-mcspi
90
91 then:
92 properties:
93 ti,hwmods:
94 items:
95 - pattern: "^mcspi([1-9])$"
96
97 else:
98 properties:
99 ti,hwmods: false
100
101 examples:
102 - |
103 #include <dt-bindings/interrupt-controller/irq.h>
104 #include <dt-bindings/interrupt-controller/arm-gic.h>
105 #include <dt-bindings/soc/ti,sci_pm_domain.h>
106
107 spi@2100000 {
108 compatible = "ti,am654-mcspi","ti,omap4-mcspi";
109 reg = <0x2100000 0x400>;
110 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
111 clocks = <&k3_clks 137 1>;
112 power-domains = <&k3_pds 137 TI_SCI_PD_EXCLUSIVE>;
113 #address-cells = <1>;
114 #size-cells = <0>;
115 dmas = <&main_udmap 0xc500>, <&main_udmap 0x4500>;
116 dma-names = "tx0", "rx0";
117 };
118

3. 한국어 전문 번역

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

OMAP와 K3 McSPI schema

1-14

이 GPL-2.0-only 또는 BSD-2-Clause YAML schema는 OMAP와 K3 SoC의 SPI controller를 정의합니다. Schema ID는 `http://devicetree.org/schemas/spi/omap-spi.yaml#`, maintainer는 Aswath Govindraju입니다.

`spi-controller.yaml#`의 공통 SPI controller 속성을 상속합니다.

OMAP와 K3 compatible 조합

15-27

AM654와 AM4372는 각각 `ti,am654-mcspi` 또는 `ti,am4372-mcspi` 다음에 fallback `ti,omap4-mcspi`를 둡니다. `ti,omap2-mcspi`와 `ti,omap4-mcspi`는 단일 compatible로도 사용할 수 있습니다.

Register, interrupt, clock와 power domain

28-39

`reg`, `interrupts`, `clocks`, `power-domains`는 각각 최대 한 항목입니다.

Chip-select, legacy hwmod와 pin 방향

40-59

`ti,spi-num-cs`는 controller instance가 지원하는 chip-select 수를 나타내는 `uint32`이며 범위는 1~4입니다.

Deprecated `ti,hwmods`는 `mcspi<n>` 형식의 hwmod 이름이며 n은 1부터 시작하는 instance 번호입니다. 이 속성은 주로 OMAP2/3와 TI81xx 같은 legacy platform에만 적용되고 다른 platform에서는 사용하면 안 됩니다.

Boolean `ti,pindir-d0-out-d1-in`은 D0을 output, D1을 input으로 선택합니다. 기본값은 반대로 D0 input, D1 output입니다.

Chip-select별 DMA specifier와 이름

60-76

`dmas`는 generic DMA client binding 형식의 DMA specifier 목록입니다. Chip-select마다 TX와 RX specifier가 필요하며 전체 항목 수는 1~8개입니다.

`dma-names`는 `dmas`와 1:1로 대응하고 RX·TX request 이름은 각각 `rxN`, `txN` 형식입니다. N은 chip-select 번호이고 항목 수는 1~8개입니다.

필수 속성과 legacy 조건

77-100

필수 속성은 `compatible`, `reg`, `interrupts`입니다. `unevaluatedProperties: false`로 평가되지 않은 추가 속성을 금지합니다.

Compatible이 `ti,omap2-mcspi` 또는 `ti,omap4-mcspi`이면 `ti,hwmods` 값은 정규식 `^mcspi([1-9])$`과 일치해야 합니다. 그 외 compatible에서는 `ti,hwmods`를 사용할 수 없습니다.

AM654 McSPI 예제

101-117

예제는 AM654 compatible과 OMAP4 fallback을 사용하고 GIC SPI interrupt 184, K3 clock과 exclusive power domain을 연결합니다. Chip-select 0의 TX/RX DMA request 이름은 `tx0`, `rx0`입니다.

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/soc/ti,sci_pm_domain.h>

spi@2100000 {
  compatible = "ti,am654-mcspi","ti,omap4-mcspi";
  reg = <0x2100000 0x400>;
  interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
  clocks = <&k3_clks 137 1>;
  power-domains = <&k3_pds 137 TI_SCI_PD_EXCLUSIVE>;
  #address-cells = <1>;
  #size-cells = <0>;
  dmas = <&main_udmap 0xc500>, <&main_udmap 0x4500>;
  dma-names = "tx0", "rx0";
};