← Documents Documentation/devicetree/bindings/spi/spi-gpio.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / SPI

GPIO bit-banged SPI controller

SPI-GPIO의 SCK·MISO·MOSI·CS line과 chip-select 없는 단일 장치 구성을 설명합니다.

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

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

1. 요약·해설

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

요약과 해설

spi-gpio.yaml:1-74

SPI-GPIO의 SCK·MISO·MOSI·CS line과 chip-select 없는 단일 장치 구성을 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·symbol·source path·timing·수치·예제 코드를 원형대로 유지합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/spi/spi-gpio.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: SPI-GPIO
8
9 maintainers:
10 - Rob Herring <robh@kernel.org>
11
12 description:
13 This represents a group of 3-n GPIO lines used for bit-banged SPI on
14 dedicated GPIO lines.
15
16 allOf:
17 - $ref: /schemas/spi/spi-controller.yaml#
18
19 properties:
20 compatible:
21 const: spi-gpio
22
23 sck-gpios:
24 description: GPIO spec for the SCK line to use
25 maxItems: 1
26
27 miso-gpios:
28 description: GPIO spec for the MISO line to use
29 maxItems: 1
30
31 mosi-gpios:
32 description: GPIO spec for the MOSI line to use
33 maxItems: 1
34
35 cs-gpios:
36 description: GPIOs to use for chipselect lines.
37 Not needed if num-chipselects = <0>.
38 minItems: 1
39 maxItems: 1024
40
41 num-chipselects:
42 description: Number of chipselect lines. Should be <0> if a single device
43 with no chip select is connected.
44 $ref: /schemas/types.yaml#/definitions/uint32
45
46 # Deprecated properties
47 gpio-sck: false
48 gpio-miso: false
49 gpio-mosi: false
50
51 required:
52 - compatible
53 - num-chipselects
54 - sck-gpios
55
56 unevaluatedProperties: false
57
58 examples:
59 - |
60 spi {
61 compatible = "spi-gpio";
62 #address-cells = <0x1>;
63 #size-cells = <0x0>;
64
65 sck-gpios = <&gpio 95 0>;
66 miso-gpios = <&gpio 98 0>;
67 mosi-gpios = <&gpio 97 0>;
68 cs-gpios = <&gpio 125 0>;
69 num-chipselects = <1>;
70
71 /* clients */
72 };
73
74 ...
75

3. 한국어 전문 번역

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

GPIO bit-banged SPI schema

1-18

이 GPL-2.0 YAML schema는 SPI-GPIO를 정의합니다. Dedicated GPIO line에서 bit-banged SPI를 구현하는 3-n개의 GPIO group을 나타냅니다. Schema ID는 `http://devicetree.org/schemas/spi/spi-gpio.yaml#`, maintainer는 Rob Herring입니다.

공통 `/schemas/spi/spi-controller.yaml#` 속성을 상속합니다.

SCK, MISO, MOSI와 chip-select GPIO

19-45

`compatible`은 `spi-gpio`로 고정됩니다. `sck-gpios`, `miso-gpios`, `mosi-gpios`는 각각 해당 line의 GPIO spec이며 최대 한 항목입니다.

`cs-gpios`는 chip-select line용 GPIO로 1~1024개입니다. `num-chipselects = <0>`이면 chip select 없이 단일 장치가 연결된 경우이므로 `cs-gpios`가 필요하지 않습니다. `num-chipselects`는 chip-select line 수를 나타내는 `uint32`입니다.

Deprecated 속성과 필수 항목

46-57

Legacy `gpio-sck`, `gpio-miso`, `gpio-mosi` 속성은 deprecated되어 허용되지 않습니다. 필수 속성은 `compatible`, `num-chipselects`, `sck-gpios`입니다. `unevaluatedProperties: false`로 평가되지 않은 추가 속성을 금지합니다.

GPIO 4-wire SPI 예제

58-74

예제는 GPIO 95를 SCK, 98을 MISO, 97을 MOSI, 125를 chip-select로 사용하고 `num-chipselects = <1>`을 지정합니다. 마지막 `...`는 YAML document 종료 표기입니다.

spi {
  compatible = "spi-gpio";
  #address-cells = <0x1>;
  #size-cells = <0x0>;

  sck-gpios = <&gpio 95 0>;
  miso-gpios = <&gpio 98 0>;
  mosi-gpios = <&gpio 97 0>;
  cs-gpios = <&gpio 125 0>;
  num-chipselects = <1>;

  /* clients */
};