요약·해설과 원문, 전문 번역을 서로 분리했습니다. 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/spi/st,stm32-spi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: STMicroelectronics STM32 SPI Controller
description: |
The STM32 SPI controller is used to communicate with external devices using
the Serial Peripheral Interface. It supports full-duplex, half-duplex and
simplex synchronous serial communication with external devices. It supports
from 4 to 32-bit data size.
maintainers:
- Erwan Leray <erwan.leray@foss.st.com>
- Fabrice Gasnier <fabrice.gasnier@foss.st.com>
allOf:
- $ref: spi-controller.yaml#
- if:
properties:
compatible:
contains:
const: st,stm32f4-spi
then:
properties:
st,spi-midi-ns: false
sram: false
dmas:
maxItems: 2
dma-names:
items:
- const: rx
- const: tx
- if:
properties:
compatible:
contains:
const: st,stm32mp25-spi
then:
properties:
sram: false
dmas:
maxItems: 2
dma-names:
items:
- const: rx
- const: tx
properties:
compatible:
enum:
- st,stm32f4-spi
- st,stm32f7-spi
- st,stm32h7-spi
- st,stm32mp25-spi
reg:
maxItems: 1
clocks:
maxItems: 1
interrupts:
maxItems: 1
resets:
maxItems: 1
dmas:
description: |
DMA specifiers for tx and rx channels. DMA fifo mode must be used. See
the STM32 DMA bindings Documentation/devicetree/bindings/dma/stm32/st,*dma.yaml
minItems: 2
items:
- description: rx DMA channel
- description: tx DMA channel
- description: rxm2m MDMA channel
dma-names:
minItems: 2
items:
- const: rx
- const: tx
- const: rxm2m
sram:
$ref: /schemas/types.yaml#/definitions/phandle
description: |
Phandles to a reserved SRAM region which is used as temporary
storage memory between DMA and MDMA engines.
The region should be defined as child node of the AHB SRAM node
as per the generic bindings in Documentation/devicetree/bindings/sram/sram.yaml
access-controllers:
minItems: 1
maxItems: 2
required:
- compatible
- reg
- clocks
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/reset/stm32mp1-resets.h>
spi@4000b000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "st,stm32h7-spi";
reg = <0x4000b000 0x400>;
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc SPI2_K>;
resets = <&rcc SPI2_R>;
dmas = <&dmamux1 0 39 0x400 0x05>,
<&dmamux1 1 40 0x400 0x05>;
dma-names = "rx", "tx";
cs-gpios = <&gpioa 11 0>;
};
...
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
STM32 SPI controller 개요
1-18이 GPL-2.0-only 또는 BSD-2-Clause YAML schema는 external device와 Serial Peripheral Interface로 통신하는 STMicroelectronics STM32 SPI controller를 정의합니다. Full-duplex, half-duplex, simplex synchronous serial communication과 4~32-bit data size를 지원합니다. Maintainer는 Erwan Leray와 Fabrice Gasnier입니다.
STM32F4·STM32MP25별 DMA 제약
19-53공통 `spi-controller.yaml#`을 상속합니다. Compatible에 `st,stm32f4-spi`가 포함되면 deprecated `st,spi-midi-ns`와 `sram`을 허용하지 않고 `dmas`는 최대 두 항목, `dma-names`는 `rx`, `tx` 순서로 제한합니다.
Compatible에 `st,stm32mp25-spi`가 포함된 경우에도 `sram`을 허용하지 않으며 `dmas`는 최대 두 항목, `dma-names`는 `rx`, `tx` 순서입니다.
Compatible과 기본 controller 자원
54-73Compatible은 `st,stm32f4-spi`, `st,stm32f7-spi`, `st,stm32h7-spi`, `st,stm32mp25-spi` 중 하나입니다. `reg`, `clocks`, `interrupts`, `resets`는 각각 최대 한 항목입니다.
DMA FIFO mode, MDMA와 reserved SRAM
74-102`dmas`는 최소 두 항목이며 RX DMA, TX DMA, 선택적인 `rxm2m` MDMA channel 순서입니다. DMA FIFO mode를 사용해야 하고 STM32 DMA binding `Documentation/devicetree/bindings/dma/stm32/st,*dma.yaml`을 따릅니다. `dma-names`도 `rx`, `tx`, 선택적인 `rxm2m` 순서입니다.
`sram`은 DMA와 MDMA engine 사이의 임시 storage memory로 사용할 reserved SRAM region의 phandle입니다. 이 region은 `Documentation/devicetree/bindings/sram/sram.yaml`의 generic binding에 따라 AHB SRAM node의 child node로 정의해야 합니다. `access-controllers`는 1~2개 항목입니다.
필수 속성과 추가 속성 제한
103-110필수 속성은 `compatible`, `reg`, `clocks`, `interrupts`입니다. `unevaluatedProperties: false`로 평가되지 않은 추가 속성을 금지합니다.
STM32H7 SPI2 DMA 예제
111-130예제의 `spi@4000b000`은 `st,stm32h7-spi`, GIC SPI 36, `SPI2_K` clock과 `SPI2_R` reset을 사용합니다. DMAMUX1 request 39·40을 RX·TX에 연결하고 GPIOA 11을 chip select로 사용합니다.
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/reset/stm32mp1-resets.h>
spi@4000b000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "st,stm32h7-spi";
reg = <0x4000b000 0x400>;
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc SPI2_K>;
resets = <&rcc SPI2_R>;
dmas = <&dmamux1 0 39 0x400 0x05>,
<&dmamux1 1 40 0x400 0x05>;
dma-names = "rx", "tx";
cs-gpios = <&gpioa 11 0>;
};
...
요약과 해설
st,stm32-spi.yaml:1-130STM32 SPI의 compatible별 DMA·SRAM 제약과 MDMA 임시 storage 구성을 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·symbol·source path·수치·예제 코드를 원형대로 유지합니다.