← Documents Documentation/devicetree/bindings/spi/mediatek,spi-mtk-snfi.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / SPI

MediaTek SPI-NAND flash controller

MediaTek SPI-NAND controller의 ECC engine과 SoC별 clock 조건을 설명합니다.

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

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

1. 요약·해설

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

요약과 해설

mediatek,spi-mtk-snfi.yaml:1-124

MediaTek SPI-NAND controller의 ECC engine과 SoC별 clock 조건을 설명합니다. 접을 수 있는 영어 원문 전체와 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·clock 순서·수치·예제 코드를 원형대로 유지합니다.

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/spi/mediatek,spi-mtk-snfi.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: SPI-NAND flash controller for MediaTek ARM SoCs
8
9 maintainers:
10 - Chuanhong Guo <gch981213@gmail.com>
11
12 description: |
13 The Mediatek SPI-NAND flash controller is an extended version of
14 the Mediatek NAND flash controller. It can perform standard SPI
15 instructions with one continuous write and one read for up-to 0xa0
16 bytes. It also supports typical SPI-NAND page cache operations
17 in single, dual or quad IO mode with pipelined ECC encoding/decoding
18 using the accompanying ECC engine. There should be only one spi
19 slave device following generic spi bindings.
20
21 properties:
22 compatible:
23 enum:
24 - mediatek,mt7622-snand
25 - mediatek,mt7629-snand
26 - mediatek,mt7986-snand
27
28 reg:
29 items:
30 - description: core registers
31
32 interrupts:
33 items:
34 - description: NFI interrupt
35
36 clocks:
37 minItems: 2
38 maxItems: 3
39
40 clock-names:
41 minItems: 2
42 maxItems: 3
43
44 nand-ecc-engine:
45 description: device-tree node of the accompanying ECC engine.
46 $ref: /schemas/types.yaml#/definitions/phandle
47
48 mediatek,rx-latch-latency-ns:
49 description: Data read latch latency, unit is nanoseconds.
50
51 required:
52 - compatible
53 - reg
54 - interrupts
55 - clocks
56 - clock-names
57 - nand-ecc-engine
58
59 allOf:
60 - $ref: /schemas/spi/spi-controller.yaml#
61 - if:
62 properties:
63 compatible:
64 enum:
65 - mediatek,mt7622-snand
66 - mediatek,mt7629-snand
67 then:
68 properties:
69 clocks:
70 items:
71 - description: clock used for the controller
72 - description: clock used for the SPI bus
73 clock-names:
74 items:
75 - const: nfi_clk
76 - const: pad_clk
77
78 - if:
79 properties:
80 compatible:
81 enum:
82 - mediatek,mt7986-snand
83 then:
84 properties:
85 clocks:
86 items:
87 - description: clock used for the controller
88 - description: clock used for the SPI bus
89 - description: clock used for the AHB bus
90 clock-names:
91 items:
92 - const: nfi_clk
93 - const: pad_clk
94 - const: nfi_hclk
95
96 unevaluatedProperties: false
97
98 examples:
99 - |
100 #include <dt-bindings/interrupt-controller/irq.h>
101 #include <dt-bindings/interrupt-controller/arm-gic.h>
102 #include <dt-bindings/clock/mt7622-clk.h>
103 soc {
104 #address-cells = <2>;
105 #size-cells = <2>;
106 snfi: spi@1100d000 {
107 compatible = "mediatek,mt7622-snand";
108 reg = <0 0x1100d000 0 0x1000>;
109 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
110 clocks = <&pericfg CLK_PERI_NFI_PD>, <&pericfg CLK_PERI_SNFI_PD>;
111 clock-names = "nfi_clk", "pad_clk";
112 nand-ecc-engine = <&bch>;
113 #address-cells = <1>;
114 #size-cells = <0>;
115
116 flash@0 {
117 compatible = "spi-nand";
118 reg = <0>;
119 spi-tx-bus-width = <4>;
120 spi-rx-bus-width = <4>;
121 nand-ecc-engine = <&snfi>;
122 };
123 };
124 };
125

3. 한국어 전문 번역

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

MediaTek SPI-NAND controller

1-20

이 GPL-2.0-only 또는 BSD-2-Clause YAML schema는 MediaTek ARM SoC의 SPI-NAND flash controller를 정의합니다. Maintainer는 Chuanhong Guo이고 schema ID는 `http://devicetree.org/schemas/spi/mediatek,spi-mtk-snfi.yaml#`입니다.

이 controller는 MediaTek NAND flash controller의 확장형입니다. 최대 `0xa0` byte를 대상으로 한 번의 연속 write와 한 번의 read로 표준 SPI instruction을 수행할 수 있습니다.

함께 제공되는 ECC engine의 pipelined encoding/decoding을 사용해 single, dual, quad I/O mode의 일반적인 SPI-NAND page-cache operation도 지원합니다. Generic SPI binding을 따르는 slave는 하나만 있어야 합니다.

Compatible, resource와 ECC

21-50

허용 compatible은 `mediatek,mt7622-snand`, `mediatek,mt7629-snand`, `mediatek,mt7986-snand`입니다. `reg`의 단일 항목은 core register이고 `interrupts`의 단일 항목은 NFI interrupt입니다.

`clocks`와 `clock-names`는 각각 2~3개입니다. `nand-ecc-engine`은 함께 사용하는 ECC engine node의 phandle이고 필수 속성입니다. `mediatek,rx-latch-latency-ns`는 data read latch latency를 nanosecond 단위로 지정합니다.

필수 속성

51-58

필수 속성은 `compatible`, `reg`, `interrupts`, `clocks`, `clock-names`, `nand-ecc-engine`입니다.

MT7622와 MT7629 clock 조건

59-77

Schema는 `/schemas/spi/spi-controller.yaml#`을 상속합니다. MT7622와 MT7629는 controller clock과 SPI bus clock 두 개를 사용하며 이름은 순서대로 `nfi_clk`, `pad_clk`여야 합니다.

MT7986 clock 조건과 schema 제한

78-96

MT7986은 controller, SPI bus, AHB bus clock 세 개를 사용하며 이름은 순서대로 `nfi_clk`, `pad_clk`, `nfi_hclk`입니다. `unevaluatedProperties: false`로 평가되지 않은 추가 속성을 금지합니다.

MT7622 SPI-NAND 예제

97-124

예제는 MT7622 SNFI에 NFI interrupt, `nfi_clk`와 `pad_clk`, BCH ECC engine을 연결합니다. Chip-select 0의 `spi-nand` flash는 TX/RX bus width를 4로 설정하고 controller 자체를 NAND ECC engine으로 참조합니다.

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mt7622-clk.h>
soc {
  #address-cells = <2>;
  #size-cells = <2>;
  snfi: spi@1100d000 {
    compatible = "mediatek,mt7622-snand";
    reg = <0 0x1100d000 0 0x1000>;
    interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
    clocks = <&pericfg CLK_PERI_NFI_PD>, <&pericfg CLK_PERI_SNFI_PD>;
    clock-names = "nfi_clk", "pad_clk";
    nand-ecc-engine = <&bch>;
    #address-cells = <1>;
    #size-cells = <0>;

    flash@0 {
      compatible = "spi-nand";
      reg = <0>;
      spi-tx-bus-width = <4>;
      spi-rx-bus-width = <4>;
      nand-ecc-engine = <&snfi>;
    };
  };
};