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