Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 1 | |
Miquel Raynal | 88718be | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 2 | menuconfig MTD_RAW_NAND |
Miquel Raynal | 3657b2f | 2018-08-16 17:30:08 +0200 | [diff] [blame] | 3 | bool "Raw NAND Device Support" |
Miquel Raynal | 88718be | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 4 | if MTD_RAW_NAND |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 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 | |
Stefan Agner | a38c3af | 2018-12-06 14:57:09 +0100 | [diff] [blame] | 12 | config 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 Roese | c680df7 | 2019-08-22 12:28:04 +0200 | [diff] [blame] | 18 | config 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 Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 23 | config 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. Woods | 49ad402 | 2018-12-15 01:36:46 -0600 | [diff] [blame] | 30 | if NAND_ATMEL |
| 31 | |
| 32 | config ATMEL_NAND_HWECC |
| 33 | bool "Atmel Hardware ECC" |
| 34 | default n |
| 35 | |
| 36 | config 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 | |
| 44 | config 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 | |
| 51 | config 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 | |
| 58 | config 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 | |
| 66 | endif |
| 67 | |
Philippe Reynes | 22daafb | 2019-03-15 15:14:36 +0100 | [diff] [blame] | 68 | config NAND_BRCMNAND |
| 69 | bool "Support Broadcom NAND controller" |
Miquel Raynal | 1de770d | 2019-10-03 19:50:04 +0200 | [diff] [blame] | 70 | depends on OF_CONTROL && DM && DM_MTD |
Philippe Reynes | 22daafb | 2019-03-15 15:14:36 +0100 | [diff] [blame] | 71 | help |
| 72 | Enable the driver for NAND flash on platforms using a Broadcom NAND |
| 73 | controller. |
| 74 | |
Álvaro Fernández Rojas | a9f80cf | 2019-08-28 19:12:15 +0200 | [diff] [blame] | 75 | config 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 Reynes | 22daafb | 2019-03-15 15:14:36 +0100 | [diff] [blame] | 81 | config NAND_BRCMNAND_6838 |
| 82 | bool "Support Broadcom NAND controller on bcm6838" |
| 83 | depends on NAND_BRCMNAND && ARCH_BMIPS && SOC_BMIPS_BCM6838 |
| 84 | help |
| 85 | Enable support for broadcom nand driver on bcm6838. |
| 86 | |
| 87 | config NAND_BRCMNAND_6858 |
| 88 | bool "Support Broadcom NAND controller on bcm6858" |
| 89 | depends on NAND_BRCMNAND && ARCH_BCM6858 |
| 90 | help |
| 91 | Enable support for broadcom nand driver on bcm6858. |
| 92 | |
| 93 | config NAND_BRCMNAND_63158 |
| 94 | bool "Support Broadcom NAND controller on bcm63158" |
| 95 | depends on NAND_BRCMNAND && ARCH_BCM63158 |
| 96 | help |
| 97 | Enable support for broadcom nand driver on bcm63158. |
| 98 | |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 99 | config NAND_DAVINCI |
| 100 | bool "Support TI Davinci NAND controller" |
| 101 | help |
| 102 | Enable this driver for NAND flash controllers available in TI Davinci |
| 103 | and Keystone2 platforms |
| 104 | |
| 105 | config NAND_DENALI |
| 106 | bool |
| 107 | select SYS_NAND_SELF_INIT |
| 108 | imply CMD_NAND |
| 109 | |
| 110 | config NAND_DENALI_DT |
| 111 | bool "Support Denali NAND controller as a DT device" |
| 112 | select NAND_DENALI |
| 113 | depends on OF_CONTROL && DM |
| 114 | help |
| 115 | Enable the driver for NAND flash on platforms using a Denali NAND |
| 116 | controller as a DT device. |
| 117 | |
| 118 | config NAND_DENALI_SPARE_AREA_SKIP_BYTES |
| 119 | int "Number of bytes skipped in OOB area" |
| 120 | depends on NAND_DENALI |
| 121 | range 0 63 |
| 122 | help |
| 123 | This option specifies the number of bytes to skip from the beginning |
| 124 | of OOB area before last ECC sector data starts. This is potentially |
| 125 | used to preserve the bad block marker in the OOB area. |
| 126 | |
| 127 | config NAND_LPC32XX_SLC |
| 128 | bool "Support LPC32XX_SLC controller" |
| 129 | help |
| 130 | Enable the LPC32XX SLC NAND controller. |
| 131 | |
| 132 | config NAND_OMAP_GPMC |
| 133 | bool "Support OMAP GPMC NAND controller" |
| 134 | depends on ARCH_OMAP2PLUS |
| 135 | help |
| 136 | Enables omap_gpmc.c driver for OMAPx and AMxxxx platforms. |
| 137 | GPMC controller is used for parallel NAND flash devices, and can |
| 138 | do ECC calculation (not ECC error detection) for HAM1, BCH4, BCH8 |
| 139 | and BCH16 ECC algorithms. |
| 140 | |
| 141 | config NAND_OMAP_GPMC_PREFETCH |
| 142 | bool "Enable GPMC Prefetch" |
| 143 | depends on NAND_OMAP_GPMC |
| 144 | default y |
| 145 | help |
| 146 | On OMAP platforms that use the GPMC controller |
| 147 | (CONFIG_NAND_OMAP_GPMC_PREFETCH), this options enables the code that |
| 148 | uses the prefetch mode to speed up read operations. |
| 149 | |
| 150 | config NAND_OMAP_ELM |
| 151 | bool "Enable ELM driver for OMAPxx and AMxx platforms." |
| 152 | depends on NAND_OMAP_GPMC && !OMAP34XX |
| 153 | help |
| 154 | ELM controller is used for ECC error detection (not ECC calculation) |
| 155 | of BCH4, BCH8 and BCH16 ECC algorithms. |
| 156 | Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine, |
| 157 | thus such SoC platforms need to depend on software library for ECC error |
| 158 | detection. However ECC calculation on such plaforms would still be |
| 159 | done by GPMC controller. |
| 160 | |
| 161 | config NAND_VF610_NFC |
| 162 | bool "Support for Freescale NFC for VF610" |
| 163 | select SYS_NAND_SELF_INIT |
Stefan Agner | a38c3af | 2018-12-06 14:57:09 +0100 | [diff] [blame] | 164 | select SYS_NAND_DRIVER_ECC_LAYOUT |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 165 | imply CMD_NAND |
| 166 | help |
| 167 | Enables support for NAND Flash Controller on some Freescale |
| 168 | processors like the VF610, MCF54418 or Kinetis K70. |
| 169 | The driver supports a maximum 2k page size. The driver |
| 170 | currently does not support hardware ECC. |
| 171 | |
Lukasz Majewski | 8a12d12 | 2018-12-03 10:24:50 +0100 | [diff] [blame] | 172 | if NAND_VF610_NFC |
| 173 | |
| 174 | config NAND_VF610_NFC_DT |
| 175 | bool "Support Vybrid's vf610 NAND controller as a DT device" |
Miquel Raynal | 1de770d | 2019-10-03 19:50:04 +0200 | [diff] [blame] | 176 | depends on OF_CONTROL && DM_MTD |
Lukasz Majewski | 8a12d12 | 2018-12-03 10:24:50 +0100 | [diff] [blame] | 177 | help |
| 178 | Enable the driver for Vybrid's vf610 NAND flash on platforms |
| 179 | using device tree. |
| 180 | |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 181 | choice |
| 182 | prompt "Hardware ECC strength" |
| 183 | depends on NAND_VF610_NFC |
| 184 | default SYS_NAND_VF610_NFC_45_ECC_BYTES |
| 185 | help |
| 186 | Select the ECC strength used in the hardware BCH ECC block. |
| 187 | |
| 188 | config SYS_NAND_VF610_NFC_45_ECC_BYTES |
| 189 | bool "24-error correction (45 ECC bytes)" |
| 190 | |
| 191 | config SYS_NAND_VF610_NFC_60_ECC_BYTES |
| 192 | bool "32-error correction (60 ECC bytes)" |
| 193 | |
| 194 | endchoice |
| 195 | |
Lukasz Majewski | 8a12d12 | 2018-12-03 10:24:50 +0100 | [diff] [blame] | 196 | endif |
| 197 | |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 198 | config NAND_PXA3XX |
| 199 | bool "Support for NAND on PXA3xx and Armada 370/XP/38x" |
| 200 | select SYS_NAND_SELF_INIT |
| 201 | imply CMD_NAND |
| 202 | help |
| 203 | This enables the driver for the NAND flash device found on |
| 204 | PXA3xx processors (NFCv1) and also on Armada 370/XP (NFCv2). |
| 205 | |
| 206 | config NAND_SUNXI |
| 207 | bool "Support for NAND on Allwinner SoCs" |
| 208 | default ARCH_SUNXI |
| 209 | depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I |
| 210 | select SYS_NAND_SELF_INIT |
| 211 | select SYS_NAND_U_BOOT_LOCATIONS |
| 212 | select SPL_NAND_SUPPORT |
| 213 | imply CMD_NAND |
| 214 | ---help--- |
| 215 | Enable support for NAND. This option enables the standard and |
| 216 | SPL drivers. |
| 217 | The SPL driver only supports reading from the NAND using DMA |
| 218 | transfers. |
| 219 | |
| 220 | if NAND_SUNXI |
| 221 | |
| 222 | config NAND_SUNXI_SPL_ECC_STRENGTH |
| 223 | int "Allwinner NAND SPL ECC Strength" |
| 224 | default 64 |
| 225 | |
| 226 | config NAND_SUNXI_SPL_ECC_SIZE |
| 227 | int "Allwinner NAND SPL ECC Step Size" |
| 228 | default 1024 |
| 229 | |
| 230 | config NAND_SUNXI_SPL_USABLE_PAGE_SIZE |
| 231 | int "Allwinner NAND SPL Usable Page Size" |
| 232 | default 1024 |
| 233 | |
| 234 | endif |
| 235 | |
| 236 | config NAND_ARASAN |
| 237 | bool "Configure Arasan Nand" |
| 238 | select SYS_NAND_SELF_INIT |
Ashok Reddy Soma | b014b83 | 2019-12-19 02:27:42 -0700 | [diff] [blame^] | 239 | select DM_MTD |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 240 | imply CMD_NAND |
| 241 | help |
| 242 | This enables Nand driver support for Arasan nand flash |
| 243 | controller. This uses the hardware ECC for read and |
| 244 | write operations. |
| 245 | |
| 246 | config NAND_MXC |
| 247 | bool "MXC NAND support" |
| 248 | depends on CPU_ARM926EJS || CPU_ARM1136 || MX5 |
| 249 | imply CMD_NAND |
| 250 | help |
| 251 | This enables the NAND driver for the NAND flash controller on the |
| 252 | i.MX27 / i.MX31 / i.MX5 rocessors. |
| 253 | |
| 254 | config NAND_MXS |
| 255 | bool "MXS NAND support" |
| 256 | depends on MX23 || MX28 || MX6 || MX7 |
| 257 | select SYS_NAND_SELF_INIT |
| 258 | imply CMD_NAND |
| 259 | select APBH_DMA |
| 260 | select APBH_DMA_BURST if ARCH_MX6 || ARCH_MX7 |
| 261 | select APBH_DMA_BURST8 if ARCH_MX6 || ARCH_MX7 |
| 262 | help |
| 263 | This enables NAND driver for the NAND flash controller on the |
| 264 | MXS processors. |
| 265 | |
| 266 | if NAND_MXS |
| 267 | |
| 268 | config NAND_MXS_DT |
| 269 | bool "Support MXS NAND controller as a DT device" |
Miquel Raynal | 1de770d | 2019-10-03 19:50:04 +0200 | [diff] [blame] | 270 | depends on OF_CONTROL && DM_MTD |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 271 | help |
| 272 | Enable the driver for MXS NAND flash on platforms using |
| 273 | device tree. |
| 274 | |
| 275 | config NAND_MXS_USE_MINIMUM_ECC |
| 276 | bool "Use minimum ECC strength supported by the controller" |
| 277 | default false |
| 278 | |
| 279 | endif |
| 280 | |
| 281 | config NAND_ZYNQ |
| 282 | bool "Support for Zynq Nand controller" |
| 283 | select SYS_NAND_SELF_INIT |
| 284 | imply CMD_NAND |
| 285 | help |
| 286 | This enables Nand driver support for Nand flash controller |
| 287 | found on Zynq SoC. |
| 288 | |
| 289 | config NAND_ZYNQ_USE_BOOTLOADER1_TIMINGS |
| 290 | bool "Enable use of 1st stage bootloader timing for NAND" |
| 291 | depends on NAND_ZYNQ |
| 292 | help |
| 293 | This flag prevent U-boot reconfigure NAND flash controller and reuse |
| 294 | the NAND timing from 1st stage bootloader. |
| 295 | |
Christophe Kerello | 7bb7502 | 2019-04-05 11:41:50 +0200 | [diff] [blame] | 296 | config NAND_STM32_FMC2 |
| 297 | bool "Support for NAND controller on STM32MP SoCs" |
| 298 | depends on ARCH_STM32MP |
| 299 | select SYS_NAND_SELF_INIT |
| 300 | imply CMD_NAND |
| 301 | help |
| 302 | Enables support for NAND Flash chips on SoCs containing the FMC2 |
| 303 | NAND controller. This controller is found on STM32MP SoCs. |
| 304 | The controller supports a maximum 8k page size and supports |
| 305 | a maximum 8-bit correction error per sector of 512 bytes. |
| 306 | |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 307 | comment "Generic NAND options" |
| 308 | |
| 309 | config SYS_NAND_BLOCK_SIZE |
| 310 | hex "NAND chip eraseblock size" |
| 311 | depends on ARCH_SUNXI |
| 312 | help |
| 313 | Number of data bytes in one eraseblock for the NAND chip on the |
| 314 | board. This is the multiple of NAND_PAGE_SIZE and the number of |
| 315 | pages. |
| 316 | |
| 317 | config SYS_NAND_PAGE_SIZE |
| 318 | hex "NAND chip page size" |
| 319 | depends on ARCH_SUNXI |
| 320 | help |
| 321 | Number of data bytes in one page for the NAND chip on the |
| 322 | board, not including the OOB area. |
| 323 | |
| 324 | config SYS_NAND_OOBSIZE |
| 325 | hex "NAND chip OOB size" |
| 326 | depends on ARCH_SUNXI |
| 327 | help |
| 328 | Number of bytes in the Out-Of-Band area for the NAND chip on |
| 329 | the board. |
| 330 | |
| 331 | # Enhance depends when converting drivers to Kconfig which use this config |
| 332 | # option (mxc_nand, ndfc, omap_gpmc). |
| 333 | config SYS_NAND_BUSWIDTH_16BIT |
| 334 | bool "Use 16-bit NAND interface" |
| 335 | depends on NAND_VF610_NFC || NAND_OMAP_GPMC || NAND_MXC || ARCH_DAVINCI |
| 336 | help |
| 337 | Indicates that NAND device has 16-bit wide data-bus. In absence of this |
| 338 | config, bus-width of NAND device is assumed to be either 8-bit and later |
| 339 | determined by reading ONFI params. |
| 340 | Above config is useful when NAND device's bus-width information cannot |
| 341 | be determined from on-chip ONFI params, like in following scenarios: |
| 342 | - SPL boot does not support reading of ONFI parameters. This is done to |
| 343 | keep SPL code foot-print small. |
| 344 | - In current U-Boot flow using nand_init(), driver initialization |
| 345 | happens in board_nand_init() which is called before any device probe |
| 346 | (nand_scan_ident + nand_scan_tail), thus device's ONFI parameters are |
| 347 | not available while configuring controller. So a static CONFIG_NAND_xx |
| 348 | is needed to know the device's bus-width in advance. |
| 349 | |
T Karthik Reddy | 97fca6a | 2018-12-03 16:11:58 +0530 | [diff] [blame] | 350 | config SYS_NAND_MAX_CHIPS |
| 351 | int "NAND max chips" |
| 352 | default 1 |
| 353 | depends on NAND_ARASAN |
| 354 | help |
| 355 | The maximum number of NAND chips per device to be supported. |
| 356 | |
Miquel Raynal | a430fa0 | 2018-08-16 17:30:07 +0200 | [diff] [blame] | 357 | if SPL |
| 358 | |
| 359 | config SYS_NAND_U_BOOT_LOCATIONS |
| 360 | bool "Define U-boot binaries locations in NAND" |
| 361 | help |
| 362 | Enable CONFIG_SYS_NAND_U_BOOT_OFFS though Kconfig. |
| 363 | This option should not be enabled when compiling U-boot for boards |
| 364 | defining CONFIG_SYS_NAND_U_BOOT_OFFS in their include/configs/<board>.h |
| 365 | file. |
| 366 | |
| 367 | config SYS_NAND_U_BOOT_OFFS |
| 368 | hex "Location in NAND to read U-Boot from" |
| 369 | default 0x800000 if NAND_SUNXI |
| 370 | depends on SYS_NAND_U_BOOT_LOCATIONS |
| 371 | help |
| 372 | Set the offset from the start of the nand where u-boot should be |
| 373 | loaded from. |
| 374 | |
| 375 | config SYS_NAND_U_BOOT_OFFS_REDUND |
| 376 | hex "Location in NAND to read U-Boot from" |
| 377 | default SYS_NAND_U_BOOT_OFFS |
| 378 | depends on SYS_NAND_U_BOOT_LOCATIONS |
| 379 | help |
| 380 | Set the offset from the start of the nand where the redundant u-boot |
| 381 | should be loaded from. |
| 382 | |
| 383 | config SPL_NAND_AM33XX_BCH |
| 384 | bool "Enables SPL-NAND driver which supports ELM based" |
| 385 | depends on NAND_OMAP_GPMC && !OMAP34XX |
| 386 | default y |
| 387 | help |
| 388 | Hardware ECC correction. This is useful for platforms which have ELM |
| 389 | hardware engine and use NAND boot mode. |
| 390 | Some legacy platforms like OMAP3xx do not have in-built ELM h/w engine, |
| 391 | so those platforms should use CONFIG_SPL_NAND_SIMPLE for enabling |
| 392 | SPL-NAND driver with software ECC correction support. |
| 393 | |
| 394 | config SPL_NAND_DENALI |
| 395 | bool "Support Denali NAND controller for SPL" |
| 396 | help |
| 397 | This is a small implementation of the Denali NAND controller |
| 398 | for use on SPL. |
| 399 | |
| 400 | config SPL_NAND_SIMPLE |
| 401 | bool "Use simple SPL NAND driver" |
| 402 | depends on !SPL_NAND_AM33XX_BCH |
| 403 | help |
| 404 | Support for NAND boot using simple NAND drivers that |
| 405 | expose the cmd_ctrl() interface. |
| 406 | endif |
| 407 | |
| 408 | endif # if NAND |