← Documents Documentation/devicetree/bindings/mtd/fsmc-nand.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

ST FSMC NAND Interface

ST FSMC의 네 register window, 6-byte timing과 ECC 바인딩입니다.

Source pathDocumentation/devicetree/bindings/mtd/fsmc-nand.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

fsmc-nand.txt:1-60

TCLR부터 TSET까지 timing byte와 SPEAr600 예제를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ST Microelectronics Flexible Static Memory Controller (FSMC)
2 NAND Interface
3
4 Required properties:
5 - compatible : "st,spear600-fsmc-nand", "stericsson,fsmc-nand"
6 - reg : Address range of the mtd chip
7 - reg-names: Should contain the reg names "fsmc_regs", "nand_data", "nand_addr" and "nand_cmd"
8
9 Optional properties:
10 - bank-width : Width (in bytes) of the device. If not present, the width
11 defaults to 1 byte
12 - nand-skip-bbtscan: Indicates the BBT scanning should be skipped
13 - timings: array of 6 bytes for NAND timings. The meanings of these bytes
14 are:
15 byte 0 TCLR : CLE to RE delay in number of AHB clock cycles, only 4 bits
16 are valid. Zero means one clockcycle, 15 means 16 clock
17 cycles.
18 byte 1 TAR : ALE to RE delay, 4 bits are valid. Same format as TCLR.
19 byte 2 THIZ : number of HCLK clock cycles during which the data bus is
20 kept in Hi-Z (tristate) after the start of a write access.
21 Only valid for write transactions. Zero means zero cycles,
22 255 means 255 cycles.
23 byte 3 THOLD : number of HCLK clock cycles to hold the address (and data
24 when writing) after the command deassertation. Zero means
25 one cycle, 255 means 256 cycles.
26 byte 4 TWAIT : number of HCLK clock cycles to assert the command to the
27 NAND flash in response to SMWAITn. Zero means 1 cycle,
28 255 means 256 cycles.
29 byte 5 TSET : number of HCLK clock cycles to assert the address before the
30 command is asserted. Zero means one cycle, 255 means 256
31 cycles.
32 - bank: default NAND bank to use (0-3 are valid, 0 is the default).
33 - nand-ecc-mode : see nand-controller.yaml
34 - nand-ecc-strength : see nand-controller.yaml
35 - nand-ecc-step-size : see nand-controller.yaml
36
37 Can support 1-bit HW ECC (default) or if stronger correction is required,
38 software-based BCH.
39
40 Example:
41
42 fsmc: flash@d1800000 {
43 compatible = "st,spear600-fsmc-nand";
44 #address-cells = <1>;
45 #size-cells = <1>;
46 reg = <0xd1800000 0x1000 /* FSMC Register */
47 0xd2000000 0x0010 /* NAND Base DATA */
48 0xd2020000 0x0010 /* NAND Base ADDR */
49 0xd2010000 0x0010>; /* NAND Base CMD */
50 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
51
52 bank-width = <1>;
53 nand-skip-bbtscan;
54 timings = /bits/ 8 <0 0 0 2 3 0>;
55 bank = <1>;
56
57 partition@0 {
58 ...
59 };
60 };
61

3. 한국어 전문 번역

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

ST FSMC NAND interface

1-3

이 문서는 STMicroelectronics Flexible Static Memory Controller인 FSMC의 NAND interface 바인딩입니다.

FSMC register 범위

4-8

필수 `compatible`은 `st,spear600-fsmc-nand` 또는 `stericsson,fsmc-nand`입니다. `reg`는 MTD chip의 address 범위를 지정하고, `reg-names`에는 `fsmc_regs`, `nand_data`, `nand_addr`, `nand_cmd`를 넣습니다.

FSMC register 역할
fsmc_regsFSMC controller
nand_dataNAND data bus
nand_addrNAND address latch
nand_cmdNAND command latch

Controller register와 NAND data·address·command window를 분리해 mapping합니다.

Bus width·timing·ECC

9-39

선택 `bank-width`는 byte 단위 device width이며 기본값은 1 byte입니다. `nand-skip-bbtscan`은 BBT scan을 건너뛰게 합니다.

`timings`는 NAND timing을 나타내는 6-byte array입니다. Byte 0 `TCLR`은 CLE에서 RE까지의 AHB clock cycle delay이며 하위 4bit만 유효하고 0은 1 cycle, 15는 16 cycle입니다. Byte 1 `TAR`은 ALE에서 RE까지의 delay이며 같은 4-bit 형식입니다.

Byte 2 `THIZ`는 write access 시작 뒤 data bus를 Hi-Z tristate로 유지할 HCLK cycle 수이며 write에서만 유효합니다. 0은 0 cycle, 255는 255 cycle입니다.

Byte 3 `THOLD`는 command deassert 뒤 address와 write data를 유지할 HCLK cycle 수로 0은 1 cycle, 255는 256 cycle입니다. Byte 4 `TWAIT`는 `SMWAITn`에 응답해 NAND flash에 command를 assert할 HCLK cycle 수이며 범위 해석은 1~256 cycle입니다.

Byte 5 `TSET`은 command assert 전에 address를 assert할 HCLK cycle 수이며 0은 1 cycle, 255는 256 cycle입니다. `bank`는 사용할 기본 NAND bank로 0~3이 유효하고 기본값은 0입니다.

`nand-ecc-mode`, `nand-ecc-strength`, `nand-ecc-step-size`는 `nand-controller.yaml`을 따릅니다. 기본 1-bit hardware ECC를 지원하며 더 강한 correction이 필요하면 software BCH를 사용할 수 있습니다.

FSMC timings 6-byte 배열
Byte이름 / 의미
0TCLR, CLE→RE delay
1TAR, ALE→RE delay
2THIZ, write 시작 뒤 Hi-Z 유지
3THOLD, command 해제 뒤 address/data 유지
4TWAIT, SMWAITn 응답 command assert
5TSET, command 전 address setup

각 byte의 signal과 cycle 의미입니다.

SPEAr600 FSMC 예제

40-60

예제는 FSMC register, NAND DATA, ADDR, CMD의 네 address window를 이름 순서대로 연결합니다. 1-byte bank width, BBT scan 생략, timing `<0 0 0 2 3 0>`, bank 1과 partition subnode를 사용합니다.

fsmc: flash@d1800000 {
        compatible = "st,spear600-fsmc-nand";
        #address-cells = <1>;
        #size-cells = <1>;
        reg = <0xd1800000 0x1000        /* FSMC Register */
               0xd2000000 0x0010        /* NAND Base DATA */
               0xd2020000 0x0010        /* NAND Base ADDR */
               0xd2010000 0x0010>;        /* NAND Base CMD */
        reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";

        bank-width = <1>;
        nand-skip-bbtscan;
        timings = /bits/ 8 <0 0 0 2 3 0>;
        bank = <1>;

        partition@0 {
                ...
        };
};