Convert CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST to Kconfig
[platform/kernel/u-boot.git] / drivers / mtd / nand / raw / Kconfig
1
2 menuconfig MTD_RAW_NAND
3         bool "Raw NAND Device Support"
4 if MTD_RAW_NAND
5
6 config SYS_NAND_SELF_INIT
7         bool
8         help
9           This option, if enabled, provides more flexible and linux-like
10           NAND initialization process.
11
12 config 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
19 config 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
26 config TPL_NAND_INIT
27         bool
28
29 config SYS_MAX_NAND_DEVICE
30         int "Maximum number of NAND devices to support"
31         default 1
32
33 config SYS_NAND_DRIVER_ECC_LAYOUT
34         bool "Omit standard ECC layouts to save space"
35         help
36           Omit standard ECC layouts to save space. Select this if your driver
37           is known to provide its own ECC layout.
38
39 config SYS_NAND_USE_FLASH_BBT
40         bool "Enable BBT (Bad Block Table) support"
41         help
42           Enable the BBT (Bad Block Table) usage.
43
44 config NAND_ATMEL
45         bool "Support Atmel NAND controller"
46         select SYS_NAND_SELF_INIT
47         imply SYS_NAND_USE_FLASH_BBT
48         help
49           Enable this driver for NAND flash platforms using an Atmel NAND
50           controller.
51
52 if NAND_ATMEL
53
54 config ATMEL_NAND_HWECC
55         bool "Atmel Hardware ECC"
56
57 config ATMEL_NAND_HW_PMECC
58         bool "Atmel Programmable Multibit ECC (PMECC)"
59         select ATMEL_NAND_HWECC
60         help
61           The Programmable Multibit ECC (PMECC) controller is a programmable
62           binary BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder.
63
64 config PMECC_CAP
65         int "PMECC Correctable ECC Bits"
66         depends on ATMEL_NAND_HW_PMECC
67         default 2
68         help
69           Correctable ECC bits, can be 2, 4, 8, 12, and 24.
70
71 config PMECC_SECTOR_SIZE
72         int "PMECC Sector Size"
73         depends on ATMEL_NAND_HW_PMECC
74         default 512
75         help
76           Sector size, in bytes, can be 512 or 1024.
77
78 config SPL_GENERATE_ATMEL_PMECC_HEADER
79         bool "Atmel PMECC Header Generation"
80         depends on SPL
81         select ATMEL_NAND_HWECC
82         select ATMEL_NAND_HW_PMECC
83         help
84           Generate Programmable Multibit ECC (PMECC) header for SPL image.
85
86 endif
87
88 config NAND_BRCMNAND
89         bool "Support Broadcom NAND controller"
90         depends on OF_CONTROL && DM && DM_MTD
91         select SYS_NAND_SELF_INIT
92         help
93           Enable the driver for NAND flash on platforms using a Broadcom NAND
94           controller.
95
96 config NAND_BRCMNAND_6368
97         bool "Support Broadcom NAND controller on bcm6368"
98         depends on NAND_BRCMNAND && ARCH_BMIPS
99         help
100           Enable support for broadcom nand driver on bcm6368.
101
102 config NAND_BRCMNAND_6753
103         bool "Support Broadcom NAND controller on bcm6753"
104         depends on NAND_BRCMNAND && BCM6855
105         help
106           Enable support for broadcom nand driver on bcm6753.
107
108 config NAND_BRCMNAND_68360
109        bool "Support Broadcom NAND controller on bcm68360"
110        depends on NAND_BRCMNAND && BCM6856
111        help
112          Enable support for broadcom nand driver on bcm68360.
113
114 config NAND_BRCMNAND_6838
115        bool "Support Broadcom NAND controller on bcm6838"
116        depends on NAND_BRCMNAND && ARCH_BMIPS && SOC_BMIPS_BCM6838
117        help
118          Enable support for broadcom nand driver on bcm6838.
119
120 config NAND_BRCMNAND_6858
121        bool "Support Broadcom NAND controller on bcm6858"
122        depends on NAND_BRCMNAND && BCM6858
123        help
124          Enable support for broadcom nand driver on bcm6858.
125
126 config NAND_BRCMNAND_63158
127        bool "Support Broadcom NAND controller on bcm63158"
128        depends on NAND_BRCMNAND && BCM63158
129        help
130          Enable support for broadcom nand driver on bcm63158.
131
132 config NAND_DAVINCI
133         bool "Support TI Davinci NAND controller"
134         select SYS_NAND_SELF_INIT if TARGET_DA850EVM
135         help
136           Enable this driver for NAND flash controllers available in TI Davinci
137           and Keystone2 platforms
138
139 config SYS_NAND_4BIT_HW_ECC_OOBFIRST
140         bool "Use 4-bit HW ECC with OOB at the front"
141         depends on NAND_DAVINCI
142
143 config KEYSTONE_RBL_NAND
144         depends on ARCH_KEYSTONE
145         def_bool y
146
147 config SPL_NAND_LOAD
148         def_bool y
149         depends on NAND_DAVINCI && ARCH_DAVINCI && SPL_NAND_SUPPORT
150
151 config NAND_DENALI
152         bool
153         select SYS_NAND_SELF_INIT
154         imply CMD_NAND
155
156 config NAND_DENALI_DT
157         bool "Support Denali NAND controller as a DT device"
158         select NAND_DENALI
159         depends on OF_CONTROL && DM_MTD
160         help
161           Enable the driver for NAND flash on platforms using a Denali NAND
162           controller as a DT device.
163
164 config NAND_FSL_ELBC
165         bool "Support Freescale Enhanced Local Bus Controller FCM NAND driver"
166         select TPL_SYS_NAND_SELF_INIT if TPL_NAND_SUPPORT
167         select SPL_SYS_NAND_SELF_INIT
168         select SYS_NAND_SELF_INIT
169         depends on FSL_ELBC
170         help
171           Enable the Freescale Enhanced Local Bus Controller FCM NAND driver.
172
173 config NAND_FSL_ELBC_DT
174         bool "Support Freescale Enhanced Local Bus Controller FCM NAND driver (DT mode)"
175         depends on NAND_FSL_ELBC
176
177 config NAND_FSL_IFC
178         bool "Support Freescale Integrated Flash Controller NAND driver"
179         select TPL_SYS_NAND_SELF_INIT if TPL_NAND_SUPPORT
180         select TPL_NAND_INIT if TPL && !TPL_FRAMEWORK
181         select SPL_SYS_NAND_SELF_INIT
182         select SYS_NAND_SELF_INIT
183         select FSL_IFC
184         help
185           Enable the Freescale Integrated Flash Controller NAND driver.
186
187 config NAND_LPC32XX_MLC
188         bool "Support LPC32XX_MLC controller"
189         select SYS_NAND_SELF_INIT
190         help
191           Enable the LPC32XX MLC NAND controller.
192
193 config NAND_LPC32XX_SLC
194         bool "Support LPC32XX_SLC controller"
195         help
196           Enable the LPC32XX SLC NAND controller.
197
198 config NAND_OMAP_GPMC
199         bool "Support OMAP GPMC NAND controller"
200         depends on ARCH_OMAP2PLUS
201         help
202           Enables omap_gpmc.c driver for OMAPx and AMxxxx platforms.
203           GPMC controller is used for parallel NAND flash devices, and can
204           do ECC calculation (not ECC error detection) for HAM1, BCH4, BCH8
205           and BCH16 ECC algorithms.
206
207 if NAND_OMAP_GPMC
208
209 config NAND_OMAP_GPMC_PREFETCH
210         bool "Enable GPMC Prefetch"
211         default y
212         help
213           On OMAP platforms that use the GPMC controller
214           (CONFIG_NAND_OMAP_GPMC_PREFETCH), this options enables the code that
215           uses the prefetch mode to speed up read operations.
216
217 config NAND_OMAP_ELM
218         bool "Enable ELM driver for OMAPxx and AMxx platforms."
219         depends on !OMAP34XX
220         help
221           ELM controller is used for ECC error detection (not ECC calculation)
222           of BCH4, BCH8 and BCH16 ECC algorithms.
223           Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
224           thus such SoC platforms need to depend on software library for ECC error
225           detection. However ECC calculation on such plaforms would still be
226           done by GPMC controller.
227
228 choice
229         prompt "ECC scheme"
230         default NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
231         help
232         On OMAP platforms, this CONFIG specifies NAND ECC scheme.
233         It can take following values:
234         OMAP_ECC_HAM1_CODE_SW
235                 1-bit Hamming code using software lib.
236                 (for legacy devices only)
237         OMAP_ECC_HAM1_CODE_HW
238                 1-bit Hamming code using GPMC hardware.
239                 (for legacy devices only)
240         OMAP_ECC_BCH4_CODE_HW_DETECTION_SW
241                 4-bit BCH code (unsupported)
242         OMAP_ECC_BCH4_CODE_HW
243                 4-bit BCH code (unsupported)
244         OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
245                 8-bit BCH code with
246                 - ecc calculation using GPMC hardware engine,
247                 - error detection using software library.
248                 - requires CONFIG_BCH to enable software BCH library
249                 (For legacy device which do not have ELM h/w engine)
250         OMAP_ECC_BCH8_CODE_HW
251                 8-bit BCH code with
252                 - ecc calculation using GPMC hardware engine,
253                 - error detection using ELM hardware engine.
254         OMAP_ECC_BCH16_CODE_HW
255                 16-bit BCH code with
256                 - ecc calculation using GPMC hardware engine,
257                 - error detection using ELM hardware engine.
258
259         How to select ECC scheme on OMAP and AMxx platforms ?
260         -----------------------------------------------------
261         Though higher ECC schemes have more capability to detect and correct
262         bit-flips, but still selection of ECC scheme is dependent on following
263         - hardware engines present in SoC.
264                 Some legacy OMAP SoC do not have ELM h/w engine thus such
265                 SoC cannot support BCHx_HW ECC schemes.
266         - size of OOB/Spare region
267                 With higher ECC schemes, more OOB/Spare area is required to
268                 store ECC. So choice of ECC scheme is limited by NAND oobsize.
269
270         In general following expression can help:
271                 NAND_OOBSIZE >= 2 + (NAND_PAGESIZE / 512) * ECC_BYTES
272         where
273                 NAND_OOBSIZE    = number of bytes available in
274                                 OOB/spare area per NAND page.
275                 NAND_PAGESIZE   = bytes in main-area of NAND page.
276                 ECC_BYTES       = number of ECC bytes generated to
277                                 protect 512 bytes of data, which is:
278                                 3 for HAM1_xx ecc schemes
279                                 7 for BCH4_xx ecc schemes
280                                 14 for BCH8_xx ecc schemes
281                                 26 for BCH16_xx ecc schemes
282
283                 example to check for BCH16 on 2K page NAND
284                 NAND_PAGESIZE = 2048
285                 NAND_OOBSIZE = 64
286                 2 + (2048 / 512) * 26 = 106 > NAND_OOBSIZE
287                 Thus BCH16 cannot be supported on 2K page NAND.
288
289                 However, for 4K pagesize NAND
290                 NAND_PAGESIZE = 4096
291                 NAND_OOBSIZE = 224
292                 ECC_BYTES = 26
293                 2 + (4096 / 512) * 26 = 210 < NAND_OOBSIZE
294                 Thus BCH16 can be supported on 4K page NAND.
295
296 config NAND_OMAP_ECCSCHEME_HAM1_CODE_SW
297         bool "1-bit Hamming code using software lib"
298
299 config NAND_OMAP_ECCSCHEME_HAM1_CODE_HW
300         bool "1-bit Hamming code using GPMC hardware"
301
302 config NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW
303         bool "8-bit BCH code with HW calculation SW error detection"
304
305 config NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
306         bool "8-bit BCH code with HW calculation and error detection"
307
308 config NAND_OMAP_ECCSCHEME_BCH16_CODE_HW
309         bool "16-bit BCH code with HW calculation and error detection"
310
311 endchoice
312
313 config NAND_OMAP_ECCSCHEME
314         int
315         default 1 if NAND_OMAP_ECCSCHEME_HAM1_CODE_SW
316         default 2 if NAND_OMAP_ECCSCHEME_HAM1_CODE_HW
317         default 5 if NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW
318         default 6 if NAND_OMAP_ECCSCHEME_BCH8_CODE_HW
319         default 7 if NAND_OMAP_ECCSCHEME_BCH16_CODE_HW
320         help
321           This must be kept in sync with the enum in
322           include/linux/mtd/omap_gpmc.h
323
324 endif
325
326 config NAND_VF610_NFC
327         bool "Support for Freescale NFC for VF610"
328         select SYS_NAND_SELF_INIT
329         select SYS_NAND_DRIVER_ECC_LAYOUT
330         imply CMD_NAND
331         help
332           Enables support for NAND Flash Controller on some Freescale
333           processors like the VF610, MCF54418 or Kinetis K70.
334           The driver supports a maximum 2k page size. The driver
335           currently does not support hardware ECC.
336
337 if NAND_VF610_NFC
338
339 config NAND_VF610_NFC_DT
340         bool "Support Vybrid's vf610 NAND controller as a DT device"
341         depends on OF_CONTROL && DM_MTD
342         help
343           Enable the driver for Vybrid's vf610 NAND flash on platforms
344           using device tree.
345
346 choice
347         prompt "Hardware ECC strength"
348         depends on NAND_VF610_NFC
349         default SYS_NAND_VF610_NFC_45_ECC_BYTES
350         help
351           Select the ECC strength used in the hardware BCH ECC block.
352
353 config SYS_NAND_VF610_NFC_45_ECC_BYTES
354         bool "24-error correction (45 ECC bytes)"
355
356 config SYS_NAND_VF610_NFC_60_ECC_BYTES
357         bool "32-error correction (60 ECC bytes)"
358
359 endchoice
360
361 endif
362
363 config NAND_PXA3XX
364         bool "Support for NAND on PXA3xx and Armada 370/XP/38x"
365         select SYS_NAND_SELF_INIT
366         select DM_MTD
367         select REGMAP
368         select SYSCON
369         imply CMD_NAND
370         help
371           This enables the driver for the NAND flash device found on
372           PXA3xx processors (NFCv1) and also on Armada 370/XP (NFCv2).
373
374 config NAND_SUNXI
375         bool "Support for NAND on Allwinner SoCs"
376         default ARCH_SUNXI
377         depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I
378         select SYS_NAND_SELF_INIT
379         select SYS_NAND_U_BOOT_LOCATIONS
380         select SPL_NAND_SUPPORT
381         select SPL_SYS_NAND_SELF_INIT
382         imply CMD_NAND
383         ---help---
384         Enable support for NAND. This option enables the standard and
385         SPL drivers.
386         The SPL driver only supports reading from the NAND using DMA
387         transfers.
388
389 if NAND_SUNXI
390
391 config NAND_SUNXI_SPL_ECC_STRENGTH
392         int "Allwinner NAND SPL ECC Strength"
393         default 64
394
395 config NAND_SUNXI_SPL_ECC_SIZE
396         int "Allwinner NAND SPL ECC Step Size"
397         default 1024
398
399 config NAND_SUNXI_SPL_USABLE_PAGE_SIZE
400         int "Allwinner NAND SPL Usable Page Size"
401         default 1024
402
403 endif
404
405 config NAND_ARASAN
406         bool "Configure Arasan Nand"
407         select SYS_NAND_SELF_INIT
408         depends on DM_MTD
409         imply CMD_NAND
410         help
411           This enables Nand driver support for Arasan nand flash
412           controller. This uses the hardware ECC for read and
413           write operations.
414
415 config NAND_MXC
416         bool "MXC NAND support"
417         depends on CPU_ARM926EJS || CPU_ARM1136 || MX5
418         imply CMD_NAND
419         help
420           This enables the NAND driver for the NAND flash controller on the
421           i.MX27 / i.MX31 / i.MX5 processors.
422
423 config NAND_MXS
424         bool "MXS NAND support"
425         depends on MX23 || MX28 || MX6 || MX7 || IMX8 || IMX8M
426         select SPL_SYS_NAND_SELF_INIT
427         select SYS_NAND_SELF_INIT
428         imply CMD_NAND
429         select APBH_DMA
430         select APBH_DMA_BURST if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
431         select APBH_DMA_BURST8 if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
432         help
433           This enables NAND driver for the NAND flash controller on the
434           MXS processors.
435
436 if NAND_MXS
437
438 config NAND_MXS_DT
439         bool "Support MXS NAND controller as a DT device"
440         depends on OF_CONTROL && DM_MTD
441         help
442           Enable the driver for MXS NAND flash on platforms using
443           device tree.
444
445 config NAND_MXS_USE_MINIMUM_ECC
446         bool "Use minimum ECC strength supported by the controller"
447         default false
448
449 endif
450
451 config NAND_MXIC
452         bool "Macronix raw NAND controller"
453         select SYS_NAND_SELF_INIT
454         help
455           This selects the Macronix raw NAND controller driver.
456
457 config NAND_ZYNQ
458         bool "Support for Zynq Nand controller"
459         select SPL_SYS_NAND_SELF_INIT
460         select SYS_NAND_SELF_INIT
461         select DM_MTD
462         imply CMD_NAND
463         help
464           This enables Nand driver support for Nand flash controller
465           found on Zynq SoC.
466
467 config NAND_ZYNQ_USE_BOOTLOADER1_TIMINGS
468         bool "Enable use of 1st stage bootloader timing for NAND"
469         depends on NAND_ZYNQ
470         help
471           This flag prevent U-boot reconfigure NAND flash controller and reuse
472           the NAND timing from 1st stage bootloader.
473
474 config NAND_OCTEONTX
475         bool "Support for OcteonTX NAND controller"
476         select SYS_NAND_SELF_INIT
477         imply CMD_NAND
478         help
479          This enables Nand flash controller hardware found on the OcteonTX
480          processors.
481
482 config NAND_OCTEONTX_HW_ECC
483         bool "Support Hardware ECC for OcteonTX NAND controller"
484         depends on NAND_OCTEONTX
485         default y
486         help
487          This enables Hardware BCH engine found on the OcteonTX processors to
488          support ECC for NAND flash controller.
489
490 config NAND_STM32_FMC2
491         bool "Support for NAND controller on STM32MP SoCs"
492         depends on ARCH_STM32MP
493         select SYS_NAND_SELF_INIT
494         imply CMD_NAND
495         help
496           Enables support for NAND Flash chips on SoCs containing the FMC2
497           NAND controller. This controller is found on STM32MP SoCs.
498           The controller supports a maximum 8k page size and supports
499           a maximum 8-bit correction error per sector of 512 bytes.
500
501 config CORTINA_NAND
502         bool "Support for NAND controller on Cortina-Access SoCs"
503         depends on CORTINA_PLATFORM
504         select SYS_NAND_SELF_INIT
505         select DM_MTD
506         imply CMD_NAND
507         help
508           Enables support for NAND Flash chips on Coartina-Access SoCs platform
509           This controller is found on Presidio/Venus SoCs.
510           The controller supports a maximum 8k page size and supports
511           a maximum 40-bit error correction per sector of 1024 bytes.
512
513 config ROCKCHIP_NAND
514         bool "Support for NAND controller on Rockchip SoCs"
515         depends on ARCH_ROCKCHIP
516         select SYS_NAND_SELF_INIT
517         select DM_MTD
518         imply CMD_NAND
519         help
520           Enables support for NAND Flash chips on Rockchip SoCs platform.
521           This controller is found on Rockchip SoCs.
522           There are four different versions of NAND FLASH Controllers,
523           including:
524             NFC v600: RK2928, RK3066, RK3188
525             NFC v622: RK3036, RK3128
526             NFC v800: RK3308, RV1108
527             NFC v900: PX30, RK3326
528
529 config TEGRA_NAND
530         bool "Support for NAND controller on Tegra SoCs"
531         depends on ARCH_TEGRA
532         select SYS_NAND_SELF_INIT
533         imply CMD_NAND
534         help
535           Enables support for NAND Flash chips on Tegra SoCs platforms.
536
537 config NAND_MT7621
538         bool "Support for MediaTek MT7621 NAND flash controller"
539         depends on SOC_MT7621
540         select SYS_NAND_SELF_INIT
541         select SPL_SYS_NAND_SELF_INIT
542         imply CMD_NAND
543         help
544           This enables NAND driver for the NAND flash controller on MediaTek
545           MT7621 platform.
546           The controller supports 4~12 bits correction per 512 bytes with a
547           maximum 4KB page size.
548
549 comment "Generic NAND options"
550
551 config SYS_NAND_BLOCK_SIZE
552         hex "NAND chip eraseblock size"
553         depends on ARCH_SUNXI || SPL_NAND_SUPPORT || TPL_NAND_SUPPORT
554         depends on !NAND_MXS && !NAND_DENALI_DT && !NAND_LPC32XX_MLC && \
555                 !NAND_FSL_IFC && !NAND_MT7621
556         help
557           Number of data bytes in one eraseblock for the NAND chip on the
558           board. This is the multiple of NAND_PAGE_SIZE and the number of
559           pages.
560
561 config SYS_NAND_ONFI_DETECTION
562         bool "Enable detection of ONFI compliant devices during probe"
563         help
564           Enables detection of ONFI compliant devices during probe.
565           And fetching device parameters flashed on device, by parsing
566           ONFI parameter page.
567
568 config SYS_NAND_PAGE_COUNT
569         hex "NAND chip page count"
570         depends on SPL_NAND_SUPPORT && (NAND_ATMEL || NAND_MXC || \
571                 SPL_NAND_AM33XX_BCH || SPL_NAND_LOAD || SPL_NAND_SIMPLE)
572         help
573           Number of pages in the NAND chip.
574
575 config SYS_NAND_PAGE_SIZE
576         hex "NAND chip page size"
577         depends on ARCH_SUNXI || NAND_OMAP_GPMC || NAND_LPC32XX_SLC || \
578                 SPL_NAND_SIMPLE || (NAND_MXC && SPL_NAND_SUPPORT) || \
579                 (NAND_ATMEL && SPL_NAND_SUPPORT) || SPL_GENERATE_ATMEL_PMECC_HEADER
580         depends on !NAND_MXS && !NAND_DENALI_DT && !NAND_LPC32XX_MLC && !NAND_MT7621
581         help
582           Number of data bytes in one page for the NAND chip on the
583           board, not including the OOB area.
584
585 config SYS_NAND_OOBSIZE
586         hex "NAND chip OOB size"
587         depends on ARCH_SUNXI || NAND_OMAP_GPMC || NAND_LPC32XX_SLC || \
588                 SPL_NAND_SIMPLE || (NAND_MXC && SPL_NAND_SUPPORT) || \
589                 (NAND_ATMEL && SPL_NAND_SUPPORT) || SPL_GENERATE_ATMEL_PMECC_HEADER
590         depends on !NAND_MXS && !NAND_DENALI_DT && !NAND_LPC32XX_MLC
591         help
592           Number of bytes in the Out-Of-Band area for the NAND chip on
593           the board.
594
595 # Enhance depends when converting drivers to Kconfig which use this config
596 # option (mxc_nand, ndfc, omap_gpmc).
597 config SYS_NAND_BUSWIDTH_16BIT
598         bool "Use 16-bit NAND interface"
599         depends on NAND_VF610_NFC || NAND_OMAP_GPMC || NAND_MXC || ARCH_DAVINCI
600         help
601           Indicates that NAND device has 16-bit wide data-bus. In absence of this
602           config, bus-width of NAND device is assumed to be either 8-bit and later
603           determined by reading ONFI params.
604           Above config is useful when NAND device's bus-width information cannot
605           be determined from on-chip ONFI params, like in following scenarios:
606           - SPL boot does not support reading of ONFI parameters. This is done to
607             keep SPL code foot-print small.
608           - In current U-Boot flow using nand_init(), driver initialization
609             happens in board_nand_init() which is called before any device probe
610             (nand_scan_ident + nand_scan_tail), thus device's ONFI parameters are
611             not available while configuring controller. So a static CONFIG_NAND_xx
612             is needed to know the device's bus-width in advance.
613
614 if SPL
615
616 config SYS_NAND_5_ADDR_CYCLE
617         bool "Wait 5 address cycles during NAND commands"
618         depends on SPL_NAND_AM33XX_BCH || SPL_NAND_SIMPLE || \
619                 (SPL_NAND_SUPPORT && NAND_ATMEL)
620         default y
621         help
622           Some controllers require waiting for 5 address cycles when issuing
623           some commands, on NAND chips larger than 128MiB.
624
625 choice
626         prompt "NAND bad block marker/indicator position in the OOB"
627         depends on SPL_NAND_AM33XX_BCH || SPL_NAND_DENALI || SPL_NAND_SIMPLE || \
628                 SPL_NAND_SUPPORT && (NAND_ATMEL || NAND_MXC)
629         default HAS_NAND_LARGE_BADBLOCK_POS
630         help
631           In the OOB, which position contains the badblock information.
632
633 config HAS_NAND_LARGE_BADBLOCK_POS
634         bool "Set the bad block marker/indicator to the 'large' position"
635
636 config HAS_NAND_SMALL_BADBLOCK_POS
637         bool "Set the bad block marker/indicator to the 'small' position"
638
639 endchoice
640
641 config SYS_NAND_BAD_BLOCK_POS
642         int
643         default 0 if HAS_NAND_LARGE_BADBLOCK_POS
644         default 5 if HAS_NAND_SMALL_BADBLOCK_POS
645
646 config SYS_NAND_U_BOOT_LOCATIONS
647         bool "Define U-boot binaries locations in NAND"
648         help
649         Enable CONFIG_SYS_NAND_U_BOOT_OFFS though Kconfig.
650         This option should not be enabled when compiling U-boot for boards
651         defining CONFIG_SYS_NAND_U_BOOT_OFFS in their include/configs/<board>.h
652         file.
653
654 config SYS_NAND_U_BOOT_OFFS
655         hex "Location in NAND to read U-Boot from"
656         default 0x800000 if NAND_SUNXI
657         depends on SYS_NAND_U_BOOT_LOCATIONS
658         help
659         Set the offset from the start of the nand where u-boot should be
660         loaded from.
661
662 config SYS_NAND_U_BOOT_OFFS_REDUND
663         hex "Location in NAND to read U-Boot from"
664         default SYS_NAND_U_BOOT_OFFS
665         depends on SYS_NAND_U_BOOT_LOCATIONS
666         help
667         Set the offset from the start of the nand where the redundant u-boot
668         should be loaded from.
669
670 config SPL_NAND_AM33XX_BCH
671         bool "Enables SPL-NAND driver which supports ELM based"
672         depends on SPL_NAND_SUPPORT && NAND_OMAP_GPMC && !OMAP34XX
673         default y
674         help
675           Hardware ECC correction. This is useful for platforms which have ELM
676           hardware engine and use NAND boot mode.
677           Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
678           so those platforms should use CONFIG_SPL_NAND_SIMPLE for enabling
679           SPL-NAND driver with software ECC correction support.
680
681 config SPL_NAND_DENALI
682         bool "Support Denali NAND controller for SPL"
683         depends on SPL_NAND_SUPPORT
684         help
685           This is a small implementation of the Denali NAND controller
686           for use on SPL.
687
688 config NAND_DENALI_SPARE_AREA_SKIP_BYTES
689         int "Number of bytes skipped in OOB area"
690         depends on SPL_NAND_DENALI
691         range 0 63
692         help
693           This option specifies the number of bytes to skip from the beginning
694           of OOB area before last ECC sector data starts.  This is potentially
695           used to preserve the bad block marker in the OOB area.
696
697 config SPL_NAND_SIMPLE
698         bool "Use simple SPL NAND driver"
699         depends on !SPL_NAND_AM33XX_BCH && SPL_NAND_SUPPORT
700         help
701           Support for NAND boot using simple NAND drivers that
702           expose the cmd_ctrl() interface.
703 endif
704
705 endif   # if NAND