blob: d4da639dd1325fd0eeb0b78b605996d35a118cda [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
Stefan Agnerbd186142018-12-06 14:57:09 +010012config SYS_NAND_DRIVER_ECC_LAYOUT
13 bool
14 help
15 Omit standard ECC layouts to safe space. Select this if your driver
16 is known to provide its own ECC layout.
17
Stefan Roese23b37f92019-08-22 12:28:04 +020018config SYS_NAND_USE_FLASH_BBT
19 bool "Enable BBT (Bad Block Table) support"
20 help
21 Enable the BBT (Bad Block Table) usage.
22
Miquel Raynal1f1ae152018-08-16 17:30:07 +020023config NAND_ATMEL
24 bool "Support Atmel NAND controller"
25 imply SYS_NAND_USE_FLASH_BBT
26 help
27 Enable this driver for NAND flash platforms using an Atmel NAND
28 controller.
29
Derald D. Woods7830fc52018-12-15 01:36:46 -060030if NAND_ATMEL
31
32config ATMEL_NAND_HWECC
33 bool "Atmel Hardware ECC"
Derald D. Woods7830fc52018-12-15 01:36:46 -060034
35config ATMEL_NAND_HW_PMECC
36 bool "Atmel Programmable Multibit ECC (PMECC)"
37 select ATMEL_NAND_HWECC
Derald D. Woods7830fc52018-12-15 01:36:46 -060038 help
39 The Programmable Multibit ECC (PMECC) controller is a programmable
40 binary BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder.
41
42config PMECC_CAP
43 int "PMECC Correctable ECC Bits"
44 depends on ATMEL_NAND_HW_PMECC
45 default 2
46 help
47 Correctable ECC bits, can be 2, 4, 8, 12, and 24.
48
49config PMECC_SECTOR_SIZE
50 int "PMECC Sector Size"
51 depends on ATMEL_NAND_HW_PMECC
52 default 512
53 help
54 Sector size, in bytes, can be 512 or 1024.
55
56config SPL_GENERATE_ATMEL_PMECC_HEADER
57 bool "Atmel PMECC Header Generation"
58 select ATMEL_NAND_HWECC
59 select ATMEL_NAND_HW_PMECC
Derald D. Woods7830fc52018-12-15 01:36:46 -060060 help
61 Generate Programmable Multibit ECC (PMECC) header for SPL image.
62
63endif
64
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010065config NAND_BRCMNAND
66 bool "Support Broadcom NAND controller"
Miquel Raynala903be42019-10-03 19:50:04 +020067 depends on OF_CONTROL && DM && DM_MTD
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010068 help
69 Enable the driver for NAND flash on platforms using a Broadcom NAND
70 controller.
71
Álvaro Fernández Rojasd9f9bfc2019-08-28 19:12:15 +020072config NAND_BRCMNAND_6368
73 bool "Support Broadcom NAND controller on bcm6368"
74 depends on NAND_BRCMNAND && ARCH_BMIPS
75 help
76 Enable support for broadcom nand driver on bcm6368.
77
Philippe Reynes74ead742020-01-07 20:14:13 +010078config NAND_BRCMNAND_68360
79 bool "Support Broadcom NAND controller on bcm68360"
80 depends on NAND_BRCMNAND && ARCH_BCM68360
81 help
82 Enable support for broadcom nand driver on bcm68360.
83
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010084config NAND_BRCMNAND_6838
85 bool "Support Broadcom NAND controller on bcm6838"
86 depends on NAND_BRCMNAND && ARCH_BMIPS && SOC_BMIPS_BCM6838
87 help
88 Enable support for broadcom nand driver on bcm6838.
89
90config NAND_BRCMNAND_6858
91 bool "Support Broadcom NAND controller on bcm6858"
92 depends on NAND_BRCMNAND && ARCH_BCM6858
93 help
94 Enable support for broadcom nand driver on bcm6858.
95
96config NAND_BRCMNAND_63158
97 bool "Support Broadcom NAND controller on bcm63158"
98 depends on NAND_BRCMNAND && ARCH_BCM63158
99 help
100 Enable support for broadcom nand driver on bcm63158.
101
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200102config NAND_DAVINCI
103 bool "Support TI Davinci NAND controller"
104 help
105 Enable this driver for NAND flash controllers available in TI Davinci
106 and Keystone2 platforms
107
Tom Rinidada0e32021-09-12 20:32:24 -0400108config KEYSTONE_RBL_NAND
109 depends on ARCH_KEYSTONE
110 def_bool y
111
Tom Rinifae1dab2021-09-22 14:50:29 -0400112config SPL_NAND_LOAD
113 def_bool y
114 depends on NAND_DAVINCI && ARCH_DAVINCI && SPL_NAND_SUPPORT
115
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200116config NAND_DENALI
117 bool
118 select SYS_NAND_SELF_INIT
119 imply CMD_NAND
120
121config NAND_DENALI_DT
122 bool "Support Denali NAND controller as a DT device"
123 select NAND_DENALI
Masahiro Yamada8fc53822020-01-30 22:07:59 +0900124 depends on OF_CONTROL && DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200125 help
126 Enable the driver for NAND flash on platforms using a Denali NAND
127 controller as a DT device.
128
Tom Rinia73788c2021-09-22 14:50:37 -0400129config NAND_FSL_ELBC
130 bool "Support Freescale Enhanced Local Bus Controller FCM NAND driver"
131 depends on FSL_ELBC
132 help
133 Enable the Freescale Enhanced Local Bus Controller FCM NAND driver.
134
135config NAND_FSL_IFC
136 bool "Support Freescale Integrated Flash Controller NAND driver"
137 help
138 Enable the Freescale Integrated Flash Controller NAND driver.
139
Tom Rini08204272021-09-22 14:50:28 -0400140config NAND_LPC32XX_MLC
141 bool "Support LPC32XX_MLC controller"
142 help
143 Enable the LPC32XX MLC NAND controller.
144
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200145config NAND_LPC32XX_SLC
146 bool "Support LPC32XX_SLC controller"
147 help
148 Enable the LPC32XX SLC NAND controller.
149
150config NAND_OMAP_GPMC
151 bool "Support OMAP GPMC NAND controller"
152 depends on ARCH_OMAP2PLUS
153 help
154 Enables omap_gpmc.c driver for OMAPx and AMxxxx platforms.
155 GPMC controller is used for parallel NAND flash devices, and can
156 do ECC calculation (not ECC error detection) for HAM1, BCH4, BCH8
157 and BCH16 ECC algorithms.
158
Tom Rinif6d26d82021-09-22 14:50:39 -0400159if NAND_OMAP_GPMC
160
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200161config NAND_OMAP_GPMC_PREFETCH
162 bool "Enable GPMC Prefetch"
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200163 default y
164 help
165 On OMAP platforms that use the GPMC controller
166 (CONFIG_NAND_OMAP_GPMC_PREFETCH), this options enables the code that
167 uses the prefetch mode to speed up read operations.
168
169config NAND_OMAP_ELM
170 bool "Enable ELM driver for OMAPxx and AMxx platforms."
Tom Rinif6d26d82021-09-22 14:50:39 -0400171 depends on !OMAP34XX
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200172 help
173 ELM controller is used for ECC error detection (not ECC calculation)
174 of BCH4, BCH8 and BCH16 ECC algorithms.
175 Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
176 thus such SoC platforms need to depend on software library for ECC error
177 detection. However ECC calculation on such plaforms would still be
178 done by GPMC controller.
179
Tom Rinif6d26d82021-09-22 14:50:39 -0400180choice
181 prompt "ECC scheme"
182 default NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
183 help
184 On OMAP platforms, this CONFIG specifies NAND ECC scheme.
185 It can take following values:
186 OMAP_ECC_HAM1_CODE_SW
187 1-bit Hamming code using software lib.
188 (for legacy devices only)
189 OMAP_ECC_HAM1_CODE_HW
190 1-bit Hamming code using GPMC hardware.
191 (for legacy devices only)
192 OMAP_ECC_BCH4_CODE_HW_DETECTION_SW
193 4-bit BCH code (unsupported)
194 OMAP_ECC_BCH4_CODE_HW
195 4-bit BCH code (unsupported)
196 OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
197 8-bit BCH code with
198 - ecc calculation using GPMC hardware engine,
199 - error detection using software library.
200 - requires CONFIG_BCH to enable software BCH library
201 (For legacy device which do not have ELM h/w engine)
202 OMAP_ECC_BCH8_CODE_HW
203 8-bit BCH code with
204 - ecc calculation using GPMC hardware engine,
205 - error detection using ELM hardware engine.
206 OMAP_ECC_BCH16_CODE_HW
207 16-bit BCH code with
208 - ecc calculation using GPMC hardware engine,
209 - error detection using ELM hardware engine.
210
211 How to select ECC scheme on OMAP and AMxx platforms ?
212 -----------------------------------------------------
213 Though higher ECC schemes have more capability to detect and correct
214 bit-flips, but still selection of ECC scheme is dependent on following
215 - hardware engines present in SoC.
216 Some legacy OMAP SoC do not have ELM h/w engine thus such
217 SoC cannot support BCHx_HW ECC schemes.
218 - size of OOB/Spare region
219 With higher ECC schemes, more OOB/Spare area is required to
220 store ECC. So choice of ECC scheme is limited by NAND oobsize.
221
222 In general following expression can help:
223 NAND_OOBSIZE >= 2 + (NAND_PAGESIZE / 512) * ECC_BYTES
224 where
225 NAND_OOBSIZE = number of bytes available in
226 OOB/spare area per NAND page.
227 NAND_PAGESIZE = bytes in main-area of NAND page.
228 ECC_BYTES = number of ECC bytes generated to
229 protect 512 bytes of data, which is:
230 3 for HAM1_xx ecc schemes
231 7 for BCH4_xx ecc schemes
232 14 for BCH8_xx ecc schemes
233 26 for BCH16_xx ecc schemes
234
235 example to check for BCH16 on 2K page NAND
236 NAND_PAGESIZE = 2048
237 NAND_OOBSIZE = 64
238 2 + (2048 / 512) * 26 = 106 > NAND_OOBSIZE
239 Thus BCH16 cannot be supported on 2K page NAND.
240
241 However, for 4K pagesize NAND
242 NAND_PAGESIZE = 4096
243 NAND_OOBSIZE = 224
244 ECC_BYTES = 26
245 2 + (4096 / 512) * 26 = 210 < NAND_OOBSIZE
246 Thus BCH16 can be supported on 4K page NAND.
247
248config NAND_OMAP_ECCSCHEME_HAM1_CODE_SW
249 bool "1-bit Hamming code using software lib"
250
251config NAND_OMAP_ECCSCHEME_HAM1_CODE_HW
252 bool "1-bit Hamming code using GPMC hardware"
253
254config NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW
255 bool "8-bit BCH code with HW calculation SW error detection"
256
257config NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
258 bool "8-bit BCH code with HW calculation and error detection"
259
260config NAND_OMAP_ECCSCHEME_BCH16_CODE_HW
261 bool "16-bit BCH code with HW calculation and error detection"
262
263endchoice
264
265config NAND_OMAP_ECCSCHEME
266 int
267 default 1 if NAND_OMAP_ECCSCHEME_HAM1_CODE_SW
268 default 2 if NAND_OMAP_ECCSCHEME_HAM1_CODE_HW
269 default 5 if NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW
270 default 6 if NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
271 default 7 if NAND_OMAP_ECCSCHEME_BCH16_CODE_HW
272 help
273 This must be kept in sync with the enum in
274 include/linux/mtd/omap_gpmc.h
275
276endif
277
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200278config NAND_VF610_NFC
279 bool "Support for Freescale NFC for VF610"
280 select SYS_NAND_SELF_INIT
Stefan Agnerbd186142018-12-06 14:57:09 +0100281 select SYS_NAND_DRIVER_ECC_LAYOUT
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200282 imply CMD_NAND
283 help
284 Enables support for NAND Flash Controller on some Freescale
285 processors like the VF610, MCF54418 or Kinetis K70.
286 The driver supports a maximum 2k page size. The driver
287 currently does not support hardware ECC.
288
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100289if NAND_VF610_NFC
290
291config NAND_VF610_NFC_DT
292 bool "Support Vybrid's vf610 NAND controller as a DT device"
Miquel Raynala903be42019-10-03 19:50:04 +0200293 depends on OF_CONTROL && DM_MTD
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100294 help
295 Enable the driver for Vybrid's vf610 NAND flash on platforms
296 using device tree.
297
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200298choice
299 prompt "Hardware ECC strength"
300 depends on NAND_VF610_NFC
301 default SYS_NAND_VF610_NFC_45_ECC_BYTES
302 help
303 Select the ECC strength used in the hardware BCH ECC block.
304
305config SYS_NAND_VF610_NFC_45_ECC_BYTES
306 bool "24-error correction (45 ECC bytes)"
307
308config SYS_NAND_VF610_NFC_60_ECC_BYTES
309 bool "32-error correction (60 ECC bytes)"
310
311endchoice
312
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100313endif
314
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200315config NAND_PXA3XX
316 bool "Support for NAND on PXA3xx and Armada 370/XP/38x"
317 select SYS_NAND_SELF_INIT
Shmuel Hazan759349e2020-10-29 08:52:18 +0200318 select DM_MTD
Shmuel Hazan58983222020-10-29 08:52:20 +0200319 select REGMAP
320 select SYSCON
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200321 imply CMD_NAND
322 help
323 This enables the driver for the NAND flash device found on
324 PXA3xx processors (NFCv1) and also on Armada 370/XP (NFCv2).
325
326config NAND_SUNXI
327 bool "Support for NAND on Allwinner SoCs"
328 default ARCH_SUNXI
329 depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I
330 select SYS_NAND_SELF_INIT
331 select SYS_NAND_U_BOOT_LOCATIONS
332 select SPL_NAND_SUPPORT
333 imply CMD_NAND
334 ---help---
335 Enable support for NAND. This option enables the standard and
336 SPL drivers.
337 The SPL driver only supports reading from the NAND using DMA
338 transfers.
339
340if NAND_SUNXI
341
342config NAND_SUNXI_SPL_ECC_STRENGTH
343 int "Allwinner NAND SPL ECC Strength"
344 default 64
345
346config NAND_SUNXI_SPL_ECC_SIZE
347 int "Allwinner NAND SPL ECC Step Size"
348 default 1024
349
350config NAND_SUNXI_SPL_USABLE_PAGE_SIZE
351 int "Allwinner NAND SPL Usable Page Size"
352 default 1024
353
354endif
355
356config NAND_ARASAN
357 bool "Configure Arasan Nand"
358 select SYS_NAND_SELF_INIT
Michal Simekc5587832020-08-19 09:59:52 +0200359 depends on DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200360 imply CMD_NAND
361 help
362 This enables Nand driver support for Arasan nand flash
363 controller. This uses the hardware ECC for read and
364 write operations.
365
366config NAND_MXC
367 bool "MXC NAND support"
368 depends on CPU_ARM926EJS || CPU_ARM1136 || MX5
369 imply CMD_NAND
370 help
371 This enables the NAND driver for the NAND flash controller on the
Haolin Lie8df55b2021-07-18 10:13:39 +0800372 i.MX27 / i.MX31 / i.MX5 processors.
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200373
374config NAND_MXS
375 bool "MXS NAND support"
Peng Fan128abf42020-05-04 22:09:00 +0800376 depends on MX23 || MX28 || MX6 || MX7 || IMX8 || IMX8M
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200377 select SYS_NAND_SELF_INIT
378 imply CMD_NAND
379 select APBH_DMA
Peng Fan128abf42020-05-04 22:09:00 +0800380 select APBH_DMA_BURST if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
381 select APBH_DMA_BURST8 if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200382 help
383 This enables NAND driver for the NAND flash controller on the
384 MXS processors.
385
386if NAND_MXS
387
388config NAND_MXS_DT
389 bool "Support MXS NAND controller as a DT device"
Miquel Raynala903be42019-10-03 19:50:04 +0200390 depends on OF_CONTROL && DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200391 help
392 Enable the driver for MXS NAND flash on platforms using
393 device tree.
394
395config NAND_MXS_USE_MINIMUM_ECC
396 bool "Use minimum ECC strength supported by the controller"
397 default false
398
399endif
400
401config NAND_ZYNQ
402 bool "Support for Zynq Nand controller"
403 select SYS_NAND_SELF_INIT
Ashok Reddy Somabb8448a2019-12-27 04:47:12 -0700404 select DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200405 imply CMD_NAND
406 help
407 This enables Nand driver support for Nand flash controller
408 found on Zynq SoC.
409
410config NAND_ZYNQ_USE_BOOTLOADER1_TIMINGS
411 bool "Enable use of 1st stage bootloader timing for NAND"
412 depends on NAND_ZYNQ
413 help
414 This flag prevent U-boot reconfigure NAND flash controller and reuse
415 the NAND timing from 1st stage bootloader.
416
Suneel Garapati9de7d2b2020-08-26 14:37:22 +0200417config NAND_OCTEONTX
418 bool "Support for OcteonTX NAND controller"
419 select SYS_NAND_SELF_INIT
420 imply CMD_NAND
421 help
422 This enables Nand flash controller hardware found on the OcteonTX
423 processors.
424
425config NAND_OCTEONTX_HW_ECC
426 bool "Support Hardware ECC for OcteonTX NAND controller"
427 depends on NAND_OCTEONTX
428 default y
429 help
430 This enables Hardware BCH engine found on the OcteonTX processors to
431 support ECC for NAND flash controller.
432
Christophe Kerelloda141682019-04-05 11:41:50 +0200433config NAND_STM32_FMC2
434 bool "Support for NAND controller on STM32MP SoCs"
435 depends on ARCH_STM32MP
436 select SYS_NAND_SELF_INIT
437 imply CMD_NAND
438 help
439 Enables support for NAND Flash chips on SoCs containing the FMC2
440 NAND controller. This controller is found on STM32MP SoCs.
441 The controller supports a maximum 8k page size and supports
442 a maximum 8-bit correction error per sector of 512 bytes.
443
Kate Liu41ccd2e2020-12-11 13:46:12 -0800444config CORTINA_NAND
445 bool "Support for NAND controller on Cortina-Access SoCs"
446 depends on CORTINA_PLATFORM
447 select SYS_NAND_SELF_INIT
448 select DM_MTD
449 imply CMD_NAND
450 help
451 Enables support for NAND Flash chips on Coartina-Access SoCs platform
452 This controller is found on Presidio/Venus SoCs.
453 The controller supports a maximum 8k page size and supports
454 a maximum 40-bit error correction per sector of 1024 bytes.
455
Yifeng Zhao9e9021e2021-06-07 16:40:29 +0800456config ROCKCHIP_NAND
457 bool "Support for NAND controller on Rockchip SoCs"
458 depends on ARCH_ROCKCHIP
459 select SYS_NAND_SELF_INIT
460 select DM_MTD
461 imply CMD_NAND
462 help
463 Enables support for NAND Flash chips on Rockchip SoCs platform.
464 This controller is found on Rockchip SoCs.
465 There are four different versions of NAND FLASH Controllers,
466 including:
467 NFC v600: RK2928, RK3066, RK3188
468 NFC v622: RK3036, RK3128
469 NFC v800: RK3308, RV1108
470 NFC v900: PX30, RK3326
471
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200472comment "Generic NAND options"
473
474config SYS_NAND_BLOCK_SIZE
475 hex "NAND chip eraseblock size"
Tom Rinifae1dab2021-09-22 14:50:29 -0400476 depends on ARCH_SUNXI || SPL_NAND_SUPPORT || TPL_NAND_SUPPORT
477 depends on !NAND_MXS_DT && !NAND_DENALI_DT && !NAND_LPC32XX_MLC
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200478 help
479 Number of data bytes in one eraseblock for the NAND chip on the
480 board. This is the multiple of NAND_PAGE_SIZE and the number of
481 pages.
482
Tom Rinifdae0072021-09-22 14:50:34 -0400483config SYS_NAND_ONFI_DETECTION
484 bool "Enable detection of ONFI compliant devices during probe"
485 help
486 Enables detection of ONFI compliant devices during probe.
487 And fetching device parameters flashed on device, by parsing
488 ONFI parameter page.
489
Tom Rini2510a812021-09-22 14:50:30 -0400490config SYS_NAND_PAGE_COUNT
491 hex "NAND chip page count"
492 depends on SPL_NAND_SUPPORT && (NAND_ATMEL || NAND_MXC || \
493 SPL_NAND_AM33XX_BCH || SPL_NAND_LOAD || SPL_NAND_SIMPLE)
494 help
495 Number of pages in the NAND chip.
496
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200497config SYS_NAND_PAGE_SIZE
498 hex "NAND chip page size"
Tom Rinifae1dab2021-09-22 14:50:29 -0400499 depends on ARCH_SUNXI || NAND_OMAP_GPMC || NAND_LPC32XX_SLC || \
500 SPL_NAND_SIMPLE || (NAND_MXC && SPL_NAND_SUPPORT) || \
501 (NAND_ATMEL && SPL_NAND_SUPPORT) || SPL_GENERATE_ATMEL_PMECC_HEADER
502 depends on !NAND_MXS_DT && !NAND_DENALI_DT && !NAND_LPC32XX_MLC
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200503 help
504 Number of data bytes in one page for the NAND chip on the
505 board, not including the OOB area.
506
507config SYS_NAND_OOBSIZE
508 hex "NAND chip OOB size"
Tom Rinifae1dab2021-09-22 14:50:29 -0400509 depends on ARCH_SUNXI || NAND_OMAP_GPMC || NAND_LPC32XX_SLC || \
510 SPL_NAND_SIMPLE || (NAND_MXC && SPL_NAND_SUPPORT) || \
511 (NAND_ATMEL && SPL_NAND_SUPPORT) || SPL_GENERATE_ATMEL_PMECC_HEADER
512 depends on !NAND_MXS_DT && !NAND_DENALI_DT && !NAND_LPC32XX_MLC
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200513 help
514 Number of bytes in the Out-Of-Band area for the NAND chip on
515 the board.
516
517# Enhance depends when converting drivers to Kconfig which use this config
518# option (mxc_nand, ndfc, omap_gpmc).
519config SYS_NAND_BUSWIDTH_16BIT
520 bool "Use 16-bit NAND interface"
521 depends on NAND_VF610_NFC || NAND_OMAP_GPMC || NAND_MXC || ARCH_DAVINCI
522 help
523 Indicates that NAND device has 16-bit wide data-bus. In absence of this
524 config, bus-width of NAND device is assumed to be either 8-bit and later
525 determined by reading ONFI params.
526 Above config is useful when NAND device's bus-width information cannot
527 be determined from on-chip ONFI params, like in following scenarios:
528 - SPL boot does not support reading of ONFI parameters. This is done to
529 keep SPL code foot-print small.
530 - In current U-Boot flow using nand_init(), driver initialization
531 happens in board_nand_init() which is called before any device probe
532 (nand_scan_ident + nand_scan_tail), thus device's ONFI parameters are
533 not available while configuring controller. So a static CONFIG_NAND_xx
534 is needed to know the device's bus-width in advance.
535
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200536if SPL
537
Tom Rini8e6d9c72021-09-22 14:50:33 -0400538config SYS_NAND_5_ADDR_CYCLE
539 bool "Wait 5 address cycles during NAND commands"
540 depends on SPL_NAND_AM33XX_BCH || SPL_NAND_SIMPLE || \
541 (SPL_NAND_SUPPORT && NAND_ATMEL)
542 default y
543 help
544 Some controllers require waiting for 5 address cycles when issuing
545 some commands, on NAND chips larger than 128MiB.
546
Tom Rinia2fbd4a2021-09-22 14:50:32 -0400547choice
Tom Rinifdae0072021-09-22 14:50:34 -0400548 prompt "NAND bad block marker/indicator position in the OOB"
Tom Rinia2fbd4a2021-09-22 14:50:32 -0400549 depends on SPL_NAND_AM33XX_BCH || SPL_NAND_DENALI || SPL_NAND_SIMPLE || \
550 SPL_NAND_SUPPORT && (NAND_ATMEL || NAND_MXC)
551 default HAS_NAND_LARGE_BADBLOCK_POS
552 help
553 In the OOB, which position contains the badblock information.
554
555config HAS_NAND_LARGE_BADBLOCK_POS
556 bool "Set the bad block marker/indicator to the 'large' position"
557
558config HAS_NAND_SMALL_BADBLOCK_POS
559 bool "Set the bad block marker/indicator to the 'small' position"
560
561endchoice
562
563config SYS_NAND_BAD_BLOCK_POS
564 int
565 default 0 if HAS_NAND_LARGE_BADBLOCK_POS
566 default 5 if HAS_NAND_SMALL_BADBLOCK_POS
567
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200568config SYS_NAND_U_BOOT_LOCATIONS
569 bool "Define U-boot binaries locations in NAND"
570 help
571 Enable CONFIG_SYS_NAND_U_BOOT_OFFS though Kconfig.
572 This option should not be enabled when compiling U-boot for boards
573 defining CONFIG_SYS_NAND_U_BOOT_OFFS in their include/configs/<board>.h
574 file.
575
576config SYS_NAND_U_BOOT_OFFS
577 hex "Location in NAND to read U-Boot from"
578 default 0x800000 if NAND_SUNXI
579 depends on SYS_NAND_U_BOOT_LOCATIONS
580 help
581 Set the offset from the start of the nand where u-boot should be
582 loaded from.
583
584config SYS_NAND_U_BOOT_OFFS_REDUND
585 hex "Location in NAND to read U-Boot from"
586 default SYS_NAND_U_BOOT_OFFS
587 depends on SYS_NAND_U_BOOT_LOCATIONS
588 help
589 Set the offset from the start of the nand where the redundant u-boot
590 should be loaded from.
591
592config SPL_NAND_AM33XX_BCH
593 bool "Enables SPL-NAND driver which supports ELM based"
594 depends on NAND_OMAP_GPMC && !OMAP34XX
595 default y
596 help
597 Hardware ECC correction. This is useful for platforms which have ELM
598 hardware engine and use NAND boot mode.
599 Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
600 so those platforms should use CONFIG_SPL_NAND_SIMPLE for enabling
601 SPL-NAND driver with software ECC correction support.
602
603config SPL_NAND_DENALI
604 bool "Support Denali NAND controller for SPL"
605 help
606 This is a small implementation of the Denali NAND controller
607 for use on SPL.
608
Masahiro Yamada64648cb2020-04-17 16:51:42 +0900609config NAND_DENALI_SPARE_AREA_SKIP_BYTES
610 int "Number of bytes skipped in OOB area"
611 depends on SPL_NAND_DENALI
612 range 0 63
613 help
614 This option specifies the number of bytes to skip from the beginning
615 of OOB area before last ECC sector data starts. This is potentially
616 used to preserve the bad block marker in the OOB area.
617
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200618config SPL_NAND_SIMPLE
619 bool "Use simple SPL NAND driver"
620 depends on !SPL_NAND_AM33XX_BCH
621 help
622 Support for NAND boot using simple NAND drivers that
623 expose the cmd_ctrl() interface.
624endif
625
626endif # if NAND