요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/fsl,sai.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Freescale Synchronous Audio Interface (SAI).
maintainers:
- Shengjiu Wang <[email protected]>
description: |
The SAI is based on I2S module that used communicating with audio codecs,
which provides a synchronous audio interface that supports fullduplex
serial interfaces with frame synchronization such as I2S, AC97, TDM, and
codec/DSP interfaces.
properties:
compatible:
oneOf:
- items:
- enum:
- fsl,imx6ul-sai
- fsl,imx7d-sai
- const: fsl,imx6sx-sai
- items:
- enum:
- fsl,imx8mm-sai
- fsl,imx8mn-sai
- fsl,imx8mp-sai
- const: fsl,imx8mq-sai
- items:
- enum:
- fsl,imx6sx-sai
- fsl,imx7ulp-sai
- fsl,imx8mq-sai
- fsl,imx8qm-sai
- fsl,imx8ulp-sai
- fsl,imx93-sai
- fsl,imx95-sai
- fsl,vf610-sai
- items:
- enum:
- fsl,imx94-sai
- const: fsl,imx95-sai
reg:
maxItems: 1
clocks:
items:
- description: The ipg clock for register access
- description: master clock source 0 (obsoleted)
- description: master clock source 1
- description: master clock source 2
- description: master clock source 3
- description: PLL clock source for 8kHz series
- description: PLL clock source for 11kHz series
minItems: 4
clock-names:
oneOf:
- items:
- const: bus
- const: mclk0
- const: mclk1
- const: mclk2
- const: mclk3
- const: pll8k
- const: pll11k
minItems: 5
- items:
- const: bus
- const: mclk1
- const: mclk2
- const: mclk3
- const: pll8k
- const: pll11k
minItems: 4
power-domains:
maxItems: 1
dmas:
minItems: 1
maxItems: 2
dma-names:
minItems: 1
items:
- enum: [ rx, tx ]
- const: tx
interrupts:
items:
- description: receive and transmit interrupt
ports:
$ref: /schemas/graph.yaml#/properties/ports
properties:
port@0:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: port for TX and RX
port@1:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: port for TX only
port@2:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: port for RX only
big-endian:
description: |
required if all the SAI registers are big-endian rather than little-endian.
type: boolean
fsl,dataline:
$ref: /schemas/types.yaml#/definitions/uint32-matrix
description: |
Configure the dataline. It has 3 value for each configuration
maxItems: 16
items:
items:
- description: format Default(0), I2S(1) or PDM(2)
enum: [0, 1, 2]
- description: dataline mask for 'rx'
- description: dataline mask for 'tx'
fsl,sai-mclk-direction-output:
description: SAI will output the SAI MCLK clock.
type: boolean
fsl,sai-synchronous-rx:
description: |
SAI will work in the synchronous mode (sync Tx with Rx) which means
both the transmitter and the receiver will send and receive data by
following receiver's bit clocks and frame sync clocks.
type: boolean
fsl,sai-asynchronous:
description: |
SAI will work in the asynchronous mode, which means both transmitter
and receiver will send and receive data by following their own bit clocks
and frame sync clocks separately.
If both fsl,sai-asynchronous and fsl,sai-synchronous-rx are absent, the
default synchronous mode (sync Rx with Tx) will be used, which means both
transmitter and receiver will send and receive data by following clocks
of transmitter.
type: boolean
fsl,shared-interrupt:
description: Interrupt is shared with other modules.
type: boolean
lsb-first:
description: |
Configures whether the LSB or the MSB is transmitted
first for the fifo data. If this property is absent,
the MSB is transmitted first as default, or the LSB
is transmitted first.
type: boolean
"#sound-dai-cells":
const: 0
description: optional, some dts node didn't add it.
allOf:
- $ref: dai-common.yaml#
- if:
required:
- fsl,sai-asynchronous
then:
properties:
fsl,sai-synchronous-rx: false
required:
- compatible
- reg
- clocks
- clock-names
- dmas
- dma-names
- interrupts
unevaluatedProperties: false
examples:
- |
#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;
};
- |
#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>;
};
};
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Freescale Synchronous Audio Interface
1-17SAI는 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-51i.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-192Binding은 `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>;
};
};
};
};
요약과 해설
fsl,sai.yaml:1-262NXP/Freescale RPMSG virtual audio와 SAI/SAIF serial interface의 clock, DMA, signal direction과 graph 연결을 먼저 해설하고, 접을 수 있는 영어 원문 전체와 원문 줄 좌표를 보존한 한국어 전문 번역을 제공합니다.