← Documents Documentation/devicetree/bindings/spi/samsung,spi.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / SPI

Samsung S3C/S5P/Exynos SPI controller

Samsung SPI의 SoC별 compatible, clock 조건, DMA·chip-select와 codec 예제를 설명합니다.

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

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

1. 요약·해설

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

요약과 해설

samsung,spi.yaml:1-194

Samsung SPI의 SoC별 compatible, clock 조건, DMA·chip-select와 codec 예제를 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·interrupt·clock/DMA·chip-select 순서·수치·조건부 제약·예제 코드를 원형대로 유지합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/spi/samsung,spi.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Samsung S3C/S5P/Exynos SoC SPI controller
8
9 maintainers:
10 - Krzysztof Kozlowski <krzk@kernel.org>
11
12 description:
13 All the SPI controller nodes should be represented in the aliases node using
14 the following format 'spi{n}' where n is a unique number for the alias.
15
16 properties:
17 compatible:
18 oneOf:
19 - enum:
20 - google,gs101-spi
21 - samsung,s3c6410-spi
22 - samsung,s5pv210-spi # for S5PV210 and S5PC110
23 - samsung,exynos4210-spi
24 - samsung,exynos5433-spi
25 - samsung,exynos850-spi
26 - samsung,exynosautov9-spi
27 - tesla,fsd-spi
28 - items:
29 - enum:
30 - samsung,exynos8895-spi
31 - samsung,exynosautov920-spi
32 - const: samsung,exynos850-spi
33 - const: samsung,exynos7-spi
34 deprecated: true
35
36 clocks:
37 minItems: 2
38 maxItems: 3
39
40 clock-names:
41 minItems: 2
42 maxItems: 3
43
44 dmas:
45 minItems: 2
46 maxItems: 2
47
48 dma-names:
49 items:
50 - const: tx
51 - const: rx
52
53 interrupts:
54 maxItems: 1
55
56 no-cs-readback:
57 description:
58 The CS line is disconnected, therefore the device should not operate
59 based on CS signalling.
60 type: boolean
61
62 num-cs:
63 minimum: 1
64 maximum: 4
65 default: 1
66
67 samsung,spi-src-clk:
68 description:
69 If the spi controller includes a internal clock mux to select the clock
70 source for the spi bus clock, this property can be used to indicate the
71 clock to be used for driving the spi bus clock. If not specified, the
72 clock number 0 is used as default.
73 $ref: /schemas/types.yaml#/definitions/uint32
74 default: 0
75
76 reg:
77 maxItems: 1
78
79 required:
80 - compatible
81 - clocks
82 - clock-names
83 - interrupts
84 - reg
85
86 allOf:
87 - $ref: spi-controller.yaml#
88 - if:
89 properties:
90 compatible:
91 contains:
92 enum:
93 - samsung,exynos5433-spi
94 - samsung,exynosautov9-spi
95 then:
96 properties:
97 clocks:
98 minItems: 3
99 maxItems: 3
100 clock-names:
101 items:
102 - const: spi
103 - enum:
104 - spi_busclk0
105 - spi_busclk1
106 - spi_busclk2
107 - spi_busclk3
108 - const: spi_ioclk
109 else:
110 properties:
111 clocks:
112 minItems: 2
113 maxItems: 2
114 clock-names:
115 items:
116 - const: spi
117 - enum:
118 - spi_busclk0
119 - spi_busclk1
120 - spi_busclk2
121 - spi_busclk3
122
123 unevaluatedProperties: false
124
125 examples:
126 - |
127 #include <dt-bindings/clock/exynos5433.h>
128 #include <dt-bindings/clock/samsung,s2mps11.h>
129 #include <dt-bindings/interrupt-controller/arm-gic.h>
130 #include <dt-bindings/gpio/gpio.h>
131
132 spi@14d30000 {
133 compatible = "samsung,exynos5433-spi";
134 reg = <0x14d30000 0x100>;
135 interrupts = <GIC_SPI 433 IRQ_TYPE_LEVEL_HIGH>;
136 dmas = <&pdma0 11>, <&pdma0 10>;
137 dma-names = "tx", "rx";
138 #address-cells = <1>;
139 #size-cells = <0>;
140 clocks = <&cmu_peric CLK_PCLK_SPI1>,
141 <&cmu_peric CLK_SCLK_SPI1>,
142 <&cmu_peric CLK_SCLK_IOCLK_SPI1>;
143 clock-names = "spi",
144 "spi_busclk0",
145 "spi_ioclk";
146 samsung,spi-src-clk = <0>;
147 pinctrl-names = "default";
148 pinctrl-0 = <&spi1_bus>;
149 num-cs = <1>;
150
151 cs-gpios = <&gpd6 3 GPIO_ACTIVE_HIGH>;
152
153 audio-codec@0 {
154 compatible = "wlf,wm5110";
155 reg = <0x0>;
156 spi-max-frequency = <20000000>;
157 interrupt-parent = <&gpa0>;
158 interrupts = <4 IRQ_TYPE_NONE>;
159 clocks = <&pmu_system_controller 0>,
160 <&s2mps13_osc S2MPS11_CLK_BT>;
161 clock-names = "mclk1", "mclk2";
162
163 gpio-controller;
164 #gpio-cells = <2>;
165 interrupt-controller;
166 #interrupt-cells = <2>;
167
168 wlf,micd-detect-debounce = <300>;
169 wlf,micd-bias-start-time = <0x1>;
170 wlf,micd-rate = <0x7>;
171 wlf,micd-dbtime = <0x2>;
172 wlf,micd-force-micbias;
173 wlf,micd-configs = <0x0 1 0>;
174 wlf,hpdet-channel = <1>;
175 wlf,gpsw = <0x1>;
176 wlf,inmode = <2 0 2 0>;
177
178 wlf,reset = <&gpc0 7 GPIO_ACTIVE_HIGH>;
179 wlf,ldoena = <&gpf0 0 GPIO_ACTIVE_HIGH>;
180
181 /* core supplies */
182 AVDD-supply = <&ldo18_reg>;
183 DBVDD1-supply = <&ldo18_reg>;
184 CPVDD-supply = <&ldo18_reg>;
185 DBVDD2-supply = <&ldo18_reg>;
186 DBVDD3-supply = <&ldo18_reg>;
187 SPKVDDL-supply = <&ldo18_reg>;
188 SPKVDDR-supply = <&ldo18_reg>;
189
190 controller-data {
191 samsung,spi-feedback-delay = <0>;
192 };
193 };
194 };
195

3. 한국어 전문 번역

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

Samsung S3C/S5P/Exynos SPI schema

1-15

이 GPL-2.0 또는 BSD-2-Clause YAML schema는 Samsung S3C/S5P/Exynos SoC SPI controller를 정의합니다. Schema ID는 `http://devicetree.org/schemas/spi/samsung,spi.yaml#`, maintainer는 Krzysztof Kozlowski입니다.

모든 SPI controller node는 aliases node에 `spi{n}` 형식으로 표시해야 하며 `n`은 alias마다 고유한 번호입니다.

SoC compatible과 fallback

16-35

단독 compatible은 `google,gs101-spi`, `samsung,s3c6410-spi`, S5PV210/S5PC110용 `samsung,s5pv210-spi`, `samsung,exynos4210-spi`, `samsung,exynos5433-spi`, `samsung,exynos850-spi`, `samsung,exynosautov9-spi`, `tesla,fsd-spi` 중 하나입니다.

`samsung,exynos8895-spi`와 `samsung,exynosautov920-spi`는 첫 항목에 두고 둘째 항목에 fallback `samsung,exynos850-spi`를 둡니다. 단독 `samsung,exynos7-spi`는 deprecated입니다.

Clock, DMA와 chip-select

36-65

`clocks`와 `clock-names`는 최소 두 항목, 최대 세 항목입니다. 실제 항목 수와 이름은 뒤의 SoC별 조건에서 정합니다.

`dmas`는 정확히 두 항목이고 `dma-names`는 `tx`, `rx` 순서입니다. `interrupts`는 최대 한 항목입니다.

Boolean `no-cs-readback`은 CS line이 연결되지 않아 장치가 CS signalling에 기반해 동작하면 안 됨을 나타냅니다. `num-cs` 범위는 1~4이고 기본값은 1입니다.

SPI source clock과 공통 필수 속성

66-85

Controller에 SPI bus clock source를 선택하는 internal clock mux가 있으면 `samsung,spi-src-clk`로 구동 clock 번호를 지정할 수 있습니다. 지정하지 않으면 clock 0이 기본값입니다. `reg`는 최대 한 항목입니다.

필수 속성은 `compatible`, `clocks`, `clock-names`, `interrupts`, `reg`입니다.

Exynos5433·AutoV9 세 clock 조건

86-108

공통 `spi-controller.yaml#`을 상속합니다. Compatible에 `samsung,exynos5433-spi` 또는 `samsung,exynosautov9-spi`가 포함되면 `clocks`는 정확히 세 항목입니다.

이 두 controller의 `clock-names`는 첫째 `spi`, 둘째 `spi_busclk0`·`spi_busclk1`·`spi_busclk2`·`spi_busclk3` 중 하나, 셋째 `spi_ioclk` 순서입니다.

그 밖의 SoC 두 clock 조건

109-124

위 두 compatible이 아니면 `clocks`는 정확히 두 항목입니다. `clock-names`는 첫째 `spi`, 둘째 `spi_busclk0`·`spi_busclk1`·`spi_busclk2`·`spi_busclk3` 중 하나입니다.

`unevaluatedProperties: false`로 이 schema와 공통 SPI schema에서 평가되지 않은 추가 속성을 금지합니다.

Exynos5433 SPI와 WM5110 codec 예제

125-194

예제의 `spi@14d30000`은 `samsung,exynos5433-spi`, GIC SPI 433, PDMA0의 TX/RX channel 11·10과 `spi`, `spi_busclk0`, `spi_ioclk` 세 clock을 사용합니다. Source clock은 0이고 chip select 하나를 GPIO active-high로 구동합니다.

Chip select 0의 `wlf,wm5110` audio codec은 최대 20MHz, 두 clock, GPIO·interrupt controller 기능, microphone detection과 headphone 설정, reset·LDO enable GPIO 및 core supply들을 지정합니다. `controller-data`의 `samsung,spi-feedback-delay`는 0입니다.

#include <dt-bindings/clock/exynos5433.h>
#include <dt-bindings/clock/samsung,s2mps11.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/gpio/gpio.h>

spi@14d30000 {
    compatible = "samsung,exynos5433-spi";
    reg = <0x14d30000 0x100>;
    interrupts = <GIC_SPI 433 IRQ_TYPE_LEVEL_HIGH>;
    dmas = <&pdma0 11>, <&pdma0 10>;
    dma-names = "tx", "rx";
    #address-cells = <1>;
    #size-cells = <0>;
    clocks = <&cmu_peric CLK_PCLK_SPI1>,
             <&cmu_peric CLK_SCLK_SPI1>,
             <&cmu_peric CLK_SCLK_IOCLK_SPI1>;
    clock-names = "spi",
                  "spi_busclk0",
                  "spi_ioclk";
    samsung,spi-src-clk = <0>;
    pinctrl-names = "default";
    pinctrl-0 = <&spi1_bus>;
    num-cs = <1>;

    cs-gpios = <&gpd6 3 GPIO_ACTIVE_HIGH>;

    audio-codec@0 {
        compatible = "wlf,wm5110";
        reg = <0x0>;
        spi-max-frequency = <20000000>;
        interrupt-parent = <&gpa0>;
        interrupts = <4 IRQ_TYPE_NONE>;
        clocks = <&pmu_system_controller 0>,
                 <&s2mps13_osc S2MPS11_CLK_BT>;
        clock-names = "mclk1", "mclk2";

        gpio-controller;
        #gpio-cells = <2>;
        interrupt-controller;
        #interrupt-cells = <2>;

        wlf,micd-detect-debounce = <300>;
        wlf,micd-bias-start-time = <0x1>;
        wlf,micd-rate = <0x7>;
        wlf,micd-dbtime = <0x2>;
        wlf,micd-force-micbias;
        wlf,micd-configs = <0x0 1 0>;
        wlf,hpdet-channel = <1>;
        wlf,gpsw = <0x1>;
        wlf,inmode = <2 0 2 0>;

        wlf,reset = <&gpc0 7 GPIO_ACTIVE_HIGH>;
        wlf,ldoena = <&gpf0 0 GPIO_ACTIVE_HIGH>;

        /* core supplies */
        AVDD-supply = <&ldo18_reg>;
        DBVDD1-supply = <&ldo18_reg>;
        CPVDD-supply = <&ldo18_reg>;
        DBVDD2-supply = <&ldo18_reg>;
        DBVDD3-supply = <&ldo18_reg>;
        SPKVDDL-supply = <&ldo18_reg>;
        SPKVDDR-supply = <&ldo18_reg>;

        controller-data {
            samsung,spi-feedback-delay = <0>;
        };
    };
};