blob: 160b599b346442235bffe7abc2bbeb96cbe1633d [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"
34 default n
35
36config ATMEL_NAND_HW_PMECC
37 bool "Atmel Programmable Multibit ECC (PMECC)"
38 select ATMEL_NAND_HWECC
39 default n
40 help
41 The Programmable Multibit ECC (PMECC) controller is a programmable
42 binary BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder.
43
44config PMECC_CAP
45 int "PMECC Correctable ECC Bits"
46 depends on ATMEL_NAND_HW_PMECC
47 default 2
48 help
49 Correctable ECC bits, can be 2, 4, 8, 12, and 24.
50
51config PMECC_SECTOR_SIZE
52 int "PMECC Sector Size"
53 depends on ATMEL_NAND_HW_PMECC
54 default 512
55 help
56 Sector size, in bytes, can be 512 or 1024.
57
58config SPL_GENERATE_ATMEL_PMECC_HEADER
59 bool "Atmel PMECC Header Generation"
60 select ATMEL_NAND_HWECC
61 select ATMEL_NAND_HW_PMECC
62 default n
63 help
64 Generate Programmable Multibit ECC (PMECC) header for SPL image.
65
66endif
67
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010068config NAND_BRCMNAND
69 bool "Support Broadcom NAND controller"
Miquel Raynala903be42019-10-03 19:50:04 +020070 depends on OF_CONTROL && DM && DM_MTD
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010071 help
72 Enable the driver for NAND flash on platforms using a Broadcom NAND
73 controller.
74
Álvaro Fernández Rojasd9f9bfc2019-08-28 19:12:15 +020075config NAND_BRCMNAND_6368
76 bool "Support Broadcom NAND controller on bcm6368"
77 depends on NAND_BRCMNAND && ARCH_BMIPS
78 help
79 Enable support for broadcom nand driver on bcm6368.
80
Philippe Reynes74ead742020-01-07 20:14:13 +010081config NAND_BRCMNAND_68360
82 bool "Support Broadcom NAND controller on bcm68360"
83 depends on NAND_BRCMNAND && ARCH_BCM68360
84 help
85 Enable support for broadcom nand driver on bcm68360.
86
Philippe Reynes5aa6cfb2019-03-15 15:14:36 +010087config NAND_BRCMNAND_6838
88 bool "Support Broadcom NAND controller on bcm6838"
89 depends on NAND_BRCMNAND && ARCH_BMIPS && SOC_BMIPS_BCM6838
90 help
91 Enable support for broadcom nand driver on bcm6838.
92
93config NAND_BRCMNAND_6858
94 bool "Support Broadcom NAND controller on bcm6858"
95 depends on NAND_BRCMNAND && ARCH_BCM6858
96 help
97 Enable support for broadcom nand driver on bcm6858.
98
99config NAND_BRCMNAND_63158
100 bool "Support Broadcom NAND controller on bcm63158"
101 depends on NAND_BRCMNAND && ARCH_BCM63158
102 help
103 Enable support for broadcom nand driver on bcm63158.
104
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200105config NAND_DAVINCI
106 bool "Support TI Davinci NAND controller"
107 help
108 Enable this driver for NAND flash controllers available in TI Davinci
109 and Keystone2 platforms
110
111config NAND_DENALI
112 bool
113 select SYS_NAND_SELF_INIT
114 imply CMD_NAND
115
116config NAND_DENALI_DT
117 bool "Support Denali NAND controller as a DT device"
118 select NAND_DENALI
Masahiro Yamada8fc53822020-01-30 22:07:59 +0900119 depends on OF_CONTROL && DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200120 help
121 Enable the driver for NAND flash on platforms using a Denali NAND
122 controller as a DT device.
123
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200124config NAND_LPC32XX_SLC
125 bool "Support LPC32XX_SLC controller"
126 help
127 Enable the LPC32XX SLC NAND controller.
128
129config NAND_OMAP_GPMC
130 bool "Support OMAP GPMC NAND controller"
131 depends on ARCH_OMAP2PLUS
132 help
133 Enables omap_gpmc.c driver for OMAPx and AMxxxx platforms.
134 GPMC controller is used for parallel NAND flash devices, and can
135 do ECC calculation (not ECC error detection) for HAM1, BCH4, BCH8
136 and BCH16 ECC algorithms.
137
138config NAND_OMAP_GPMC_PREFETCH
139 bool "Enable GPMC Prefetch"
140 depends on NAND_OMAP_GPMC
141 default y
142 help
143 On OMAP platforms that use the GPMC controller
144 (CONFIG_NAND_OMAP_GPMC_PREFETCH), this options enables the code that
145 uses the prefetch mode to speed up read operations.
146
147config NAND_OMAP_ELM
148 bool "Enable ELM driver for OMAPxx and AMxx platforms."
149 depends on NAND_OMAP_GPMC && !OMAP34XX
150 help
151 ELM controller is used for ECC error detection (not ECC calculation)
152 of BCH4, BCH8 and BCH16 ECC algorithms.
153 Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
154 thus such SoC platforms need to depend on software library for ECC error
155 detection. However ECC calculation on such plaforms would still be
156 done by GPMC controller.
157
158config NAND_VF610_NFC
159 bool "Support for Freescale NFC for VF610"
160 select SYS_NAND_SELF_INIT
Stefan Agnerbd186142018-12-06 14:57:09 +0100161 select SYS_NAND_DRIVER_ECC_LAYOUT
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200162 imply CMD_NAND
163 help
164 Enables support for NAND Flash Controller on some Freescale
165 processors like the VF610, MCF54418 or Kinetis K70.
166 The driver supports a maximum 2k page size. The driver
167 currently does not support hardware ECC.
168
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100169if NAND_VF610_NFC
170
171config NAND_VF610_NFC_DT
172 bool "Support Vybrid's vf610 NAND controller as a DT device"
Miquel Raynala903be42019-10-03 19:50:04 +0200173 depends on OF_CONTROL && DM_MTD
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100174 help
175 Enable the driver for Vybrid's vf610 NAND flash on platforms
176 using device tree.
177
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200178choice
179 prompt "Hardware ECC strength"
180 depends on NAND_VF610_NFC
181 default SYS_NAND_VF610_NFC_45_ECC_BYTES
182 help
183 Select the ECC strength used in the hardware BCH ECC block.
184
185config SYS_NAND_VF610_NFC_45_ECC_BYTES
186 bool "24-error correction (45 ECC bytes)"
187
188config SYS_NAND_VF610_NFC_60_ECC_BYTES
189 bool "32-error correction (60 ECC bytes)"
190
191endchoice
192
Lukasz Majewskif006cb32018-12-03 10:24:50 +0100193endif
194
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200195config NAND_PXA3XX
196 bool "Support for NAND on PXA3xx and Armada 370/XP/38x"
197 select SYS_NAND_SELF_INIT
Shmuel Hazan759349e2020-10-29 08:52:18 +0200198 select DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200199 imply CMD_NAND
200 help
201 This enables the driver for the NAND flash device found on
202 PXA3xx processors (NFCv1) and also on Armada 370/XP (NFCv2).
203
204config NAND_SUNXI
205 bool "Support for NAND on Allwinner SoCs"
206 default ARCH_SUNXI
207 depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I
208 select SYS_NAND_SELF_INIT
209 select SYS_NAND_U_BOOT_LOCATIONS
210 select SPL_NAND_SUPPORT
211 imply CMD_NAND
212 ---help---
213 Enable support for NAND. This option enables the standard and
214 SPL drivers.
215 The SPL driver only supports reading from the NAND using DMA
216 transfers.
217
218if NAND_SUNXI
219
220config NAND_SUNXI_SPL_ECC_STRENGTH
221 int "Allwinner NAND SPL ECC Strength"
222 default 64
223
224config NAND_SUNXI_SPL_ECC_SIZE
225 int "Allwinner NAND SPL ECC Step Size"
226 default 1024
227
228config NAND_SUNXI_SPL_USABLE_PAGE_SIZE
229 int "Allwinner NAND SPL Usable Page Size"
230 default 1024
231
232endif
233
234config NAND_ARASAN
235 bool "Configure Arasan Nand"
236 select SYS_NAND_SELF_INIT
Michal Simekc5587832020-08-19 09:59:52 +0200237 depends on DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200238 imply CMD_NAND
239 help
240 This enables Nand driver support for Arasan nand flash
241 controller. This uses the hardware ECC for read and
242 write operations.
243
244config NAND_MXC
245 bool "MXC NAND support"
246 depends on CPU_ARM926EJS || CPU_ARM1136 || MX5
247 imply CMD_NAND
248 help
249 This enables the NAND driver for the NAND flash controller on the
250 i.MX27 / i.MX31 / i.MX5 rocessors.
251
252config NAND_MXS
253 bool "MXS NAND support"
Peng Fan128abf42020-05-04 22:09:00 +0800254 depends on MX23 || MX28 || MX6 || MX7 || IMX8 || IMX8M
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200255 select SYS_NAND_SELF_INIT
256 imply CMD_NAND
257 select APBH_DMA
Peng Fan128abf42020-05-04 22:09:00 +0800258 select APBH_DMA_BURST if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
259 select APBH_DMA_BURST8 if ARCH_MX6 || ARCH_MX7 || ARCH_IMX8 || ARCH_IMX8M
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200260 help
261 This enables NAND driver for the NAND flash controller on the
262 MXS processors.
263
264if NAND_MXS
265
266config NAND_MXS_DT
267 bool "Support MXS NAND controller as a DT device"
Miquel Raynala903be42019-10-03 19:50:04 +0200268 depends on OF_CONTROL && DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200269 help
270 Enable the driver for MXS NAND flash on platforms using
271 device tree.
272
273config NAND_MXS_USE_MINIMUM_ECC
274 bool "Use minimum ECC strength supported by the controller"
275 default false
276
277endif
278
279config NAND_ZYNQ
280 bool "Support for Zynq Nand controller"
281 select SYS_NAND_SELF_INIT
Ashok Reddy Somabb8448a2019-12-27 04:47:12 -0700282 select DM_MTD
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200283 imply CMD_NAND
284 help
285 This enables Nand driver support for Nand flash controller
286 found on Zynq SoC.
287
288config NAND_ZYNQ_USE_BOOTLOADER1_TIMINGS
289 bool "Enable use of 1st stage bootloader timing for NAND"
290 depends on NAND_ZYNQ
291 help
292 This flag prevent U-boot reconfigure NAND flash controller and reuse
293 the NAND timing from 1st stage bootloader.
294
Suneel Garapati9de7d2b2020-08-26 14:37:22 +0200295config NAND_OCTEONTX
296 bool "Support for OcteonTX NAND controller"
297 select SYS_NAND_SELF_INIT
298 imply CMD_NAND
299 help
300 This enables Nand flash controller hardware found on the OcteonTX
301 processors.
302
303config NAND_OCTEONTX_HW_ECC
304 bool "Support Hardware ECC for OcteonTX NAND controller"
305 depends on NAND_OCTEONTX
306 default y
307 help
308 This enables Hardware BCH engine found on the OcteonTX processors to
309 support ECC for NAND flash controller.
310
Christophe Kerelloda141682019-04-05 11:41:50 +0200311config NAND_STM32_FMC2
312 bool "Support for NAND controller on STM32MP SoCs"
313 depends on ARCH_STM32MP
314 select SYS_NAND_SELF_INIT
315 imply CMD_NAND
316 help
317 Enables support for NAND Flash chips on SoCs containing the FMC2
318 NAND controller. This controller is found on STM32MP SoCs.
319 The controller supports a maximum 8k page size and supports
320 a maximum 8-bit correction error per sector of 512 bytes.
321
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200322comment "Generic NAND options"
323
324config SYS_NAND_BLOCK_SIZE
325 hex "NAND chip eraseblock size"
326 depends on ARCH_SUNXI
327 help
328 Number of data bytes in one eraseblock for the NAND chip on the
329 board. This is the multiple of NAND_PAGE_SIZE and the number of
330 pages.
331
332config SYS_NAND_PAGE_SIZE
333 hex "NAND chip page size"
334 depends on ARCH_SUNXI
335 help
336 Number of data bytes in one page for the NAND chip on the
337 board, not including the OOB area.
338
339config SYS_NAND_OOBSIZE
340 hex "NAND chip OOB size"
341 depends on ARCH_SUNXI
342 help
343 Number of bytes in the Out-Of-Band area for the NAND chip on
344 the board.
345
346# Enhance depends when converting drivers to Kconfig which use this config
347# option (mxc_nand, ndfc, omap_gpmc).
348config SYS_NAND_BUSWIDTH_16BIT
349 bool "Use 16-bit NAND interface"
350 depends on NAND_VF610_NFC || NAND_OMAP_GPMC || NAND_MXC || ARCH_DAVINCI
351 help
352 Indicates that NAND device has 16-bit wide data-bus. In absence of this
353 config, bus-width of NAND device is assumed to be either 8-bit and later
354 determined by reading ONFI params.
355 Above config is useful when NAND device's bus-width information cannot
356 be determined from on-chip ONFI params, like in following scenarios:
357 - SPL boot does not support reading of ONFI parameters. This is done to
358 keep SPL code foot-print small.
359 - In current U-Boot flow using nand_init(), driver initialization
360 happens in board_nand_init() which is called before any device probe
361 (nand_scan_ident + nand_scan_tail), thus device's ONFI parameters are
362 not available while configuring controller. So a static CONFIG_NAND_xx
363 is needed to know the device's bus-width in advance.
364
T Karthik Reddy7cd85222018-12-03 16:11:58 +0530365config SYS_NAND_MAX_CHIPS
366 int "NAND max chips"
367 default 1
368 depends on NAND_ARASAN
369 help
370 The maximum number of NAND chips per device to be supported.
371
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200372if SPL
373
374config SYS_NAND_U_BOOT_LOCATIONS
375 bool "Define U-boot binaries locations in NAND"
376 help
377 Enable CONFIG_SYS_NAND_U_BOOT_OFFS though Kconfig.
378 This option should not be enabled when compiling U-boot for boards
379 defining CONFIG_SYS_NAND_U_BOOT_OFFS in their include/configs/<board>.h
380 file.
381
382config SYS_NAND_U_BOOT_OFFS
383 hex "Location in NAND to read U-Boot from"
384 default 0x800000 if NAND_SUNXI
385 depends on SYS_NAND_U_BOOT_LOCATIONS
386 help
387 Set the offset from the start of the nand where u-boot should be
388 loaded from.
389
390config SYS_NAND_U_BOOT_OFFS_REDUND
391 hex "Location in NAND to read U-Boot from"
392 default SYS_NAND_U_BOOT_OFFS
393 depends on SYS_NAND_U_BOOT_LOCATIONS
394 help
395 Set the offset from the start of the nand where the redundant u-boot
396 should be loaded from.
397
398config SPL_NAND_AM33XX_BCH
399 bool "Enables SPL-NAND driver which supports ELM based"
400 depends on NAND_OMAP_GPMC && !OMAP34XX
401 default y
402 help
403 Hardware ECC correction. This is useful for platforms which have ELM
404 hardware engine and use NAND boot mode.
405 Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
406 so those platforms should use CONFIG_SPL_NAND_SIMPLE for enabling
407 SPL-NAND driver with software ECC correction support.
408
409config SPL_NAND_DENALI
410 bool "Support Denali NAND controller for SPL"
411 help
412 This is a small implementation of the Denali NAND controller
413 for use on SPL.
414
Masahiro Yamada64648cb2020-04-17 16:51:42 +0900415config NAND_DENALI_SPARE_AREA_SKIP_BYTES
416 int "Number of bytes skipped in OOB area"
417 depends on SPL_NAND_DENALI
418 range 0 63
419 help
420 This option specifies the number of bytes to skip from the beginning
421 of OOB area before last ECC sector data starts. This is potentially
422 used to preserve the bad block marker in the OOB area.
423
Miquel Raynal1f1ae152018-08-16 17:30:07 +0200424config SPL_NAND_SIMPLE
425 bool "Use simple SPL NAND driver"
426 depends on !SPL_NAND_AM33XX_BCH
427 help
428 Support for NAND boot using simple NAND drivers that
429 expose the cmd_ctrl() interface.
430endif
431
432endif # if NAND