xref: /openbmc/u-boot/drivers/mtd/nand/raw/Kconfig (revision a430fa06a4ac50e785fdbfb7f43c3cb14b35619c)
1*a430fa06SMiquel Raynal
2*a430fa06SMiquel Raynalmenuconfig NAND
3*a430fa06SMiquel Raynal	bool "NAND Device Support"
4*a430fa06SMiquel Raynalif NAND
5*a430fa06SMiquel Raynal
6*a430fa06SMiquel Raynalconfig SYS_NAND_SELF_INIT
7*a430fa06SMiquel Raynal	bool
8*a430fa06SMiquel Raynal	help
9*a430fa06SMiquel Raynal	  This option, if enabled, provides more flexible and linux-like
10*a430fa06SMiquel Raynal	  NAND initialization process.
11*a430fa06SMiquel Raynal
12*a430fa06SMiquel Raynalconfig NAND_ATMEL
13*a430fa06SMiquel Raynal	bool "Support Atmel NAND controller"
14*a430fa06SMiquel Raynal	imply SYS_NAND_USE_FLASH_BBT
15*a430fa06SMiquel Raynal	help
16*a430fa06SMiquel Raynal	  Enable this driver for NAND flash platforms using an Atmel NAND
17*a430fa06SMiquel Raynal	  controller.
18*a430fa06SMiquel Raynal
19*a430fa06SMiquel Raynalconfig NAND_DAVINCI
20*a430fa06SMiquel Raynal	bool "Support TI Davinci NAND controller"
21*a430fa06SMiquel Raynal	help
22*a430fa06SMiquel Raynal	  Enable this driver for NAND flash controllers available in TI Davinci
23*a430fa06SMiquel Raynal	  and Keystone2 platforms
24*a430fa06SMiquel Raynal
25*a430fa06SMiquel Raynalconfig NAND_DENALI
26*a430fa06SMiquel Raynal	bool
27*a430fa06SMiquel Raynal	select SYS_NAND_SELF_INIT
28*a430fa06SMiquel Raynal	imply CMD_NAND
29*a430fa06SMiquel Raynal
30*a430fa06SMiquel Raynalconfig NAND_DENALI_DT
31*a430fa06SMiquel Raynal	bool "Support Denali NAND controller as a DT device"
32*a430fa06SMiquel Raynal	select NAND_DENALI
33*a430fa06SMiquel Raynal	depends on OF_CONTROL && DM
34*a430fa06SMiquel Raynal	help
35*a430fa06SMiquel Raynal	  Enable the driver for NAND flash on platforms using a Denali NAND
36*a430fa06SMiquel Raynal	  controller as a DT device.
37*a430fa06SMiquel Raynal
38*a430fa06SMiquel Raynalconfig NAND_DENALI_SPARE_AREA_SKIP_BYTES
39*a430fa06SMiquel Raynal	int "Number of bytes skipped in OOB area"
40*a430fa06SMiquel Raynal	depends on NAND_DENALI
41*a430fa06SMiquel Raynal	range 0 63
42*a430fa06SMiquel Raynal	help
43*a430fa06SMiquel Raynal	  This option specifies the number of bytes to skip from the beginning
44*a430fa06SMiquel Raynal	  of OOB area before last ECC sector data starts.  This is potentially
45*a430fa06SMiquel Raynal	  used to preserve the bad block marker in the OOB area.
46*a430fa06SMiquel Raynal
47*a430fa06SMiquel Raynalconfig NAND_LPC32XX_SLC
48*a430fa06SMiquel Raynal	bool "Support LPC32XX_SLC controller"
49*a430fa06SMiquel Raynal	help
50*a430fa06SMiquel Raynal	  Enable the LPC32XX SLC NAND controller.
51*a430fa06SMiquel Raynal
52*a430fa06SMiquel Raynalconfig NAND_OMAP_GPMC
53*a430fa06SMiquel Raynal	bool "Support OMAP GPMC NAND controller"
54*a430fa06SMiquel Raynal	depends on ARCH_OMAP2PLUS
55*a430fa06SMiquel Raynal	help
56*a430fa06SMiquel Raynal	  Enables omap_gpmc.c driver for OMAPx and AMxxxx platforms.
57*a430fa06SMiquel Raynal	  GPMC controller is used for parallel NAND flash devices, and can
58*a430fa06SMiquel Raynal	  do ECC calculation (not ECC error detection) for HAM1, BCH4, BCH8
59*a430fa06SMiquel Raynal	  and BCH16 ECC algorithms.
60*a430fa06SMiquel Raynal
61*a430fa06SMiquel Raynalconfig NAND_OMAP_GPMC_PREFETCH
62*a430fa06SMiquel Raynal	bool "Enable GPMC Prefetch"
63*a430fa06SMiquel Raynal	depends on NAND_OMAP_GPMC
64*a430fa06SMiquel Raynal	default y
65*a430fa06SMiquel Raynal	help
66*a430fa06SMiquel Raynal	  On OMAP platforms that use the GPMC controller
67*a430fa06SMiquel Raynal	  (CONFIG_NAND_OMAP_GPMC_PREFETCH), this options enables the code that
68*a430fa06SMiquel Raynal	  uses the prefetch mode to speed up read operations.
69*a430fa06SMiquel Raynal
70*a430fa06SMiquel Raynalconfig NAND_OMAP_ELM
71*a430fa06SMiquel Raynal	bool "Enable ELM driver for OMAPxx and AMxx platforms."
72*a430fa06SMiquel Raynal	depends on NAND_OMAP_GPMC && !OMAP34XX
73*a430fa06SMiquel Raynal	help
74*a430fa06SMiquel Raynal	  ELM controller is used for ECC error detection (not ECC calculation)
75*a430fa06SMiquel Raynal	  of BCH4, BCH8 and BCH16 ECC algorithms.
76*a430fa06SMiquel Raynal	  Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
77*a430fa06SMiquel Raynal	  thus such SoC platforms need to depend on software library for ECC error
78*a430fa06SMiquel Raynal	  detection. However ECC calculation on such plaforms would still be
79*a430fa06SMiquel Raynal	  done by GPMC controller.
80*a430fa06SMiquel Raynal
81*a430fa06SMiquel Raynalconfig NAND_VF610_NFC
82*a430fa06SMiquel Raynal	bool "Support for Freescale NFC for VF610"
83*a430fa06SMiquel Raynal	select SYS_NAND_SELF_INIT
84*a430fa06SMiquel Raynal	imply CMD_NAND
85*a430fa06SMiquel Raynal	help
86*a430fa06SMiquel Raynal	  Enables support for NAND Flash Controller on some Freescale
87*a430fa06SMiquel Raynal	  processors like the VF610, MCF54418 or Kinetis K70.
88*a430fa06SMiquel Raynal	  The driver supports a maximum 2k page size. The driver
89*a430fa06SMiquel Raynal	  currently does not support hardware ECC.
90*a430fa06SMiquel Raynal
91*a430fa06SMiquel Raynalchoice
92*a430fa06SMiquel Raynal	prompt "Hardware ECC strength"
93*a430fa06SMiquel Raynal	depends on NAND_VF610_NFC
94*a430fa06SMiquel Raynal	default SYS_NAND_VF610_NFC_45_ECC_BYTES
95*a430fa06SMiquel Raynal	help
96*a430fa06SMiquel Raynal	  Select the ECC strength used in the hardware BCH ECC block.
97*a430fa06SMiquel Raynal
98*a430fa06SMiquel Raynalconfig SYS_NAND_VF610_NFC_45_ECC_BYTES
99*a430fa06SMiquel Raynal	bool "24-error correction (45 ECC bytes)"
100*a430fa06SMiquel Raynal
101*a430fa06SMiquel Raynalconfig SYS_NAND_VF610_NFC_60_ECC_BYTES
102*a430fa06SMiquel Raynal	bool "32-error correction (60 ECC bytes)"
103*a430fa06SMiquel Raynal
104*a430fa06SMiquel Raynalendchoice
105*a430fa06SMiquel Raynal
106*a430fa06SMiquel Raynalconfig NAND_PXA3XX
107*a430fa06SMiquel Raynal	bool "Support for NAND on PXA3xx and Armada 370/XP/38x"
108*a430fa06SMiquel Raynal	select SYS_NAND_SELF_INIT
109*a430fa06SMiquel Raynal	imply CMD_NAND
110*a430fa06SMiquel Raynal	help
111*a430fa06SMiquel Raynal	  This enables the driver for the NAND flash device found on
112*a430fa06SMiquel Raynal	  PXA3xx processors (NFCv1) and also on Armada 370/XP (NFCv2).
113*a430fa06SMiquel Raynal
114*a430fa06SMiquel Raynalconfig NAND_SUNXI
115*a430fa06SMiquel Raynal	bool "Support for NAND on Allwinner SoCs"
116*a430fa06SMiquel Raynal	default ARCH_SUNXI
117*a430fa06SMiquel Raynal	depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I
118*a430fa06SMiquel Raynal	select SYS_NAND_SELF_INIT
119*a430fa06SMiquel Raynal	select SYS_NAND_U_BOOT_LOCATIONS
120*a430fa06SMiquel Raynal	select SPL_NAND_SUPPORT
121*a430fa06SMiquel Raynal	imply CMD_NAND
122*a430fa06SMiquel Raynal	---help---
123*a430fa06SMiquel Raynal	Enable support for NAND. This option enables the standard and
124*a430fa06SMiquel Raynal	SPL drivers.
125*a430fa06SMiquel Raynal	The SPL driver only supports reading from the NAND using DMA
126*a430fa06SMiquel Raynal	transfers.
127*a430fa06SMiquel Raynal
128*a430fa06SMiquel Raynalif NAND_SUNXI
129*a430fa06SMiquel Raynal
130*a430fa06SMiquel Raynalconfig NAND_SUNXI_SPL_ECC_STRENGTH
131*a430fa06SMiquel Raynal	int "Allwinner NAND SPL ECC Strength"
132*a430fa06SMiquel Raynal	default 64
133*a430fa06SMiquel Raynal
134*a430fa06SMiquel Raynalconfig NAND_SUNXI_SPL_ECC_SIZE
135*a430fa06SMiquel Raynal	int "Allwinner NAND SPL ECC Step Size"
136*a430fa06SMiquel Raynal	default 1024
137*a430fa06SMiquel Raynal
138*a430fa06SMiquel Raynalconfig NAND_SUNXI_SPL_USABLE_PAGE_SIZE
139*a430fa06SMiquel Raynal	int "Allwinner NAND SPL Usable Page Size"
140*a430fa06SMiquel Raynal	default 1024
141*a430fa06SMiquel Raynal
142*a430fa06SMiquel Raynalendif
143*a430fa06SMiquel Raynal
144*a430fa06SMiquel Raynalconfig NAND_ARASAN
145*a430fa06SMiquel Raynal	bool "Configure Arasan Nand"
146*a430fa06SMiquel Raynal	select SYS_NAND_SELF_INIT
147*a430fa06SMiquel Raynal	imply CMD_NAND
148*a430fa06SMiquel Raynal	help
149*a430fa06SMiquel Raynal	  This enables Nand driver support for Arasan nand flash
150*a430fa06SMiquel Raynal	  controller. This uses the hardware ECC for read and
151*a430fa06SMiquel Raynal	  write operations.
152*a430fa06SMiquel Raynal
153*a430fa06SMiquel Raynalconfig NAND_MXC
154*a430fa06SMiquel Raynal	bool "MXC NAND support"
155*a430fa06SMiquel Raynal	depends on CPU_ARM926EJS || CPU_ARM1136 || MX5
156*a430fa06SMiquel Raynal	imply CMD_NAND
157*a430fa06SMiquel Raynal	help
158*a430fa06SMiquel Raynal	  This enables the NAND driver for the NAND flash controller on the
159*a430fa06SMiquel Raynal	  i.MX27 / i.MX31 / i.MX5 rocessors.
160*a430fa06SMiquel Raynal
161*a430fa06SMiquel Raynalconfig NAND_MXS
162*a430fa06SMiquel Raynal	bool "MXS NAND support"
163*a430fa06SMiquel Raynal	depends on MX23 || MX28 || MX6 || MX7
164*a430fa06SMiquel Raynal	select SYS_NAND_SELF_INIT
165*a430fa06SMiquel Raynal	imply CMD_NAND
166*a430fa06SMiquel Raynal	select APBH_DMA
167*a430fa06SMiquel Raynal	select APBH_DMA_BURST if ARCH_MX6 || ARCH_MX7
168*a430fa06SMiquel Raynal	select APBH_DMA_BURST8 if ARCH_MX6 || ARCH_MX7
169*a430fa06SMiquel Raynal	help
170*a430fa06SMiquel Raynal	  This enables NAND driver for the NAND flash controller on the
171*a430fa06SMiquel Raynal	  MXS processors.
172*a430fa06SMiquel Raynal
173*a430fa06SMiquel Raynalif NAND_MXS
174*a430fa06SMiquel Raynal
175*a430fa06SMiquel Raynalconfig NAND_MXS_DT
176*a430fa06SMiquel Raynal	bool "Support MXS NAND controller as a DT device"
177*a430fa06SMiquel Raynal	depends on OF_CONTROL && MTD
178*a430fa06SMiquel Raynal	help
179*a430fa06SMiquel Raynal	  Enable the driver for MXS NAND flash on platforms using
180*a430fa06SMiquel Raynal	  device tree.
181*a430fa06SMiquel Raynal
182*a430fa06SMiquel Raynalconfig NAND_MXS_USE_MINIMUM_ECC
183*a430fa06SMiquel Raynal	bool "Use minimum ECC strength supported by the controller"
184*a430fa06SMiquel Raynal	default false
185*a430fa06SMiquel Raynal
186*a430fa06SMiquel Raynalendif
187*a430fa06SMiquel Raynal
188*a430fa06SMiquel Raynalconfig NAND_ZYNQ
189*a430fa06SMiquel Raynal	bool "Support for Zynq Nand controller"
190*a430fa06SMiquel Raynal	select SYS_NAND_SELF_INIT
191*a430fa06SMiquel Raynal	imply CMD_NAND
192*a430fa06SMiquel Raynal	help
193*a430fa06SMiquel Raynal	  This enables Nand driver support for Nand flash controller
194*a430fa06SMiquel Raynal	  found on Zynq SoC.
195*a430fa06SMiquel Raynal
196*a430fa06SMiquel Raynalconfig NAND_ZYNQ_USE_BOOTLOADER1_TIMINGS
197*a430fa06SMiquel Raynal	bool "Enable use of 1st stage bootloader timing for NAND"
198*a430fa06SMiquel Raynal	depends on NAND_ZYNQ
199*a430fa06SMiquel Raynal	help
200*a430fa06SMiquel Raynal	  This flag prevent U-boot reconfigure NAND flash controller and reuse
201*a430fa06SMiquel Raynal	  the NAND timing from 1st stage bootloader.
202*a430fa06SMiquel Raynal
203*a430fa06SMiquel Raynalcomment "Generic NAND options"
204*a430fa06SMiquel Raynal
205*a430fa06SMiquel Raynalconfig SYS_NAND_BLOCK_SIZE
206*a430fa06SMiquel Raynal	hex "NAND chip eraseblock size"
207*a430fa06SMiquel Raynal	depends on ARCH_SUNXI
208*a430fa06SMiquel Raynal	help
209*a430fa06SMiquel Raynal	  Number of data bytes in one eraseblock for the NAND chip on the
210*a430fa06SMiquel Raynal	  board. This is the multiple of NAND_PAGE_SIZE and the number of
211*a430fa06SMiquel Raynal	  pages.
212*a430fa06SMiquel Raynal
213*a430fa06SMiquel Raynalconfig SYS_NAND_PAGE_SIZE
214*a430fa06SMiquel Raynal	hex "NAND chip page size"
215*a430fa06SMiquel Raynal	depends on ARCH_SUNXI
216*a430fa06SMiquel Raynal	help
217*a430fa06SMiquel Raynal	  Number of data bytes in one page for the NAND chip on the
218*a430fa06SMiquel Raynal	  board, not including the OOB area.
219*a430fa06SMiquel Raynal
220*a430fa06SMiquel Raynalconfig SYS_NAND_OOBSIZE
221*a430fa06SMiquel Raynal	hex "NAND chip OOB size"
222*a430fa06SMiquel Raynal	depends on ARCH_SUNXI
223*a430fa06SMiquel Raynal	help
224*a430fa06SMiquel Raynal	  Number of bytes in the Out-Of-Band area for the NAND chip on
225*a430fa06SMiquel Raynal	  the board.
226*a430fa06SMiquel Raynal
227*a430fa06SMiquel Raynal# Enhance depends when converting drivers to Kconfig which use this config
228*a430fa06SMiquel Raynal# option (mxc_nand, ndfc, omap_gpmc).
229*a430fa06SMiquel Raynalconfig SYS_NAND_BUSWIDTH_16BIT
230*a430fa06SMiquel Raynal	bool "Use 16-bit NAND interface"
231*a430fa06SMiquel Raynal	depends on NAND_VF610_NFC || NAND_OMAP_GPMC || NAND_MXC || ARCH_DAVINCI
232*a430fa06SMiquel Raynal	help
233*a430fa06SMiquel Raynal	  Indicates that NAND device has 16-bit wide data-bus. In absence of this
234*a430fa06SMiquel Raynal	  config, bus-width of NAND device is assumed to be either 8-bit and later
235*a430fa06SMiquel Raynal	  determined by reading ONFI params.
236*a430fa06SMiquel Raynal	  Above config is useful when NAND device's bus-width information cannot
237*a430fa06SMiquel Raynal	  be determined from on-chip ONFI params, like in following scenarios:
238*a430fa06SMiquel Raynal	  - SPL boot does not support reading of ONFI parameters. This is done to
239*a430fa06SMiquel Raynal	    keep SPL code foot-print small.
240*a430fa06SMiquel Raynal	  - In current U-Boot flow using nand_init(), driver initialization
241*a430fa06SMiquel Raynal	    happens in board_nand_init() which is called before any device probe
242*a430fa06SMiquel Raynal	    (nand_scan_ident + nand_scan_tail), thus device's ONFI parameters are
243*a430fa06SMiquel Raynal	    not available while configuring controller. So a static CONFIG_NAND_xx
244*a430fa06SMiquel Raynal	    is needed to know the device's bus-width in advance.
245*a430fa06SMiquel Raynal
246*a430fa06SMiquel Raynalif SPL
247*a430fa06SMiquel Raynal
248*a430fa06SMiquel Raynalconfig SYS_NAND_U_BOOT_LOCATIONS
249*a430fa06SMiquel Raynal	bool "Define U-boot binaries locations in NAND"
250*a430fa06SMiquel Raynal	help
251*a430fa06SMiquel Raynal	Enable CONFIG_SYS_NAND_U_BOOT_OFFS though Kconfig.
252*a430fa06SMiquel Raynal	This option should not be enabled when compiling U-boot for boards
253*a430fa06SMiquel Raynal	defining CONFIG_SYS_NAND_U_BOOT_OFFS in their include/configs/<board>.h
254*a430fa06SMiquel Raynal	file.
255*a430fa06SMiquel Raynal
256*a430fa06SMiquel Raynalconfig SYS_NAND_U_BOOT_OFFS
257*a430fa06SMiquel Raynal	hex "Location in NAND to read U-Boot from"
258*a430fa06SMiquel Raynal	default 0x800000 if NAND_SUNXI
259*a430fa06SMiquel Raynal	depends on SYS_NAND_U_BOOT_LOCATIONS
260*a430fa06SMiquel Raynal	help
261*a430fa06SMiquel Raynal	Set the offset from the start of the nand where u-boot should be
262*a430fa06SMiquel Raynal	loaded from.
263*a430fa06SMiquel Raynal
264*a430fa06SMiquel Raynalconfig SYS_NAND_U_BOOT_OFFS_REDUND
265*a430fa06SMiquel Raynal	hex "Location in NAND to read U-Boot from"
266*a430fa06SMiquel Raynal	default SYS_NAND_U_BOOT_OFFS
267*a430fa06SMiquel Raynal	depends on SYS_NAND_U_BOOT_LOCATIONS
268*a430fa06SMiquel Raynal	help
269*a430fa06SMiquel Raynal	Set the offset from the start of the nand where the redundant u-boot
270*a430fa06SMiquel Raynal	should be loaded from.
271*a430fa06SMiquel Raynal
272*a430fa06SMiquel Raynalconfig SPL_NAND_AM33XX_BCH
273*a430fa06SMiquel Raynal	bool "Enables SPL-NAND driver which supports ELM based"
274*a430fa06SMiquel Raynal	depends on NAND_OMAP_GPMC && !OMAP34XX
275*a430fa06SMiquel Raynal	default y
276*a430fa06SMiquel Raynal        help
277*a430fa06SMiquel Raynal	  Hardware ECC correction. This is useful for platforms which have ELM
278*a430fa06SMiquel Raynal	  hardware engine and use NAND boot mode.
279*a430fa06SMiquel Raynal	  Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine,
280*a430fa06SMiquel Raynal	  so those platforms should use CONFIG_SPL_NAND_SIMPLE for enabling
281*a430fa06SMiquel Raynal          SPL-NAND driver with software ECC correction support.
282*a430fa06SMiquel Raynal
283*a430fa06SMiquel Raynalconfig SPL_NAND_DENALI
284*a430fa06SMiquel Raynal	bool "Support Denali NAND controller for SPL"
285*a430fa06SMiquel Raynal	help
286*a430fa06SMiquel Raynal	  This is a small implementation of the Denali NAND controller
287*a430fa06SMiquel Raynal	  for use on SPL.
288*a430fa06SMiquel Raynal
289*a430fa06SMiquel Raynalconfig SPL_NAND_SIMPLE
290*a430fa06SMiquel Raynal	bool "Use simple SPL NAND driver"
291*a430fa06SMiquel Raynal	depends on !SPL_NAND_AM33XX_BCH
292*a430fa06SMiquel Raynal	help
293*a430fa06SMiquel Raynal	  Support for NAND boot using simple NAND drivers that
294*a430fa06SMiquel Raynal	  expose the cmd_ctrl() interface.
295*a430fa06SMiquel Raynalendif
296*a430fa06SMiquel Raynal
297*a430fa06SMiquel Raynalendif   # if NAND
298