← Documents Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / SPI

Synopsys DesignWare APB SSI controller

DesignWare APB SSI의 vendor compatible, 조건부 register·mux·syscon, DMA와 RX sample delay를 설명합니다.

Source pathDocumentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

snps,dw-apb-ssi.yaml:1-204

DesignWare APB SSI의 vendor compatible, 조건부 register·mux·syscon, DMA와 RX sample delay를 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·interrupt·clock/DMA/reset 순서·수치·조건부 제약·예제 코드를 원형대로 유지합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 # SPDX-License-Identifier: GPL-2.0-only
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/spi/snps,dw-apb-ssi.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Synopsys DesignWare AMBA 2.0 Synchronous Serial Interface
8
9 maintainers:
10 - Mark Brown <[email protected]>
11
12 allOf:
13 - $ref: spi-controller.yaml#
14 - if:
15 properties:
16 compatible:
17 contains:
18 enum:
19 - mscc,ocelot-spi
20 - mscc,jaguar2-spi
21 then:
22 properties:
23 reg:
24 minItems: 2
25 - if:
26 properties:
27 compatible:
28 contains:
29 enum:
30 - baikal,bt1-sys-ssi
31 then:
32 properties:
33 mux-controls:
34 maxItems: 1
35 required:
36 - mux-controls
37 else:
38 required:
39 - interrupts
40 - if:
41 properties:
42 compatible:
43 contains:
44 const: amd,pensando-elba-spi
45 then:
46 required:
47 - amd,pensando-elba-syscon
48 else:
49 properties:
50 amd,pensando-elba-syscon: false
51
52 properties:
53 compatible:
54 oneOf:
55 - description: Generic DW SPI Controller
56 enum:
57 - snps,dw-apb-ssi
58 - snps,dwc-ssi-1.01a
59 - description: Microchip Sparx5 SoC SPI Controller
60 const: microchip,sparx5-spi
61 - description: Amazon Alpine SPI Controller
62 const: amazon,alpine-dw-apb-ssi
63 - description: Vendor controllers which use snps,dw-apb-ssi as fallback
64 items:
65 - enum:
66 - mscc,ocelot-spi
67 - mscc,jaguar2-spi
68 - renesas,rzn1-spi
69 - sophgo,sg2042-spi
70 - thead,th1520-spi
71 - const: snps,dw-apb-ssi
72 - description: Intel Keem Bay SPI Controller
73 const: intel,keembay-ssi
74 - description: Intel Mount Evans Integrated Management Complex SPI Controller
75 const: intel,mountevans-imc-ssi
76 - description: AMD Pensando Elba SoC SPI Controller
77 const: amd,pensando-elba-spi
78 - description: Baikal-T1 SPI Controller
79 const: baikal,bt1-ssi
80 - description: Baikal-T1 System Boot SPI Controller
81 const: baikal,bt1-sys-ssi
82 - description: Canaan Kendryte K210 SoS SPI Controller
83 const: canaan,k210-spi
84 - description: Renesas RZ/N1 SPI Controller
85 items:
86 - const: renesas,r9a06g032-spi # RZ/N1D
87 - const: renesas,rzn1-spi # RZ/N1
88
89 reg:
90 minItems: 1
91 items:
92 - description: DW APB SSI controller memory mapped registers
93 - description: SPI MST region map or directly mapped SPI ROM
94
95 interrupts:
96 maxItems: 1
97
98 clocks:
99 minItems: 1
100 items:
101 - description: SPI Controller reference clock source
102 - description: APB interface clock source
103
104 clock-names:
105 minItems: 1
106 items:
107 - const: ssi_clk
108 - const: pclk
109
110 resets:
111 maxItems: 1
112
113 reset-names:
114 const: spi
115
116 reg-io-width:
117 description: I/O register width (in bytes) implemented by this device
118 default: 4
119 enum: [ 2, 4 ]
120
121 num-cs:
122 default: 4
123 minimum: 1
124 maximum: 4
125
126 dmas:
127 items:
128 - description: TX DMA Channel
129 - description: RX DMA Channel
130
131 dma-names:
132 items:
133 - const: tx
134 - const: rx
135
136 rx-sample-delay-ns:
137 default: 0
138 description: |
139 Default value of the rx-sample-delay-ns property.
140 This value will be used if the property is not explicitly defined
141 for a SPI slave device.
142
143 SPI Rx sample delay offset, unit is nanoseconds.
144 The delay from the default sample time before the actual sample of the
145 rxd input signal occurs. The "rx_sample_delay" is an optional feature
146 of the designware controller, and the upper limit is also subject to
147 controller configuration.
148
149 amd,pensando-elba-syscon:
150 $ref: /schemas/types.yaml#/definitions/phandle-array
151 description:
152 Block address to control SPI chip-selects. The Elba SoC system controller
153 provides an interface to override the native DWC SSI CS control.
154
155 patternProperties:
156 "^.*@[0-9a-f]+$":
157 type: object
158 additionalProperties: true
159
160 properties:
161 reg:
162 minimum: 0
163 maximum: 3
164
165 unevaluatedProperties: false
166
167 required:
168 - compatible
169 - reg
170 - "#address-cells"
171 - "#size-cells"
172 - clocks
173
174 examples:
175 - |
176 spi@fff00000 {
177 compatible = "snps,dw-apb-ssi";
178 reg = <0xfff00000 0x1000>;
179 #address-cells = <1>;
180 #size-cells = <0>;
181 interrupts = <0 154 4>;
182 clocks = <&spi_m_clk>;
183 num-cs = <2>;
184 cs-gpios = <&gpio0 13 0>,
185 <&gpio0 14 0>;
186 rx-sample-delay-ns = <3>;
187 flash@1 {
188 compatible = "spi-nand";
189 reg = <1>;
190 rx-sample-delay-ns = <7>;
191 };
192 };
193 - |
194 spi@1f040100 {
195 compatible = "baikal,bt1-sys-ssi";
196 reg = <0x1f040100 0x900>,
197 <0x1c000000 0x1000000>;
198 #address-cells = <1>;
199 #size-cells = <0>;
200 mux-controls = <&boot_mux>;
201 clocks = <&ccu_sys>;
202 clock-names = "ssi_clk";
203 };
204 ...
205

3. 한국어 전문 번역

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

DesignWare APB SSI schema

1-13

이 GPL-2.0-only YAML schema는 Synopsys DesignWare AMBA 2.0 Synchronous Serial Interface를 정의합니다. Schema ID는 `http://devicetree.org/schemas/spi/snps,dw-apb-ssi.yaml#`, maintainer는 Mark Brown입니다.

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

Ocelot·Jaguar2 register 조건

14-24

Compatible에 `mscc,ocelot-spi` 또는 `mscc,jaguar2-spi`가 포함되면 `reg`는 최소 두 항목이어야 합니다. 둘째 영역은 뒤에서 정의하는 SPI MST region map 또는 direct-mapped SPI ROM입니다.

Baikal mux와 Pensando syscon 조건

25-50

Compatible에 `baikal,bt1-sys-ssi`가 포함되면 `mux-controls`는 최대 한 항목이며 필수입니다. 이 system-boot controller가 아니면 `interrupts`가 필수입니다.

Compatible에 `amd,pensando-elba-spi`가 포함되면 `amd,pensando-elba-syscon`이 필수입니다. 그 밖의 compatible에서는 이 속성을 사용할 수 없습니다.

Generic과 vendor compatible

51-88

Generic controller compatible은 `snps,dw-apb-ssi`, `snps,dwc-ssi-1.01a`입니다. 단독 vendor compatible은 `microchip,sparx5-spi`, `amazon,alpine-dw-apb-ssi`, `intel,keembay-ssi`, `intel,mountevans-imc-ssi`, `amd,pensando-elba-spi`, `baikal,bt1-ssi`, `baikal,bt1-sys-ssi`, `canaan,k210-spi`입니다.

`snps,dw-apb-ssi`를 fallback으로 쓰는 vendor controller는 첫 항목 `mscc,ocelot-spi`, `mscc,jaguar2-spi`, `renesas,rzn1-spi`, `sophgo,sg2042-spi`, `thead,th1520-spi` 중 하나와 둘째 항목 `snps,dw-apb-ssi`를 사용합니다. RZ/N1D는 `renesas,r9a06g032-spi` 뒤에 RZ/N1 fallback `renesas,rzn1-spi`를 둡니다.

Register, clock, reset과 chip-select

89-125

`reg`는 최소 한 항목입니다. 첫 영역은 DW APB SSI memory-mapped register이고, 둘째 선택 영역은 SPI MST region map 또는 direct-mapped SPI ROM입니다. `interrupts`는 최대 한 항목입니다.

`clocks`는 최소 한 항목이며 첫째가 SPI controller reference clock, 둘째 선택 항목이 APB interface clock입니다. `clock-names`는 같은 순서로 `ssi_clk`, `pclk`입니다. `resets`는 최대 한 항목이고 `reset-names`는 `spi`입니다.

`reg-io-width`는 byte 단위 I/O register width이며 2 또는 4, 기본값은 4입니다. `num-cs` 범위는 1~4이고 기본값은 4입니다.

DMA, RX sample delay와 Elba syscon

126-154

`dmas`는 TX와 RX channel 두 항목이고 `dma-names`는 `tx`, `rx` 순서입니다.

`rx-sample-delay-ns` 기본값은 0이며 SPI slave가 값을 명시하지 않았을 때 controller 기본값으로 사용됩니다. 이 값은 기본 sample time 이후 실제 `rxd` input을 sampling할 때까지의 offset을 nanosecond 단위로 지정합니다. `rx_sample_delay`는 DesignWare controller의 선택 feature이고 상한은 controller configuration에도 좌우됩니다.

`amd,pensando-elba-syscon`은 chip-select를 제어하는 block address를 담는 phandle array입니다. Elba system controller는 native DWC SSI CS control을 override하는 interface를 제공합니다.

Slave 주소 범위와 공통 필수 속성

155-173

정규식 `^.*@[0-9a-f]+$`에 맞는 child는 object이며 추가 속성을 허용합니다. Child `reg` chip-select 번호 범위는 0~3입니다.

필수 속성은 `compatible`, `reg`, `#address-cells`, `#size-cells`, `clocks`입니다. `unevaluatedProperties: false`로 평가되지 않은 controller 속성을 금지합니다.

Generic SSI와 SPI-NAND 예제

174-192

첫 예제는 `spi@fff00000`에 `snps,dw-apb-ssi`, interrupt 154, master clock과 두 GPIO chip-select를 지정합니다. Controller의 RX sample delay 기본값은 3ns이고 chip select 1의 SPI-NAND child는 이를 7ns로 override합니다.

spi@fff00000 {
  compatible = "snps,dw-apb-ssi";
  reg = <0xfff00000 0x1000>;
  #address-cells = <1>;
  #size-cells = <0>;
  interrupts = <0 154 4>;
  clocks = <&spi_m_clk>;
  num-cs = <2>;
  cs-gpios = <&gpio0 13 0>,
             <&gpio0 14 0>;
  rx-sample-delay-ns = <3>;
  flash@1 {
    compatible = "spi-nand";
    reg = <1>;
    rx-sample-delay-ns = <7>;
  };
};

Baikal-T1 system-boot SSI 예제

193-204

둘째 예제는 `baikal,bt1-sys-ssi` controller에 controller register와 direct-mapped SPI ROM 두 영역, `boot_mux`, system clock `ssi_clk`을 연결합니다. 이 compatible은 조건에 따라 interrupt 대신 `mux-controls`를 필수로 사용합니다. 마지막 `...`는 YAML document 종료 표기입니다.

spi@1f040100 {
  compatible = "baikal,bt1-sys-ssi";
  reg = <0x1f040100 0x900>,
        <0x1c000000 0x1000000>;
  #address-cells = <1>;
  #size-cells = <0>;
  mux-controls = <&boot_mux>;
  clocks = <&ccu_sys>;
  clock-names = "ssi_clk";
};