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