18c2ecf20Sopenharmony_ciST Microelectronics Flexible Static Memory Controller (FSMC)
28c2ecf20Sopenharmony_ciNAND Interface
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciRequired properties:
58c2ecf20Sopenharmony_ci- compatible : "st,spear600-fsmc-nand", "stericsson,fsmc-nand"
68c2ecf20Sopenharmony_ci- reg : Address range of the mtd chip
78c2ecf20Sopenharmony_ci- reg-names: Should contain the reg names "fsmc_regs", "nand_data", "nand_addr" and "nand_cmd"
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciOptional properties:
108c2ecf20Sopenharmony_ci- bank-width : Width (in bytes) of the device.  If not present, the width
118c2ecf20Sopenharmony_ci  defaults to 1 byte
128c2ecf20Sopenharmony_ci- nand-skip-bbtscan: Indicates the BBT scanning should be skipped
138c2ecf20Sopenharmony_ci- timings: array of 6 bytes for NAND timings. The meanings of these bytes
148c2ecf20Sopenharmony_ci  are:
158c2ecf20Sopenharmony_ci  byte 0 TCLR  : CLE to RE delay in number of AHB clock cycles, only 4 bits
168c2ecf20Sopenharmony_ci                 are valid. Zero means one clockcycle, 15 means 16 clock
178c2ecf20Sopenharmony_ci                 cycles.
188c2ecf20Sopenharmony_ci  byte 1 TAR   : ALE to RE delay, 4 bits are valid. Same format as TCLR.
198c2ecf20Sopenharmony_ci  byte 2 THIZ  : number of HCLK clock cycles during which the data bus is
208c2ecf20Sopenharmony_ci                 kept in Hi-Z (tristate) after the start of a write access.
218c2ecf20Sopenharmony_ci                 Only valid for write transactions. Zero means zero cycles,
228c2ecf20Sopenharmony_ci                 255 means 255 cycles.
238c2ecf20Sopenharmony_ci  byte 3 THOLD : number of HCLK clock cycles to hold the address (and data
248c2ecf20Sopenharmony_ci                 when writing) after the command deassertation. Zero means
258c2ecf20Sopenharmony_ci                 one cycle, 255 means 256 cycles.
268c2ecf20Sopenharmony_ci  byte 4 TWAIT : number of HCLK clock cycles to assert the command to the
278c2ecf20Sopenharmony_ci                 NAND flash in response to SMWAITn. Zero means 1 cycle,
288c2ecf20Sopenharmony_ci                 255 means 256 cycles.
298c2ecf20Sopenharmony_ci  byte 5 TSET  : number of HCLK clock cycles to assert the address before the
308c2ecf20Sopenharmony_ci                 command is asserted. Zero means one cycle, 255 means 256
318c2ecf20Sopenharmony_ci                 cycles.
328c2ecf20Sopenharmony_ci- bank: default NAND bank to use (0-3 are valid, 0 is the default).
338c2ecf20Sopenharmony_ci- nand-ecc-mode      : see nand-controller.yaml
348c2ecf20Sopenharmony_ci- nand-ecc-strength  : see nand-controller.yaml
358c2ecf20Sopenharmony_ci- nand-ecc-step-size : see nand-controller.yaml
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciCan support 1-bit HW ECC (default) or if stronger correction is required,
388c2ecf20Sopenharmony_cisoftware-based BCH.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciExample:
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci	fsmc: flash@d1800000 {
438c2ecf20Sopenharmony_ci		compatible = "st,spear600-fsmc-nand";
448c2ecf20Sopenharmony_ci		#address-cells = <1>;
458c2ecf20Sopenharmony_ci		#size-cells = <1>;
468c2ecf20Sopenharmony_ci		reg = <0xd1800000 0x1000	/* FSMC Register */
478c2ecf20Sopenharmony_ci		       0xd2000000 0x0010	/* NAND Base DATA */
488c2ecf20Sopenharmony_ci		       0xd2020000 0x0010	/* NAND Base ADDR */
498c2ecf20Sopenharmony_ci		       0xd2010000 0x0010>;	/* NAND Base CMD */
508c2ecf20Sopenharmony_ci		reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci		bank-width = <1>;
538c2ecf20Sopenharmony_ci		nand-skip-bbtscan;
548c2ecf20Sopenharmony_ci		timings = /bits/ 8 <0 0 0 2 3 0>;
558c2ecf20Sopenharmony_ci		bank = <1>;
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci		partition@0 {
588c2ecf20Sopenharmony_ci			...
598c2ecf20Sopenharmony_ci		};
608c2ecf20Sopenharmony_ci	};
61