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