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