← Documents Documentation/devicetree/bindings/sound/fsl,sai.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / Sound

Freescale Synchronous Audio Interface

SAI clock·DMA·dataline, 동기·비동기 mode와 TX/RX audio graph port를 설명합니다.

Source pathDocumentation/devicetree/bindings/sound/fsl,sai.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

fsl,sai.yaml:1-262

NXP/Freescale RPMSG virtual audio와 SAI/SAIF serial interface의 clock, DMA, signal direction과 graph 연결을 먼저 해설하고, 접을 수 있는 영어 원문 전체와 원문 줄 좌표를 보존한 한국어 전문 번역을 제공합니다.

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/sound/fsl,sai.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Freescale Synchronous Audio Interface (SAI).
8
9 maintainers:
10 - Shengjiu Wang <[email protected]>
11
12 description: |
13 The SAI is based on I2S module that used communicating with audio codecs,
14 which provides a synchronous audio interface that supports fullduplex
15 serial interfaces with frame synchronization such as I2S, AC97, TDM, and
16 codec/DSP interfaces.
17
18 properties:
19 compatible:
20 oneOf:
21 - items:
22 - enum:
23 - fsl,imx6ul-sai
24 - fsl,imx7d-sai
25 - const: fsl,imx6sx-sai
26
27 - items:
28 - enum:
29 - fsl,imx8mm-sai
30 - fsl,imx8mn-sai
31 - fsl,imx8mp-sai
32 - const: fsl,imx8mq-sai
33
34 - items:
35 - enum:
36 - fsl,imx6sx-sai
37 - fsl,imx7ulp-sai
38 - fsl,imx8mq-sai
39 - fsl,imx8qm-sai
40 - fsl,imx8ulp-sai
41 - fsl,imx93-sai
42 - fsl,imx95-sai
43 - fsl,vf610-sai
44 - items:
45 - enum:
46 - fsl,imx94-sai
47 - const: fsl,imx95-sai
48
49 reg:
50 maxItems: 1
51
52 clocks:
53 items:
54 - description: The ipg clock for register access
55 - description: master clock source 0 (obsoleted)
56 - description: master clock source 1
57 - description: master clock source 2
58 - description: master clock source 3
59 - description: PLL clock source for 8kHz series
60 - description: PLL clock source for 11kHz series
61 minItems: 4
62
63 clock-names:
64 oneOf:
65 - items:
66 - const: bus
67 - const: mclk0
68 - const: mclk1
69 - const: mclk2
70 - const: mclk3
71 - const: pll8k
72 - const: pll11k
73 minItems: 5
74 - items:
75 - const: bus
76 - const: mclk1
77 - const: mclk2
78 - const: mclk3
79 - const: pll8k
80 - const: pll11k
81 minItems: 4
82
83 power-domains:
84 maxItems: 1
85
86 dmas:
87 minItems: 1
88 maxItems: 2
89
90 dma-names:
91 minItems: 1
92 items:
93 - enum: [ rx, tx ]
94 - const: tx
95
96 interrupts:
97 items:
98 - description: receive and transmit interrupt
99
100 ports:
101 $ref: /schemas/graph.yaml#/properties/ports
102 properties:
103 port@0:
104 $ref: audio-graph-port.yaml#
105 unevaluatedProperties: false
106 description: port for TX and RX
107
108 port@1:
109 $ref: audio-graph-port.yaml#
110 unevaluatedProperties: false
111 description: port for TX only
112
113 port@2:
114 $ref: audio-graph-port.yaml#
115 unevaluatedProperties: false
116 description: port for RX only
117
118 big-endian:
119 description: |
120 required if all the SAI registers are big-endian rather than little-endian.
121 type: boolean
122
123 fsl,dataline:
124 $ref: /schemas/types.yaml#/definitions/uint32-matrix
125 description: |
126 Configure the dataline. It has 3 value for each configuration
127 maxItems: 16
128 items:
129 items:
130 - description: format Default(0), I2S(1) or PDM(2)
131 enum: [0, 1, 2]
132 - description: dataline mask for 'rx'
133 - description: dataline mask for 'tx'
134
135 fsl,sai-mclk-direction-output:
136 description: SAI will output the SAI MCLK clock.
137 type: boolean
138
139 fsl,sai-synchronous-rx:
140 description: |
141 SAI will work in the synchronous mode (sync Tx with Rx) which means
142 both the transmitter and the receiver will send and receive data by
143 following receiver's bit clocks and frame sync clocks.
144 type: boolean
145
146 fsl,sai-asynchronous:
147 description: |
148 SAI will work in the asynchronous mode, which means both transmitter
149 and receiver will send and receive data by following their own bit clocks
150 and frame sync clocks separately.
151 If both fsl,sai-asynchronous and fsl,sai-synchronous-rx are absent, the
152 default synchronous mode (sync Rx with Tx) will be used, which means both
153 transmitter and receiver will send and receive data by following clocks
154 of transmitter.
155 type: boolean
156
157 fsl,shared-interrupt:
158 description: Interrupt is shared with other modules.
159 type: boolean
160
161 lsb-first:
162 description: |
163 Configures whether the LSB or the MSB is transmitted
164 first for the fifo data. If this property is absent,
165 the MSB is transmitted first as default, or the LSB
166 is transmitted first.
167 type: boolean
168
169 "#sound-dai-cells":
170 const: 0
171 description: optional, some dts node didn't add it.
172
173 allOf:
174 - $ref: dai-common.yaml#
175 - if:
176 required:
177 - fsl,sai-asynchronous
178 then:
179 properties:
180 fsl,sai-synchronous-rx: false
181
182 required:
183 - compatible
184 - reg
185 - clocks
186 - clock-names
187 - dmas
188 - dma-names
189 - interrupts
190
191 unevaluatedProperties: false
192
193 examples:
194 - |
195 #include <dt-bindings/interrupt-controller/arm-gic.h>
196 #include <dt-bindings/clock/vf610-clock.h>
197 sai2: sai@40031000 {
198 compatible = "fsl,vf610-sai";
199 reg = <0x40031000 0x1000>;
200 interrupts = <86 IRQ_TYPE_LEVEL_HIGH>;
201 pinctrl-names = "default";
202 pinctrl-0 = <&pinctrl_sai2_1>;
203 clocks = <&clks VF610_CLK_PLATFORM_BUS>,
204 <&clks VF610_CLK_SAI2>,
205 <&clks 0>, <&clks 0>;
206 clock-names = "bus", "mclk1", "mclk2", "mclk3";
207 dma-names = "rx", "tx";
208 dmas = <&edma0 0 20>, <&edma0 0 21>;
209 big-endian;
210 lsb-first;
211 };
212
213 - |
214 #include <dt-bindings/interrupt-controller/arm-gic.h>
215 #include <dt-bindings/clock/imx8mm-clock.h>
216 sai1: sai@30010000 {
217 compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
218 reg = <0x30010000 0x10000>;
219 interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
220 clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
221 <&clk IMX8MM_CLK_DUMMY>,
222 <&clk IMX8MM_CLK_SAI1_ROOT>,
223 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
224 clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
225 dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
226 dma-names = "rx", "tx";
227 fsl,dataline = <1 0xff 0xff 2 0xff 0x11>;
228 #sound-dai-cells = <0>;
229
230 ports {
231 #address-cells = <1>;
232 #size-cells = <0>;
233
234 port@1 {
235 reg = <1>;
236 playback-only;
237
238 sai1_endpoint0: endpoint {
239 dai-tdm-slot-num = <8>;
240 dai-tdm-slot-width = <32>;
241 dai-tdm-slot-width-map = <32 8 32>;
242 dai-format = "dsp_a";
243 bitclock-master;
244 frame-master;
245 remote-endpoint = <&mcodec01_ep>;
246 };
247 };
248
249 port@2 {
250 reg = <2>;
251 capture-only;
252
253 sai1_endpoint1: endpoint {
254 dai-tdm-slot-num = <8>;
255 dai-tdm-slot-width = <32>;
256 dai-tdm-slot-width-map = <32 8 32>;
257 dai-format = "dsp_a";
258 remote-endpoint = <&fe02_ep>;
259 };
260 };
261 };
262 };
263

3. 한국어 전문 번역

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

Freescale Synchronous Audio Interface

1-17

SAI는 audio codec과 통신하는 I2S module을 기반으로 하며 I2S, AC97, TDM, codec/DSP interface 같은 frame-synchronized full-duplex serial interface를 지원합니다. Schema ID는 `http://devicetree.org/schemas/sound/fsl,sai.yaml#`이며 maintainer는 Shengjiu Wang입니다.

SoC compatible fallback과 register

18-51

i.MX6UL·i.MX7D는 fallback `fsl,imx6sx-sai`, i.MX8MM·8MN·8MP는 fallback `fsl,imx8mq-sai`, `fsl,imx94-sai`는 fallback `fsl,imx95-sai`를 함께 사용합니다.

단일 compatible로는 `fsl,imx6sx-sai`, `fsl,imx7ulp-sai`, `fsl,imx8mq-sai`, `fsl,imx8qm-sai`, `fsl,imx8ulp-sai`, `fsl,imx93-sai`, `fsl,imx95-sai`, `fsl,vf610-sai`를 지원합니다. `reg`는 최대 한 항목입니다.

Bus, MCLK와 audio PLL clock

52-82

`clocks`는 register 접근용 IPG clock, obsolete master source 0, master source 1·2·3, 8 kHz 계열 PLL source, 11 kHz 계열 PLL source 순서이며 최소 4개입니다.

`clock-names`는 `bus`, `mclk0`, `mclk1`, `mclk2`, `mclk3`, `pll8k`, `pll11k` 순서로 최소 5개를 쓰거나, obsolete `mclk0`을 빼고 `bus`, `mclk1`, `mclk2`, `mclk3`, `pll8k`, `pll11k` 순서로 최소 4개를 씁니다.

Power domain, RX/TX DMA와 interrupt

83-99

`power-domains`는 최대 한 항목입니다. `dmas`는 1~2개이며 `dma-names`의 첫 항목은 `rx` 또는 `tx`, 두 번째 항목이 있으면 `tx`입니다. `interrupts`는 receive와 transmit이 공유하는 interrupt 한 항목입니다.

TX/RX graph port와 endian

100-122

`ports`는 graph schema를 따릅니다. `port@0`은 TX와 RX 공용, `port@1`은 TX 전용, `port@2`는 RX 전용이며 각각 `audio-graph-port.yaml#`을 참조하고 평가되지 않은 추가 속성을 허용하지 않습니다.

모든 SAI register가 little-endian이 아니라 big-endian이면 `big-endian` flag가 필요합니다.

Dataline, MCLK 방향과 동기 mode

123-172

`fsl,dataline`은 최대 16개 configuration을 갖는 `uint32-matrix`입니다. 각 configuration은 format Default(0), I2S(1), PDM(2) 중 하나와 RX dataline mask, TX dataline mask의 세 값으로 구성됩니다.

`fsl,sai-mclk-direction-output`은 SAI가 MCLK를 출력하도록 합니다. `fsl,sai-synchronous-rx`는 transmitter와 receiver가 receiver의 bit clock과 frame sync를 따르는 sync Tx with Rx mode를 선택합니다.

`fsl,sai-asynchronous`은 TX와 RX가 각자의 bit/frame sync clock을 따르게 합니다. 두 flag가 모두 없으면 기본 sync Rx with Tx mode로 transmitter clock을 함께 따릅니다. `fsl,shared-interrupt`는 interrupt 공유를 표시합니다.

`lsb-first`가 없으면 FIFO data는 기본 MSB-first, 있으면 LSB-first로 전송됩니다. 선택적 `#sound-dai-cells`는 0입니다.

상호배타 mode와 필수 속성

173-192

Binding은 `dai-common.yaml#`을 상속합니다. `fsl,sai-asynchronous`이 있으면 `fsl,sai-synchronous-rx`는 금지되어 두 mode가 동시에 설정되지 않습니다.

필수 속성은 `compatible`, `reg`, `clocks`, `clock-names`, `dmas`, `dma-names`, `interrupts`이며 평가되지 않은 추가 속성은 허용하지 않습니다.

VF610 SAI2 예제

193-212

첫 예제는 `0x40031000`의 VF610 SAI2에 platform bus와 SAI2 clock, RX/TX eDMA를 연결하고 big-endian register와 LSB-first FIFO 전송을 사용합니다.

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/vf610-clock.h>
sai2: sai@40031000 {
    compatible = "fsl,vf610-sai";
    reg = <0x40031000 0x1000>;
    interrupts = <86 IRQ_TYPE_LEVEL_HIGH>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_sai2_1>;
    clocks = <&clks VF610_CLK_PLATFORM_BUS>,
             <&clks VF610_CLK_SAI2>,
             <&clks 0>, <&clks 0>;
    clock-names = "bus", "mclk1", "mclk2", "mclk3";
    dma-names = "rx", "tx";
    dmas = <&edma0 0 20>, <&edma0 0 21>;
    big-endian;
    lsb-first;
};

i.MX8MM SAI1 graph와 TDM 예제

213-262

두 번째 예제는 i.MX8MM SAI1에 bus·MCLK clock과 RX/TX SDMA를 연결하고 I2S/PDM dataline matrix를 지정합니다. `port@1` playback endpoint는 8개의 32-bit slot, `dsp_a`, bit/frame master로 `mcodec01_ep`에 연결됩니다. `port@2` capture endpoint는 같은 slot 구성을 사용해 `fe02_ep`에 연결됩니다.

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/imx8mm-clock.h>
sai1: sai@30010000 {
    compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
    reg = <0x30010000 0x10000>;
    interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
             <&clk IMX8MM_CLK_DUMMY>,
             <&clk IMX8MM_CLK_SAI1_ROOT>,
             <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
    clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
    dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
    dma-names = "rx", "tx";
    fsl,dataline = <1 0xff 0xff 2 0xff 0x11>;
    #sound-dai-cells = <0>;

    ports {
        #address-cells = <1>;
        #size-cells = <0>;

        port@1 {
            reg = <1>;
            playback-only;

            sai1_endpoint0: endpoint {
               dai-tdm-slot-num = <8>;
               dai-tdm-slot-width = <32>;
               dai-tdm-slot-width-map = <32 8 32>;
               dai-format = "dsp_a";
               bitclock-master;
               frame-master;
               remote-endpoint = <&mcodec01_ep>;
            };
        };

        port@2 {
            reg = <2>;
            capture-only;

            sai1_endpoint1: endpoint {
                dai-tdm-slot-num = <8>;
                dai-tdm-slot-width = <32>;
                dai-tdm-slot-width-map = <32 8 32>;
                dai-format = "dsp_a";
                remote-endpoint = <&fe02_ep>;
            };
        };
    };
};