요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Davinci SPI controller device bindings
Links on DM:
Keystone 2 - https://www.ti.com/lit/ug/sprugp2a/sprugp2a.pdf
dm644x - https://www.ti.com/lit/ug/sprue32a/sprue32a.pdf
OMAP-L138/da830 - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
Required properties:
- #address-cells: number of cells required to define a chip select
address on the SPI bus. Should be set to 1.
- #size-cells: should be zero.
- compatible:
- "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
- "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
- "ti,keystone-spi" for SPI used similar to that on Keystone2 SoC
family
- reg: Offset and length of SPI controller register space
- num-cs: Number of chip selects. This includes internal as well as
GPIO chip selects.
- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
IP to the interrupt controller within the SoC. Possible values
are 0 and 1. Manual says one of the two possible interrupt
lines can be tied to the interrupt controller. Set this
based on a specific SoC configuration.
- interrupts: interrupt number mapped to CPU.
- clocks: spi clk phandle
For 66AK2G this property should be set per binding,
Documentation/devicetree/bindings/clock/ti,sci-clk.yaml
SoC-specific Required Properties:
The following are mandatory properties for Keystone 2 66AK2G SoCs only:
- power-domains: Should contain a phandle to a PM domain provider node
and an args specifier containing the SPI device id
value. This property is as per the binding,
Optional:
- cs-gpios: gpio chip selects
For example to have 3 internal CS and 2 GPIO CS, user could define
cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>;
where first three are internal CS and last two are GPIO CS.
Optional properties for slave devices:
SPI slave nodes can contain the following properties.
Not all SPI Peripherals from Texas Instruments support this.
Please check SPI peripheral documentation for a device before using these.
- ti,spi-wdelay : delay between transmission of words
(SPIFMTn.WDELAY, SPIDAT1.WDEL) must be specified in number of SPI module
clock periods.
delay = WDELAY * SPI_module_clock_period + 2 * SPI_module_clock_period
Below is timing diagram which shows functional meaning of
"ti,spi-wdelay" parameter.
+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+
SPI_CLK | | | | | | | | | | | | | | | |
+----------+ +-+ +-+ +-+ +-+ +---------------------------+ +-+ +-+ +-
SPI_SOMI/SIMO+-----------------+ +-----------
+----------+ word1 +---------------------------+word2
+-----------------+ +-----------
WDELAY
<-------------------------->
Example of a NOR flash slave device (n25q032) connected to DaVinci
SPI controller device over the SPI bus.
spi0:spi@20bf0000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "ti,dm6446-spi";
reg = <0x20BF0000 0x1000>;
num-cs = <4>;
ti,davinci-spi-intr-line = <0>;
interrupts = <338>;
clocks = <&clkspi>;
flash: flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "st,m25p32";
spi-max-frequency = <25000000>;
reg = <0>;
ti,spi-wdelay = <8>;
partition@0 {
label = "u-boot-spl";
reg = <0x0 0x80000>;
read-only;
};
partition@1 {
label = "test";
reg = <0x80000 0x380000>;
};
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
DaVinci SPI binding과 reference manual
1-7이 문서는 DaVinci SPI controller device binding을 설명합니다. Reference manual link는 Keystone 2의 `sprugp2a.pdf`, DM644x의 `sprue32a.pdf`, OMAP-L138/DA830의 `spruh77a.pdf`입니다.
공통 필수 속성
8-29`#address-cells`는 SPI bus의 chip-select 주소를 정의하는 cell 수이며 1이어야 하고 `#size-cells`는 0이어야 합니다. Compatible은 DM644x 계열용 `ti,dm6441-spi`, DA8xx 계열용 `ti,da830-spi`, Keystone2 계열용 `ti,keystone-spi` 중 하나입니다.
`reg`는 SPI controller register 공간의 offset과 length입니다. `num-cs`는 internal 및 GPIO chip-select를 모두 포함한 개수입니다. `ti,davinci-spi-intr-line`은 SoC 내부에서 SPI IP를 interrupt controller에 연결하는 line으로 0 또는 1이며 SoC별 실제 wiring에 맞춰야 합니다.
`interrupts`는 CPU에 mapping된 interrupt 번호이고 `clocks`는 SPI clock phandle입니다. 66AK2G에서는 `Documentation/devicetree/bindings/clock/ti,sci-clk.yaml` binding에 따라 clock을 지정합니다.
66AK2G power-domain 요구사항
30-37Keystone 2 66AK2G SoC에서만 `power-domains`가 필수입니다. PM domain provider node의 phandle과 SPI device ID 값을 담는 argument specifier를 포함해야 합니다.
Internal·GPIO chip-select 혼합
38-43선택 속성 `cs-gpios`는 GPIO chip-select를 지정합니다. Internal CS 3개와 GPIO CS 2개를 사용하려면 `cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>;`처럼 앞의 세 항목을 internal CS placeholder로 두고 마지막 두 항목을 GPIO로 지정합니다.
Peripheral word delay 공식
44-54TI SPI peripheral이 모두 지원하는 기능은 아니므로 사용 전에 장치 문서를 확인해야 합니다. Slave 속성 `ti,spi-wdelay`는 word 전송 사이 지연을 SPI module clock period 수로 지정하며 `SPIFMTn.WDELAY`와 `SPIDAT1.WDEL`에 대응합니다.
실제 delay 공식은 `delay = WDELAY * SPI_module_clock_period + 2 * SPI_module_clock_period`입니다.
WDELAY timing 구조
55-67원문 timing diagram은 첫 word의 clock pulse가 끝난 뒤 WDELAY 구간을 두고 둘째 word의 clock pulse와 data가 시작되는 관계를 보여 줍니다.
SPI_CLK와 SPI_SOMI/SIMO가 word 사이 WDELAY 동안 멈추는 구조입니다.
DaVinci SPI NOR와 partition 예제
68-100예제의 `spi0:spi@20bf0000`은 `ti,dm6446-spi`, chip-select 4개, interrupt line 0, CPU interrupt 338과 `clkspi`를 사용합니다. Chip select 0의 `st,m25p32` NOR는 최대 25MHz와 `ti,spi-wdelay = <8>`을 사용하며 read-only `u-boot-spl`과 `test` partition을 정의합니다.
spi0:spi@20bf0000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "ti,dm6446-spi";
reg = <0x20BF0000 0x1000>;
num-cs = <4>;
ti,davinci-spi-intr-line = <0>;
interrupts = <338>;
clocks = <&clkspi>;
flash: flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "st,m25p32";
spi-max-frequency = <25000000>;
reg = <0>;
ti,spi-wdelay = <8>;
partition@0 {
label = "u-boot-spl";
reg = <0x0 0x80000>;
read-only;
};
partition@1 {
label = "test";
reg = <0x80000 0x380000>;
};
};
};
요약과 해설
spi-davinci.txt:1-100DaVinci SPI의 interrupt line, internal/GPIO CS와 peripheral word-delay timing을 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·symbol·source path·timing·수치·예제 코드를 원형대로 유지합니다.