blob: 0e826c19298689b3b4b317184c217b4e3184c2aa [file] [log] [blame]
Miquel Raynal1f1ae152018-08-16 17:30:07 +02001
Miquel Raynald0935362019-10-03 19:50:03 +02002menuconfig MTD_RAW_NAND
Miquel Raynal8115c452018-08-16 17:30:08 +02003 bool "Raw NAND Device Support"
Miquel Raynald0935362019-10-03 19:50:03 +02004if MTD_RAW_NAND
Miquel Raynal1f1ae152018-08-16 17:30:07 +02005
6config SYS_NAND_SELF_INIT
7 bool
8 help
9 This option, if enabled, provides more flexible and linux-like
10 NAND initialization process.
11
Tom Rini98372452021-12-12 22:12:36 -050012config SPL_SYS_NAND_SELF_INIT
13 bool
14 depends on !SPL_NAND_SIMPLE
15 help
16 This option, if enabled, provides more flexible and linux-like
17 NAND initialization process, in SPL.
18
19config TPL_SYS_NAND_SELF_INIT
20 bool
21 depends on TPL_NAND_SUPPORT
22 help
23 This option, if enabled, provides more flexible and linux-like
24 NAND initialization process, in SPL.
25
Stefan Agnerbd186142018-12-06 14:57:09 +010026config SYS_NAND_DRIVER_ECC_LAYOUT
Tom Rinid03e14e2021-12-11 14:55:54 -050027 bool "Omit standard ECC layouts to save space"
Stefan Agnerbd186142018-12-06 14:57:09 +010028 help
Tom Rinid03e14e2021-12-11 14:55:54 -050029 Omit standard ECC layouts to save space. Select this if your driver
Stefan Agnerbd186142018-12-06 14:57:09 +010030 is known to provide its own ECC layout.
31
Stefan Roese23b37f92019-08-22 12:28:04 +020032config SYS_NAND_USE_FLASH_BBT
33 bool "Enable BBT (Bad Block Table) support"
34 help
35 Enable the BBT (Bad Block Table) usage.
36
Miquel Raynal1f1ae152018-08-16 17:30:07 +020037config NAND_ATMEL
38 bool "Support Atmel NAND controller"
Tom Rini98372452021-12-12 22:12:36 -050039 select SYS_NAND_SELF_INIT
Miquel Raynal1f1ae152018-08-16 17:30:07 +020040 imply SYS_NAND_USE_FLASH_BBT
41 help
42 Enable this driver for NAND flash platforms using an Atmel NAND
43 controller.
44
Derald D. Woods7830fc52018-12-15 01:36:46 -060045if NAND_ATMEL
46
47config ATMEL_NAND_HWECC
48 bool "Atmel Hardware ECC"
Derald D. Woods7830fc52018-12-15 01:36:46 -060049
50config ATMEL_NAND_HW_PMECC
51 bool "Atmel Programmable Multibit ECC (PMECC)"
52 select ATMEL_NAND_HWECC
Derald D. Woods7830fc52018-12-15 01:36:46 -060053 help
54 The Programmable Multibit ECC (PMECC) controller is a programmable
55 binary BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder.
56
57config PMECC_CAP
58 int "PMECC Correctable ECC Bits"
59 depends on ATMEL_NAND_HW_PMECC
60 default 2
61 help
62 Correctable ECC bits, can be 2, 4, 8, 12, and 24.
63
64config PMECC_SECTOR_SIZE
65 int "PMECC Sector Size"
66 depends on ATMEL_NAND_HW_PMECC
67 default 512
68 help
69 Sector size, in bytes, can be 512 or 1024.
70
71config SPL_GENERATE_ATMEL_PMECC_HEADER
72 bool "Atmel PMECC Header Generation"
73 select ATMEL_NAND_HWECC
74 select ATMEL_NAND_HW_PMECC
Derald D. Woods7830fc52018-12-15 01:36:46 -060075 help
76 Generate Programmable Multibit ECC (PMECC) header for SPL image.
77
78endif
79
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010080config NAND_BRCMNAND
81 bool "Support Broadcom NAND controller"
Miquel Raynala903be42019-10-03 19:50:04 +020082 depends on OF_CONTROL && DM && DM_MTD
Tom Rini98372452021-12-12 22:12:36 -050083 select SYS_NAND_SELF_INIT
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010084 help
85 Enable the driver for NAND flash on platforms using a Broadcom NAND
86 controller.
87
Álvaro Fernández Rojasd9f9bfc2019-08-28 19:12:15 +020088config NAND_BRCMNAND_6368
89 bool "Support Broadcom NAND controller on bcm6368"
90 depends on NAND_BRCMNAND && ARCH_BMIPS
91 help
92 Enable support for broadcom nand driver on bcm6368.
93
Philippe Reynes74ead742020-01-07 20:14:13 +010094config NAND_BRCMNAND_68360
95 bool "Support Broadcom NAND controller on bcm68360"
96 depends on NAND_BRCMNAND && ARCH_BCM68360
97 help
98 Enable support for broadcom nand driver on bcm68360.
99
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +0100100config NAND_BRCMNAND_6838
101 bool "Support Broadcom NAND controller on bcm6838"
102 depends on NAND_BRCMNAND && ARCH_BMIPS && SOC_BMIPS_BCM6838
103 help
104 Enable support for broadcom nand driver on bcm6838.
105
106config NAND_BRCMNAND_6858
107 bool "Support Broadcom NAND controller on bcm6858"
108 depends on NAND_BRCMNAND && ARCH_BCM6858
109 help
110 Enable support for broadcom nand driver on bcm6858.
111
112config NAND_BRCMNAND_63158
113 bool "Support Broadcom NAND controller on bcm63158"
114 depends on NAND_BRCMNAND && ARCH_BCM63158
115 help
116 Enable support for broadcom nand driver on bcm63158.
117
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200118config NAND_DAVINCI
119 bool "Support TI Davinci NAND controller"
Tom Rini98372452021-12-12 22:12:36 -0500120 select SYS_NAND_SELF_INIT if TARGET_DA850EVM
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200121 help
122 Enable this driver for NAND flash controllers available in TI Davinci
123 and Keystone2 platforms
124
Tom Rinidada0e32021-09-12 20:32:24 -0400125config KEYSTONE_RBL_NAND
126 depends on ARCH_KEYSTONE
127 def_bool y
128
Tom Rinifae1dab2021-09-22 14:50:29 -0400129config SPL_NAND_LOAD
130 def_bool y
131 depends on NAND_DAVINCI && ARCH_DAVINCI && SPL_NAND_SUPPORT
132
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200133config NAND_DENALI
134 bool
135 select SYS_NAND_SELF_INIT
136 imply CMD_NAND
137
138config NAND_DENALI_DT
139 bool "Support Denali NAND controller as a DT device"
140 select NAND_DENALI
Masahiro Yamada8fc53822020-01-30 22:07:59 +0900141 depends on OF_CONTROL && DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200142 help
143 Enable the driver for NAND flash on platforms using a Denali NAND
144 controller as a DT device.
145
Tom Rinia73788c2021-09-22 14:50:37 -0400146config NAND_FSL_ELBC
147 bool "Support Freescale Enhanced Local Bus Controller FCM NAND driver"
Tom Rini98372452021-12-12 22:12:36 -0500148 select TPL_SYS_NAND_SELF_INIT if TPL_NAND_SUPPORT
149 select SPL_SYS_NAND_SELF_INIT
150 select SYS_NAND_SELF_INIT
Tom Rinia73788c2021-09-22 14:50:37 -0400151 depends on FSL_ELBC
152 help
153 Enable the Freescale Enhanced Local Bus Controller FCM NAND driver.
154
155config NAND_FSL_IFC
156 bool "Support Freescale Integrated Flash Controller NAND driver"
Tom Rini98372452021-12-12 22:12:36 -0500157 select TPL_SYS_NAND_SELF_INIT if TPL_NAND_SUPPORT
158 select SPL_SYS_NAND_SELF_INIT
159 select SYS_NAND_SELF_INIT
Tom Rini05b419e2021-12-11 14:55:49 -0500160 select FSL_IFC
Tom Rinia73788c2021-09-22 14:50:37 -0400161 help
162 Enable the Freescale Integrated Flash Controller NAND driver.
163
Tom Rini08204272021-09-22 14:50:28 -0400164config NAND_LPC32XX_MLC
165 bool "Support LPC32XX_MLC controller"
Tom Rini98372452021-12-12 22:12:36 -0500166 select SYS_NAND_SELF_INIT
Tom Rini08204272021-09-22 14:50:28 -0400167 help
168 Enable the LPC32XX MLC NAND controller.
169
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200170config NAND_LPC32XX_SLC
171 bool "Support LPC32XX_SLC controller"
172 help
173 Enable the LPC32XX SLC NAND controller.
174
175config NAND_OMAP_GPMC
176 bool "Support OMAP GPMC NAND controller"
177 depends on ARCH_OMAP2PLUS
178 help
179 Enables omap_gpmc.c driver for OMAPx and AMxxxx platforms.
180 GPMC controller is used for parallel NAND flash devices, and can
181 do ECC calculation (not ECC error detection) for HAM1, BCH4, BCH8
182 and BCH16 ECC algorithms.
183
Tom Rinif6d26d82021-09-22 14:50:39 -0400184if NAND_OMAP_GPMC
185
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200186config NAND_OMAP_GPMC_PREFETCH
187 bool "Enable GPMC Prefetch"
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200188 default y
189 help
190 On OMAP platforms that use the GPMC controller
191 (CONFIG_NAND_OMAP_GPMC_PREFETCH), this options enables the code that
192 uses the prefetch mode to speed up read operations.
193
194config NAND_OMAP_ELM
195 bool "Enable ELM driver for OMAPxx and AMxx platforms."
Tom Rinif6d26d82021-09-22 14:50:39 -0400196 depends on !OMAP34XX
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200197 help
198 ELM controller is used for ECC error detection (not ECC calculation)
199 of BCH4, BCH8 and BCH16 ECC algorithms.
200 Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
201 thus such SoC platforms need to depend on software library for ECC error
202 detection. However ECC calculation on such plaforms would still be
203 done by GPMC controller.
204
Tom Rinif6d26d82021-09-22 14:50:39 -0400205choice
206 prompt "ECC scheme"
207 default NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
208 help
209 On OMAP platforms, this CONFIG specifies NAND ECC scheme.
210 It can take following values:
211 OMAP_ECC_HAM1_CODE_SW
212 1-bit Hamming code using software lib.
213 (for legacy devices only)
214 OMAP_ECC_HAM1_CODE_HW
215 1-bit Hamming code using GPMC hardware.
216 (for legacy devices only)
217 OMAP_ECC_BCH4_CODE_HW_DETECTION_SW
218 4-bit BCH code (unsupported)
219 OMAP_ECC_BCH4_CODE_HW
220 4-bit BCH code (unsupported)
221 OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
222 8-bit BCH code with
223 - ecc calculation using GPMC hardware engine,
224 - error detection using software library.
225 - requires CONFIG_BCH to enable software BCH library
226 (For legacy device which do not have ELM h/w engine)
227 OMAP_ECC_BCH8_CODE_HW
228 8-bit BCH code with
229 - ecc calculation using GPMC hardware engine,
230 - error detection using ELM hardware engine.
231 OMAP_ECC_BCH16_CODE_HW
232 16-bit BCH code with
233 - ecc calculation using GPMC hardware engine,
234 - error detection using ELM hardware engine.
235
236 How to select ECC scheme on OMAP and AMxx platforms ?
237 -----------------------------------------------------
238 Though higher ECC schemes have more capability to detect and correct
239 bit-flips, but still selection of ECC scheme is dependent on following
240 - hardware engines present in SoC.
241 Some legacy OMAP SoC do not have ELM h/w engine thus such
242 SoC cannot support BCHx_HW ECC schemes.
243 - size of OOB/Spare region
244 With higher ECC schemes, more OOB/Spare area is required to
245 store ECC. So choice of ECC scheme is limited by NAND oobsize.
246
247 In general following expression can help:
248 NAND_OOBSIZE >= 2 + (NAND_PAGESIZE / 512) * ECC_BYTES
249 where
250 NAND_OOBSIZE = number of bytes available in
251 OOB/spare area per NAND page.
252 NAND_PAGESIZE = bytes in main-area of NAND page.
253 ECC_BYTES = number of ECC bytes generated to
254 protect 512 bytes of data, which is:
255 3 for HAM1_xx ecc schemes
256 7 for BCH4_xx ecc schemes
257 14 for BCH8_xx ecc schemes
258 26 for BCH16_xx ecc schemes
259
260 example to check for BCH16 on 2K page NAND
261 NAND_PAGESIZE = 2048
262 NAND_OOBSIZE = 64
263 2 + (2048 / 512) * 26 = 106 > NAND_OOBSIZE
264 Thus BCH16 cannot be supported on 2K page NAND.
265
266 However, for 4K pagesize NAND
267 NAND_PAGESIZE = 4096
268 NAND_OOBSIZE = 224
269 ECC_BYTES = 26
270 2 + (4096 / 512) * 26 = 210 < NAND_OOBSIZE
271 Thus BCH16 can be supported on 4K page NAND.
272
273config NAND_OMAP_ECCSCHEME_HAM1_CODE_SW
274 bool "1-bit Hamming code using software lib"
275
276config NAND_OMAP_ECCSCHEME_HAM1_CODE_HW
277 bool "1-bit Hamming code using GPMC hardware"
278
279config NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW
280 bool "8-bit BCH code with HW calculation SW error detection"
281
282config NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
283 bool "8-bit BCH code with HW calculation and error detection"
284
285config NAND_OMAP_ECCSCHEME_BCH16_CODE_HW
286 bool "16-bit BCH code with HW calculation and error detection"
287
288endchoice
289
290config NAND_OMAP_ECCSCHEME
291 int
292 default 1 if NAND_OMAP_ECCSCHEME_HAM1_CODE_SW
293 default 2 if NAND_OMAP_ECCSCHEME_HAM1_CODE_HW
294 default 5 if NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW
295 default 6 if NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
296 default 7 if NAND_OMAP_ECCSCHEME_BCH16_CODE_HW
297 help
298 This must be kept in sync with the enum in
299 include/linux/mtd/omap_gpmc.h
300
301endif
302
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200303config NAND_VF610_NFC
304 bool "Support for Freescale NFC for VF610"
305 select SYS_NAND_SELF_INIT
Stefan Agnerbd186142018-12-06 14:57:09 +0100306 select SYS_NAND_DRIVER_ECC_LAYOUT
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200307 imply CMD_NAND
308 help
309 Enables support for NAND Flash Controller on some Freescale
310 processors like the VF610, MCF54418 or Kinetis K70.
311 The driver supports a maximum 2k page size. The driver
312 currently does not support hardware ECC.
313
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100314if NAND_VF610_NFC
315
316config NAND_VF610_NFC_DT
317 bool "Support Vybrid's vf610 NAND controller as a DT device"
Miquel Raynala903be42019-10-03 19:50:04 +0200318 depends on OF_CONTROL && DM_MTD
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100319 help
320 Enable the driver for Vybrid's vf610 NAND flash on platforms
321 using device tree.
322
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200323choice
324 prompt "Hardware ECC strength"
325 depends on NAND_VF610_NFC
326 default SYS_NAND_VF610_NFC_45_ECC_BYTES
327 help
328 Select the ECC strength used in the hardware BCH ECC block.
329
330config SYS_NAND_VF610_NFC_45_ECC_BYTES
331 bool "24-error correction (45 ECC bytes)"
332
333config SYS_NAND_VF610_NFC_60_ECC_BYTES
334 bool "32-error correction (60 ECC bytes)"
335
336endchoice
337
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100338endif
339
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200340config NAND_PXA3XX
341 bool "Support for NAND on PXA3xx and Armada 370/XP/38x"
342 select SYS_NAND_SELF_INIT
Shmuel Hazan759349e2020-10-29 08:52:18 +0200343 select DM_MTD
Shmuel Hazan58983222020-10-29 08:52:20 +0200344 select REGMAP
345 select SYSCON
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200346 imply CMD_NAND
347 help
348 This enables the driver for the NAND flash device found on
349 PXA3xx processors (NFCv1) and also on Armada 370/XP (NFCv2).
350
351config NAND_SUNXI
352 bool "Support for NAND on Allwinner SoCs"
353 default ARCH_SUNXI
354 depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I
355 select SYS_NAND_SELF_INIT
356 select SYS_NAND_U_BOOT_LOCATIONS
357 select SPL_NAND_SUPPORT
Tom Rini98372452021-12-12 22:12:36 -0500358 select SPL_SYS_NAND_SELF_INIT
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200359 imply CMD_NAND
360 ---help---
361 Enable support for NAND. This option enables the standard and
362 SPL drivers.
363 The SPL driver only supports reading from the NAND using DMA
364 transfers.
365
366if NAND_SUNXI
367
368config NAND_SUNXI_SPL_ECC_STRENGTH
369 int "Allwinner NAND SPL ECC Strength"
370 default 64
371
372config NAND_SUNXI_SPL_ECC_SIZE
373 int "Allwinner NAND SPL ECC Step Size"
374 default 1024
375
376config NAND_SUNXI_SPL_USABLE_PAGE_SIZE
377 int "Allwinner NAND SPL Usable Page Size"
378 default 1024
379
380endif
381
382config NAND_ARASAN
383 bool "Configure Arasan Nand"
384 select SYS_NAND_SELF_INIT
Michal Simekc5587832020-08-19 09:59:52 +0200385 depends on DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200386 imply CMD_NAND
387 help
388 This enables Nand driver support for Arasan nand flash
389 controller. This uses the hardware ECC for read and
390 write operations.
391
392config NAND_MXC
393 bool "MXC NAND support"
394 depends on CPU_ARM926EJS || CPU_ARM1136 || MX5
395 imply CMD_NAND
396 help
397 This enables the NAND driver for the NAND flash controller on the
Haolin Lie8df55b2021-07-18 10:13:39 +0800398 i.MX27 / i.MX31 / i.MX5 processors.
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200399
400config NAND_MXS
401 bool "MXS NAND support"
Peng Fan128abf42020-05-04 22:09:00 +0800402 depends on MX23 || MX28 || MX6 || MX7 || IMX8 || IMX8M
Tom Rini98372452021-12-12 22:12:36 -0500403 select SPL_SYS_NAND_SELF_INIT
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200404 select SYS_NAND_SELF_INIT
405 imply CMD_NAND
406 select APBH_DMA
Peng Fan128abf42020-05-04 22:09:00 +0800407 select APBH_DMA_BURST if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
408 select APBH_DMA_BURST8 if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200409 help
410 This enables NAND driver for the NAND flash controller on the
411 MXS processors.
412
413if NAND_MXS
414
415config NAND_MXS_DT
416 bool "Support MXS NAND controller as a DT device"
Miquel Raynala903be42019-10-03 19:50:04 +0200417 depends on OF_CONTROL && DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200418 help
419 Enable the driver for MXS NAND flash on platforms using
420 device tree.
421
422config NAND_MXS_USE_MINIMUM_ECC
423 bool "Use minimum ECC strength supported by the controller"
424 default false
425
426endif
427
Zhengxun Li01551712021-09-14 13:43:51 +0800428config NAND_MXIC
429 bool "Macronix raw NAND controller"
430 select SYS_NAND_SELF_INIT
431 help
432 This selects the Macronix raw NAND controller driver.
433
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200434config NAND_ZYNQ
435 bool "Support for Zynq Nand controller"
Tom Rini98372452021-12-12 22:12:36 -0500436 select SPL_SYS_NAND_SELF_INIT
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200437 select SYS_NAND_SELF_INIT
Ashok Reddy Somabb8448a2019-12-27 04:47:12 -0700438 select DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200439 imply CMD_NAND
440 help
441 This enables Nand driver support for Nand flash controller
442 found on Zynq SoC.
443
444config NAND_ZYNQ_USE_BOOTLOADER1_TIMINGS
445 bool "Enable use of 1st stage bootloader timing for NAND"
446 depends on NAND_ZYNQ
447 help
448 This flag prevent U-boot reconfigure NAND flash controller and reuse
449 the NAND timing from 1st stage bootloader.
450
Suneel Garapati9de7d2b2020-08-26 14:37:22 +0200451config NAND_OCTEONTX
452 bool "Support for OcteonTX NAND controller"
453 select SYS_NAND_SELF_INIT
454 imply CMD_NAND
455 help
456 This enables Nand flash controller hardware found on the OcteonTX
457 processors.
458
459config NAND_OCTEONTX_HW_ECC
460 bool "Support Hardware ECC for OcteonTX NAND controller"
461 depends on NAND_OCTEONTX
462 default y
463 help
464 This enables Hardware BCH engine found on the OcteonTX processors to
465 support ECC for NAND flash controller.
466
Christophe Kerelloda141682019-04-05 11:41:50 +0200467config NAND_STM32_FMC2
468 bool "Support for NAND controller on STM32MP SoCs"
469 depends on ARCH_STM32MP
470 select SYS_NAND_SELF_INIT
471 imply CMD_NAND
472 help
473 Enables support for NAND Flash chips on SoCs containing the FMC2
474 NAND controller. This controller is found on STM32MP SoCs.
475 The controller supports a maximum 8k page size and supports
476 a maximum 8-bit correction error per sector of 512 bytes.
477
Kate Liu41ccd2e2020-12-11 13:46:12 -0800478config CORTINA_NAND
479 bool "Support for NAND controller on Cortina-Access SoCs"
480 depends on CORTINA_PLATFORM
481 select SYS_NAND_SELF_INIT
482 select DM_MTD
483 imply CMD_NAND
484 help
485 Enables support for NAND Flash chips on Coartina-Access SoCs platform
486 This controller is found on Presidio/Venus SoCs.
487 The controller supports a maximum 8k page size and supports
488 a maximum 40-bit error correction per sector of 1024 bytes.
489
Yifeng Zhao9e9021e2021-06-07 16:40:29 +0800490config ROCKCHIP_NAND
491 bool "Support for NAND controller on Rockchip SoCs"
492 depends on ARCH_ROCKCHIP
493 select SYS_NAND_SELF_INIT
494 select DM_MTD
495 imply CMD_NAND
496 help
497 Enables support for NAND Flash chips on Rockchip SoCs platform.
498 This controller is found on Rockchip SoCs.
499 There are four different versions of NAND FLASH Controllers,
500 including:
501 NFC v600: RK2928, RK3066, RK3188
502 NFC v622: RK3036, RK3128
503 NFC v800: RK3308, RV1108
504 NFC v900: PX30, RK3326
505
Tom Rini8f37ac42021-12-12 22:12:35 -0500506config TEGRA_NAND
507 bool "Support for NAND controller on Tegra SoCs"
508 depends on ARCH_TEGRA
509 select SYS_NAND_SELF_INIT
510 imply CMD_NAND
511 help
512 Enables support for NAND Flash chips on Tegra SoCs platforms.
513
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200514comment "Generic NAND options"
515
516config SYS_NAND_BLOCK_SIZE
517 hex "NAND chip eraseblock size"
Tom Rinifae1dab2021-09-22 14:50:29 -0400518 depends on ARCH_SUNXI || SPL_NAND_SUPPORT || TPL_NAND_SUPPORT
Tom Rinid24700f2021-10-30 23:03:56 -0400519 depends on !NAND_MXS && !NAND_DENALI_DT && !NAND_LPC32XX_MLC && !NAND_FSL_IFC
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200520 help
521 Number of data bytes in one eraseblock for the NAND chip on the
522 board. This is the multiple of NAND_PAGE_SIZE and the number of
523 pages.
524
Tom Rinifdae0072021-09-22 14:50:34 -0400525config SYS_NAND_ONFI_DETECTION
526 bool "Enable detection of ONFI compliant devices during probe"
527 help
528 Enables detection of ONFI compliant devices during probe.
529 And fetching device parameters flashed on device, by parsing
530 ONFI parameter page.
531
Tom Rini2510a812021-09-22 14:50:30 -0400532config SYS_NAND_PAGE_COUNT
533 hex "NAND chip page count"
534 depends on SPL_NAND_SUPPORT && (NAND_ATMEL || NAND_MXC || \
535 SPL_NAND_AM33XX_BCH || SPL_NAND_LOAD || SPL_NAND_SIMPLE)
536 help
537 Number of pages in the NAND chip.
538
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200539config SYS_NAND_PAGE_SIZE
540 hex "NAND chip page size"
Tom Rinifae1dab2021-09-22 14:50:29 -0400541 depends on ARCH_SUNXI || NAND_OMAP_GPMC || NAND_LPC32XX_SLC || \
542 SPL_NAND_SIMPLE || (NAND_MXC && SPL_NAND_SUPPORT) || \
543 (NAND_ATMEL && SPL_NAND_SUPPORT) || SPL_GENERATE_ATMEL_PMECC_HEADER
Tom Rinid24700f2021-10-30 23:03:56 -0400544 depends on !NAND_MXS && !NAND_DENALI_DT && !NAND_LPC32XX_MLC
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200545 help
546 Number of data bytes in one page for the NAND chip on the
547 board, not including the OOB area.
548
549config SYS_NAND_OOBSIZE
550 hex "NAND chip OOB size"
Tom Rinifae1dab2021-09-22 14:50:29 -0400551 depends on ARCH_SUNXI || NAND_OMAP_GPMC || NAND_LPC32XX_SLC || \
552 SPL_NAND_SIMPLE || (NAND_MXC && SPL_NAND_SUPPORT) || \
553 (NAND_ATMEL && SPL_NAND_SUPPORT) || SPL_GENERATE_ATMEL_PMECC_HEADER
Tom Rinid24700f2021-10-30 23:03:56 -0400554 depends on !NAND_MXS && !NAND_DENALI_DT && !NAND_LPC32XX_MLC
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200555 help
556 Number of bytes in the Out-Of-Band area for the NAND chip on
557 the board.
558
559# Enhance depends when converting drivers to Kconfig which use this config
560# option (mxc_nand, ndfc, omap_gpmc).
561config SYS_NAND_BUSWIDTH_16BIT
562 bool "Use 16-bit NAND interface"
563 depends on NAND_VF610_NFC || NAND_OMAP_GPMC || NAND_MXC || ARCH_DAVINCI
564 help
565 Indicates that NAND device has 16-bit wide data-bus. In absence of this
566 config, bus-width of NAND device is assumed to be either 8-bit and later
567 determined by reading ONFI params.
568 Above config is useful when NAND device's bus-width information cannot
569 be determined from on-chip ONFI params, like in following scenarios:
570 - SPL boot does not support reading of ONFI parameters. This is done to
571 keep SPL code foot-print small.
572 - In current U-Boot flow using nand_init(), driver initialization
573 happens in board_nand_init() which is called before any device probe
574 (nand_scan_ident + nand_scan_tail), thus device's ONFI parameters are
575 not available while configuring controller. So a static CONFIG_NAND_xx
576 is needed to know the device's bus-width in advance.
577
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200578if SPL
579
Tom Rini8e6d9c72021-09-22 14:50:33 -0400580config SYS_NAND_5_ADDR_CYCLE
581 bool "Wait 5 address cycles during NAND commands"
582 depends on SPL_NAND_AM33XX_BCH || SPL_NAND_SIMPLE || \
583 (SPL_NAND_SUPPORT && NAND_ATMEL)
584 default y
585 help
586 Some controllers require waiting for 5 address cycles when issuing
587 some commands, on NAND chips larger than 128MiB.
588
Tom Rinia2fbd4a2021-09-22 14:50:32 -0400589choice
Tom Rinifdae0072021-09-22 14:50:34 -0400590 prompt "NAND bad block marker/indicator position in the OOB"
Tom Rinia2fbd4a2021-09-22 14:50:32 -0400591 depends on SPL_NAND_AM33XX_BCH || SPL_NAND_DENALI || SPL_NAND_SIMPLE || \
592 SPL_NAND_SUPPORT && (NAND_ATMEL || NAND_MXC)
593 default HAS_NAND_LARGE_BADBLOCK_POS
594 help
595 In the OOB, which position contains the badblock information.
596
597config HAS_NAND_LARGE_BADBLOCK_POS
598 bool "Set the bad block marker/indicator to the 'large' position"
599
600config HAS_NAND_SMALL_BADBLOCK_POS
601 bool "Set the bad block marker/indicator to the 'small' position"
602
603endchoice
604
605config SYS_NAND_BAD_BLOCK_POS
606 int
607 default 0 if HAS_NAND_LARGE_BADBLOCK_POS
608 default 5 if HAS_NAND_SMALL_BADBLOCK_POS
609
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200610config SYS_NAND_U_BOOT_LOCATIONS
611 bool "Define U-boot binaries locations in NAND"
612 help
613 Enable CONFIG_SYS_NAND_U_BOOT_OFFS though Kconfig.
614 This option should not be enabled when compiling U-boot for boards
615 defining CONFIG_SYS_NAND_U_BOOT_OFFS in their include/configs/<board>.h
616 file.
617
618config SYS_NAND_U_BOOT_OFFS
619 hex "Location in NAND to read U-Boot from"
620 default 0x800000 if NAND_SUNXI
621 depends on SYS_NAND_U_BOOT_LOCATIONS
622 help
623 Set the offset from the start of the nand where u-boot should be
624 loaded from.
625
626config SYS_NAND_U_BOOT_OFFS_REDUND
627 hex "Location in NAND to read U-Boot from"
628 default SYS_NAND_U_BOOT_OFFS
629 depends on SYS_NAND_U_BOOT_LOCATIONS
630 help
631 Set the offset from the start of the nand where the redundant u-boot
632 should be loaded from.
633
634config SPL_NAND_AM33XX_BCH
635 bool "Enables SPL-NAND driver which supports ELM based"
636 depends on NAND_OMAP_GPMC && !OMAP34XX
637 default y
638 help
639 Hardware ECC correction. This is useful for platforms which have ELM
640 hardware engine and use NAND boot mode.
641 Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
642 so those platforms should use CONFIG_SPL_NAND_SIMPLE for enabling
643 SPL-NAND driver with software ECC correction support.
644
645config SPL_NAND_DENALI
646 bool "Support Denali NAND controller for SPL"
647 help
648 This is a small implementation of the Denali NAND controller
649 for use on SPL.
650
Masahiro Yamada64648cb2020-04-17 16:51:42 +0900651config NAND_DENALI_SPARE_AREA_SKIP_BYTES
652 int "Number of bytes skipped in OOB area"
653 depends on SPL_NAND_DENALI
654 range 0 63
655 help
656 This option specifies the number of bytes to skip from the beginning
657 of OOB area before last ECC sector data starts. This is potentially
658 used to preserve the bad block marker in the OOB area.
659
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200660config SPL_NAND_SIMPLE
661 bool "Use simple SPL NAND driver"
662 depends on !SPL_NAND_AM33XX_BCH
663 help
664 Support for NAND boot using simple NAND drivers that
665 expose the cmd_ctrl() interface.
666endif
667
668endif # if NAND