1 # SPDX-License-Identifier: GPL-2.0-only
2 menuconfig MTD_RAW_NAND
3 	tristate "Raw/Parallel NAND Device Support"
4 	select MTD_NAND_CORE
5 	select MTD_NAND_ECC
6 	help
7 	  This enables support for accessing all type of raw/parallel
8 	  NAND flash devices. For further information see
9 	  <http://www.linux-mtd.infradead.org/doc/nand.html>.
10 
11 if MTD_RAW_NAND
12 
13 comment "Raw/parallel NAND flash controllers"
14 
15 config MTD_NAND_DENALI
16 	tristate
17 
18 config MTD_NAND_DENALI_PCI
19 	tristate "Denali NAND controller on Intel Moorestown"
20 	select MTD_NAND_DENALI
21 	depends on PCI
22 	help
23 	  Enable the driver for NAND flash on Intel Moorestown, using the
24 	  Denali NAND controller core.
25 
26 config MTD_NAND_DENALI_DT
27 	tristate "Denali NAND controller as a DT device"
28 	select MTD_NAND_DENALI
29 	depends on HAS_DMA && HAVE_CLK && OF && HAS_IOMEM
30 	help
31 	  Enable the driver for NAND flash on platforms using a Denali NAND
32 	  controller as a DT device.
33 
34 config MTD_NAND_AMS_DELTA
35 	tristate "Amstrad E3 NAND controller"
36 	depends on MACH_AMS_DELTA || COMPILE_TEST
37 	default y
38 	help
39 	  Support for NAND flash on Amstrad E3 (Delta).
40 
41 config MTD_NAND_OMAP2
42 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
43 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
44 	depends on HAS_IOMEM
45 	depends on OMAP_GPMC
46 	help
47 	  Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
48 	  and Keystone platforms.
49 
50 config MTD_NAND_OMAP_BCH
51 	depends on MTD_NAND_OMAP2
52 	bool "Support hardware based BCH error correction"
53 	default n
54 	select BCH
55 	help
56 	  This config enables the ELM hardware engine, which can be used to
57 	  locate and correct errors when using BCH ECC scheme. This offloads
58 	  the cpu from doing ECC error searching and correction. However some
59 	  legacy OMAP families like OMAP2xxx, OMAP3xxx do not have ELM engine
60 	  so this is optional for them.
61 
62 config MTD_NAND_OMAP_BCH_BUILD
63 	def_tristate MTD_NAND_OMAP2 && MTD_NAND_OMAP_BCH
64 
65 config MTD_NAND_AU1550
66 	tristate "Au1550/1200 NAND support"
67 	depends on MIPS_ALCHEMY
68 	help
69 	  This enables the driver for the NAND flash controller on the
70 	  AMD/Alchemy 1550 SOC.
71 
72 config MTD_NAND_NDFC
73 	tristate "IBM/MCC 4xx NAND controller"
74 	depends on 4xx
75 	select MTD_NAND_ECC_SW_HAMMING
76 	select MTD_NAND_ECC_SW_HAMMING_SMC
77 	help
78 	  NDFC Nand Flash Controllers are integrated in IBM/AMCC's 4xx SoCs
79 
80 config MTD_NAND_S3C2410
81 	tristate "Samsung S3C NAND controller"
82 	depends on ARCH_S3C64XX
83 	help
84 	  This enables the NAND flash controller on the S3C24xx and S3C64xx
85 	  SoCs
86 
87 	  No board specific support is done by this driver, each board
88 	  must advertise a platform_device for the driver to attach.
89 
90 config MTD_NAND_S3C2410_DEBUG
91 	bool "Samsung S3C NAND controller debug"
92 	depends on MTD_NAND_S3C2410
93 	help
94 	  Enable debugging of the S3C NAND driver
95 
96 config MTD_NAND_S3C2410_CLKSTOP
97 	bool "Samsung S3C NAND IDLE clock stop"
98 	depends on MTD_NAND_S3C2410
99 	default n
100 	help
101 	  Stop the clock to the NAND controller when there is no chip
102 	  selected to save power. This will mean there is a small delay
103 	  when the is NAND chip selected or released, but will save
104 	  approximately 5mA of power when there is nothing happening.
105 
106 config MTD_NAND_SHARPSL
107 	tristate "Sharp SL Series (C7xx + others) NAND controller"
108 	depends on ARCH_PXA || COMPILE_TEST
109 	depends on HAS_IOMEM
110 
111 config MTD_NAND_CAFE
112 	tristate "OLPC CAFÉ NAND controller"
113 	depends on PCI
114 	select REED_SOLOMON
115 	select REED_SOLOMON_DEC16
116 	help
117 	  Use NAND flash attached to the CAFÉ chip designed for the OLPC
118 	  laptop.
119 
120 config MTD_NAND_CS553X
121 	tristate "CS5535/CS5536 (AMD Geode companion) NAND controller"
122 	depends on X86_32
123 	depends on !UML && HAS_IOMEM
124 	help
125 	  The CS553x companion chips for the AMD Geode processor
126 	  include NAND flash controllers with built-in hardware ECC
127 	  capabilities; enabling this option will allow you to use
128 	  these. The driver will check the MSRs to verify that the
129 	  controller is enabled for NAND, and currently requires that
130 	  the controller be in MMIO mode.
131 
132 	  If you say "m", the module will be called cs553x_nand.
133 
134 config MTD_NAND_ATMEL
135 	tristate "Atmel AT91 NAND Flash/SmartMedia NAND controller"
136 	depends on ARCH_AT91 || COMPILE_TEST
137 	depends on HAS_IOMEM
138 	select GENERIC_ALLOCATOR
139 	select MFD_ATMEL_SMC
140 	help
141 	  Enables support for NAND Flash / Smart Media Card interface
142 	  on Atmel AT91 processors.
143 
144 config MTD_NAND_ORION
145 	tristate "Marvell Orion NAND controller"
146 	depends on PLAT_ORION
147 	help
148 	  This enables the NAND flash controller on Orion machines.
149 
150 	  No board specific support is done by this driver, each board
151 	  must advertise a platform_device for the driver to attach.
152 
153 config MTD_NAND_MARVELL
154 	tristate "Marvell EBU NAND controller"
155 	depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU || \
156 		   COMPILE_TEST
157 	depends on HAS_IOMEM
158 	help
159 	  This enables the NAND flash controller driver for Marvell boards,
160 	  including:
161 	  - PXA3xx processors (NFCv1)
162 	  - 32-bit Armada platforms (XP, 37x, 38x, 39x) (NFCv2)
163 	  - 64-bit Aramda platforms (7k, 8k) (NFCv2)
164 
165 config MTD_NAND_SLC_LPC32XX
166 	tristate "NXP LPC32xx SLC NAND controller"
167 	depends on ARCH_LPC32XX || COMPILE_TEST
168 	depends on HAS_IOMEM
169 	help
170 	  Enables support for NXP's LPC32XX SLC (i.e. for Single Level Cell
171 	  chips) NAND controller. This is the default for the PHYTEC 3250
172 	  reference board which contains a NAND256R3A2CZA6 chip.
173 
174 	  Please check the actual NAND chip connected and its support
175 	  by the SLC NAND controller.
176 
177 config MTD_NAND_MLC_LPC32XX
178 	tristate "NXP LPC32xx MLC NAND controller"
179 	depends on ARCH_LPC32XX || COMPILE_TEST
180 	depends on HAS_IOMEM
181 	help
182 	  Uses the LPC32XX MLC (i.e. for Multi Level Cell chips) NAND
183 	  controller. This is the default for the WORK92105 controller
184 	  board.
185 
186 	  Please check the actual NAND chip connected and its support
187 	  by the MLC NAND controller.
188 
189 config MTD_NAND_PASEMI
190 	tristate "PA Semi PWRficient NAND controller"
191 	depends on PPC_PASEMI
192 	help
193 	  Enables support for NAND Flash interface on PA Semi PWRficient
194 	  based boards
195 
196 source "drivers/mtd/nand/raw/brcmnand/Kconfig"
197 
198 config MTD_NAND_BCM47XXNFLASH
199 	tristate "BCM4706 BCMA NAND controller"
200 	depends on BCMA_NFLASH
201 	depends on BCMA
202 	help
203 	  BCMA bus can have various flash memories attached, they are
204 	  registered by bcma as platform devices. This enables driver for
205 	  NAND flash memories. For now only BCM4706 is supported.
206 
207 config MTD_NAND_OXNAS
208 	tristate "Oxford Semiconductor NAND controller"
209 	depends on ARCH_OXNAS || COMPILE_TEST
210 	depends on HAS_IOMEM
211 	help
212 	  This enables the NAND flash controller on Oxford Semiconductor SoCs.
213 
214 config MTD_NAND_MPC5121_NFC
215 	tristate "MPC5121 NAND controller"
216 	depends on PPC_MPC512x
217 	help
218 	  This enables the driver for the NAND flash controller on the
219 	  MPC5121 SoC.
220 
221 config MTD_NAND_GPMI_NAND
222 	tristate "Freescale GPMI NAND controller"
223 	depends on MXS_DMA
224 	help
225 	  Enables NAND Flash support for IMX23, IMX28 or IMX6.
226 	  The GPMI controller is very powerful, with the help of BCH
227 	  module, it can do the hardware ECC. The GPMI supports several
228 	  NAND flashs at the same time.
229 
230 config MTD_NAND_FSL_ELBC
231 	tristate "Freescale eLBC NAND controller"
232 	depends on FSL_SOC
233 	select FSL_LBC
234 	help
235 	  Various Freescale chips, including the 8313, include a NAND Flash
236 	  Controller Module with built-in hardware ECC capabilities.
237 	  Enabling this option will enable you to use this to control
238 	  external NAND devices.
239 
240 config MTD_NAND_FSL_IFC
241 	tristate "Freescale IFC NAND controller"
242 	depends on FSL_SOC || ARCH_LAYERSCAPE || SOC_LS1021A || COMPILE_TEST
243 	depends on HAS_IOMEM
244 	select FSL_IFC
245 	select MEMORY
246 	help
247 	  Various Freescale chips e.g P1010, include a NAND Flash machine
248 	  with built-in hardware ECC capabilities.
249 	  Enabling this option will enable you to use this to control
250 	  external NAND devices.
251 
252 config MTD_NAND_FSL_UPM
253 	tristate "Freescale UPM NAND controller"
254 	depends on PPC_83xx || PPC_85xx
255 	select FSL_LBC
256 	help
257 	  Enables support for NAND Flash chips wired onto Freescale PowerPC
258 	  processor localbus with User-Programmable Machine support.
259 
260 config MTD_NAND_VF610_NFC
261 	tristate "Freescale VF610/MPC5125 NAND controller"
262 	depends on (SOC_VF610 || COMPILE_TEST)
263 	depends on HAS_IOMEM
264 	help
265 	  Enables support for NAND Flash Controller on some Freescale
266 	  processors like the VF610, MPC5125, MCF54418 or Kinetis K70.
267 	  The driver supports a maximum 2k page size. With 2k pages and
268 	  64 bytes or more of OOB, hardware ECC with up to 32-bit error
269 	  correction is supported. Hardware ECC is only enabled through
270 	  device tree.
271 
272 config MTD_NAND_MXC
273 	tristate "Freescale MXC NAND controller"
274 	depends on ARCH_MXC || COMPILE_TEST
275 	depends on HAS_IOMEM && OF
276 	help
277 	  This enables the driver for the NAND flash controller on the
278 	  MXC processors.
279 
280 config MTD_NAND_SH_FLCTL
281 	tristate "Renesas SuperH FLCTL NAND controller"
282 	depends on SUPERH || COMPILE_TEST
283 	depends on HAS_IOMEM
284 	help
285 	  Several Renesas SuperH CPU has FLCTL. This option enables support
286 	  for NAND Flash using FLCTL.
287 
288 config MTD_NAND_DAVINCI
289 	tristate "DaVinci/Keystone NAND controller"
290 	depends on ARCH_DAVINCI || (ARCH_KEYSTONE && TI_AEMIF) || COMPILE_TEST
291 	depends on HAS_IOMEM
292 	help
293 	  Enable the driver for NAND flash chips on Texas Instruments
294 	  DaVinci/Keystone processors.
295 
296 config MTD_NAND_TXX9NDFMC
297 	tristate "TXx9 NAND controller"
298 	depends on SOC_TX4938 || COMPILE_TEST
299 	depends on HAS_IOMEM
300 	help
301 	  This enables the NAND flash controller on the TXx9 SoCs.
302 
303 config MTD_NAND_SOCRATES
304 	tristate "Socrates NAND controller"
305 	depends on SOCRATES
306 	help
307 	  Enables support for NAND Flash chips wired onto Socrates board.
308 
309 source "drivers/mtd/nand/raw/ingenic/Kconfig"
310 
311 config MTD_NAND_FSMC
312 	tristate "ST Micros FSMC NAND controller"
313 	depends on OF && HAS_IOMEM
314 	depends on PLAT_SPEAR || ARCH_NOMADIK || ARCH_U8500 || COMPILE_TEST
315 	help
316 	  Enables support for NAND Flash chips on the ST Microelectronics
317 	  Flexible Static Memory Controller (FSMC)
318 
319 config MTD_NAND_XWAY
320 	bool "Lantiq XWAY NAND controller"
321 	depends on LANTIQ && SOC_TYPE_XWAY
322 	help
323 	  Enables support for NAND Flash chips on Lantiq XWAY SoCs. NAND is attached
324 	  to the External Bus Unit (EBU).
325 
326 config MTD_NAND_SUNXI
327 	tristate "Allwinner NAND controller"
328 	depends on ARCH_SUNXI || COMPILE_TEST
329 	depends on HAS_IOMEM
330 	help
331 	  Enables support for NAND Flash chips on Allwinner SoCs.
332 
333 config MTD_NAND_HISI504
334 	tristate "Hisilicon Hip04 NAND controller"
335 	depends on ARCH_HISI || COMPILE_TEST
336 	depends on HAS_IOMEM
337 	help
338 	  Enables support for NAND controller on Hisilicon SoC Hip04.
339 
340 config MTD_NAND_QCOM
341 	tristate "QCOM NAND controller"
342 	depends on ARCH_QCOM || COMPILE_TEST
343 	depends on HAS_IOMEM
344 	help
345 	  Enables support for NAND flash chips on SoCs containing the EBI2 NAND
346 	  controller. This controller is found on IPQ806x SoC.
347 
348 config MTD_NAND_MTK
349 	tristate "MTK NAND controller"
350 	depends on MTD_NAND_ECC_MEDIATEK
351 	depends on ARCH_MEDIATEK || COMPILE_TEST
352 	depends on HAS_IOMEM
353 	help
354 	  Enables support for NAND controller on MTK SoCs.
355 	  This controller is found on mt27xx, mt81xx, mt65xx SoCs.
356 
357 config MTD_NAND_MXIC
358 	tristate "Macronix raw NAND controller"
359 	depends on HAS_IOMEM || COMPILE_TEST
360 	help
361 	  This selects the Macronix raw NAND controller driver.
362 
363 config MTD_NAND_TEGRA
364 	tristate "NVIDIA Tegra NAND controller"
365 	depends on ARCH_TEGRA || COMPILE_TEST
366 	depends on HAS_IOMEM
367 	help
368 	  Enables support for NAND flash controller on NVIDIA Tegra SoC.
369 	  The driver has been developed and tested on a Tegra 2 SoC. DMA
370 	  support, raw read/write page as well as HW ECC read/write page
371 	  is supported. Extra OOB bytes when using HW ECC are currently
372 	  not supported.
373 
374 config MTD_NAND_STM32_FMC2
375 	tristate "Support for NAND controller on STM32MP SoCs"
376 	depends on MACH_STM32MP157 || COMPILE_TEST
377 	select MFD_SYSCON
378 	help
379 	  Enables support for NAND Flash chips on SoCs containing the FMC2
380 	  NAND controller. This controller is found on STM32MP SoCs.
381 	  The controller supports a maximum 8k page size and supports
382 	  a maximum 8-bit correction error per sector of 512 bytes.
383 
384 config MTD_NAND_MESON
385 	tristate "Support for NAND controller on Amlogic's Meson SoCs"
386 	depends on COMMON_CLK && (ARCH_MESON || COMPILE_TEST)
387 	select MFD_SYSCON
388 	help
389 	  Enables support for NAND controller on Amlogic's Meson SoCs.
390 	  This controller is found on Meson SoCs.
391 
392 config MTD_NAND_GPIO
393 	tristate "GPIO assisted NAND controller"
394 	depends on GPIOLIB || COMPILE_TEST
395 	depends on HAS_IOMEM
396 	help
397 	  This enables a NAND flash driver where control signals are
398 	  connected to GPIO pins, and commands and data are communicated
399 	  via a memory mapped interface.
400 
401 config MTD_NAND_PLATFORM
402 	tristate "Generic NAND controller"
403 	depends on HAS_IOMEM
404 	help
405 	  This implements a generic NAND driver for on-SOC platform
406 	  devices. You will need to provide platform-specific functions
407 	  via platform_data.
408 
409 config MTD_NAND_CADENCE
410 	tristate "Support Cadence NAND (HPNFC) controller"
411 	depends on OF && HAS_IOMEM
412 	help
413 	  Enable the driver for NAND flash on platforms using a Cadence NAND
414 	  controller.
415 
416 config MTD_NAND_ARASAN
417 	tristate "Support for Arasan NAND flash controller"
418 	depends on HAS_IOMEM && HAS_DMA
419 	select BCH
420 	help
421 	  Enables the driver for the Arasan NAND flash controller on
422 	  Zynq Ultrascale+ MPSoC.
423 
424 config MTD_NAND_INTEL_LGM
425 	tristate "Support for NAND controller on Intel LGM SoC"
426 	depends on OF
427 	depends on HAS_IOMEM
428 	help
429 	  Enables support for NAND Flash chips on Intel's LGM SoC.
430 	  NAND flash controller interfaced through the External Bus Unit.
431 
432 config MTD_NAND_ROCKCHIP
433 	tristate "Rockchip NAND controller"
434 	depends on ARCH_ROCKCHIP && HAS_IOMEM
435 	help
436 	  Enables support for NAND controller on Rockchip SoCs.
437 	  There are four different versions of NAND FLASH Controllers,
438 	  including:
439 	    NFC v600: RK2928, RK3066, RK3188
440 	    NFC v622: RK3036, RK3128
441 	    NFC v800: RK3308, RV1108
442 	    NFC v900: PX30, RK3326
443 
444 config MTD_NAND_PL35X
445 	tristate "ARM PL35X NAND controller"
446 	depends on OF
447 	depends on PL353_SMC
448 	help
449 	  Enables support for PrimeCell SMC PL351 and PL353 NAND
450 	  controller found on Zynq7000.
451 
452 config MTD_NAND_RENESAS
453 	tristate "Renesas R-Car Gen3 & RZ/N1 NAND controller"
454 	depends on ARCH_RENESAS || COMPILE_TEST
455 	help
456 	  Enables support for the NAND controller found on Renesas R-Car
457 	  Gen3 and RZ/N1 SoC families.
458 
459 comment "Misc"
460 
461 config MTD_SM_COMMON
462 	tristate
463 	default n
464 
465 config MTD_NAND_NANDSIM
466 	tristate "Support for NAND Flash Simulator"
467 	help
468 	  The simulator may simulate various NAND flash chips for the
469 	  MTD nand layer.
470 
471 config MTD_NAND_RICOH
472 	tristate "Ricoh xD card reader"
473 	default n
474 	depends on PCI
475 	select MTD_SM_COMMON
476 	help
477 	  Enable support for Ricoh R5C852 xD card reader
478 	  You also need to enable either
479 	  NAND SSFDC (SmartMedia) read only translation layer' or new
480 	  experimental, readwrite
481 	  'SmartMedia/xD new translation layer'
482 
483 config MTD_NAND_DISKONCHIP
484 	tristate "DiskOnChip 2000, Millennium and Millennium Plus (NAND reimplementation)"
485 	depends on HAS_IOMEM
486 	select REED_SOLOMON
487 	select REED_SOLOMON_DEC16
488 	help
489 	  This is a reimplementation of M-Systems DiskOnChip 2000,
490 	  Millennium and Millennium Plus as a standard NAND device driver,
491 	  as opposed to the earlier self-contained MTD device drivers.
492 	  This should enable, among other things, proper JFFS2 operation on
493 	  these devices.
494 
495 config MTD_NAND_DISKONCHIP_PROBE_ADVANCED
496 	bool "Advanced detection options for DiskOnChip"
497 	depends on MTD_NAND_DISKONCHIP
498 	help
499 	  This option allows you to specify nonstandard address at which to
500 	  probe for a DiskOnChip, or to change the detection options.  You
501 	  are unlikely to need any of this unless you are using LinuxBIOS.
502 	  Say 'N'.
503 
504 config MTD_NAND_DISKONCHIP_PROBE_ADDRESS
505 	hex "Physical address of DiskOnChip" if MTD_NAND_DISKONCHIP_PROBE_ADVANCED
506 	depends on MTD_NAND_DISKONCHIP
507 	default "0"
508 	help
509 	  By default, the probe for DiskOnChip devices will look for a
510 	  DiskOnChip at every multiple of 0x2000 between 0xC8000 and 0xEE000.
511 	  This option allows you to specify a single address at which to probe
512 	  for the device, which is useful if you have other devices in that
513 	  range which get upset when they are probed.
514 
515 	  (Note that on PowerPC, the normal probe will only check at
516 	  0xE4000000.)
517 
518 	  Normally, you should leave this set to zero, to allow the probe at
519 	  the normal addresses.
520 
521 config MTD_NAND_DISKONCHIP_PROBE_HIGH
522 	bool "Probe high addresses"
523 	depends on MTD_NAND_DISKONCHIP_PROBE_ADVANCED
524 	help
525 	  By default, the probe for DiskOnChip devices will look for a
526 	  DiskOnChip at every multiple of 0x2000 between 0xC8000 and 0xEE000.
527 	  This option changes to make it probe between 0xFFFC8000 and
528 	  0xFFFEE000.  Unless you are using LinuxBIOS, this is unlikely to be
529 	  useful to you.  Say 'N'.
530 
531 config MTD_NAND_DISKONCHIP_BBTWRITE
532 	bool "Allow BBT writes on DiskOnChip Millennium and 2000TSOP"
533 	depends on MTD_NAND_DISKONCHIP
534 	help
535 	  On DiskOnChip devices shipped with the INFTL filesystem (Millennium
536 	  and 2000 TSOP/Alon), Linux reserves some space at the end of the
537 	  device for the Bad Block Table (BBT).  If you have existing INFTL
538 	  data on your device (created by non-Linux tools such as M-Systems'
539 	  DOS drivers), your data might overlap the area Linux wants to use for
540 	  the BBT.  If this is a concern for you, leave this option disabled and
541 	  Linux will not write BBT data into this area.
542 	  The downside of leaving this option disabled is that if bad blocks
543 	  are detected by Linux, they will not be recorded in the BBT, which
544 	  could cause future problems.
545 	  Once you enable this option, new filesystems (INFTL or others, created
546 	  in Linux or other operating systems) will not use the reserved area.
547 	  The only reason not to enable this option is to prevent damage to
548 	  preexisting filesystems.
549 	  Even if you leave this disabled, you can enable BBT writes at module
550 	  load time (assuming you build diskonchip as a module) with the module
551 	  parameter "inftl_bbt_write=1".
552 
553 endif # MTD_RAW_NAND
554