blob: ce74ef31d7557b77dabcfe114b4bb0f0822bffbd [file] [log] [blame]
Thomas Choue51b65e2015-11-07 14:20:31 +08001menu "MTD Support"
2
Miquel Raynald31c4782018-08-16 17:30:18 +02003config MTD_PARTITIONS
4 bool
Alexey Romanovd5119672024-07-18 08:46:04 +03005 select PARTITIONS
Miquel Raynald31c4782018-08-16 17:30:18 +02006
Miquel Raynal2e35dbb2019-10-03 19:50:05 +02007config MTD
8 bool "Enable MTD layer"
9 help
Heinrich Schuchardt382561d2020-09-17 18:07:44 +020010 Enable the MTD stack, necessary to interact with NAND, NOR,
11 SPI-NOR, SPI-NAND, OneNAND, etc.
Miquel Raynal2e35dbb2019-10-03 19:50:05 +020012
Tom Riniddb1ec12024-01-10 13:46:10 -050013if MTD
14
Miquel Raynala903be42019-10-03 19:50:04 +020015config DM_MTD
Thomas Choue51b65e2015-11-07 14:20:31 +080016 bool "Enable Driver Model for MTD drivers"
17 depends on DM
18 help
19 Enable driver model for Memory Technology Devices (MTD), such as
20 flash, RAM and similar chips, often used for solid state file
21 systems on embedded devices.
22
Masahiro Yamada8cea9b52017-02-11 22:43:54 +090023config MTD_NOR_FLASH
24 bool "Enable parallel NOR flash support"
25 help
26 Enable support for parallel NOR flash.
27
Chris Packham2acc4852022-05-03 21:24:57 +120028config MTD_CONCAT
29 bool "Enable MTD device concatenation"
Chris Packham2acc4852022-05-03 21:24:57 +120030 help
31 Enable support for concatenating multiple physical MTD devices
32 into a single logical device. The larger logical device can then
33 be partitioned.
34
Alexey Romanov8e1fd2e2024-07-18 08:46:05 +030035config MTD_BLOCK
36 bool "Enable block device access to MTD devices"
37 depends on BLK
38 default n
39 help
40 Enable support for block device access to MTD devices
41 using blk_ops abstraction.
42
Patrick Delaunaye1287ba2020-02-26 10:28:42 +010043config SYS_MTDPARTS_RUNTIME
44 bool "Allow MTDPARTS to be configured at runtime"
Patrick Delaunaye1287ba2020-02-26 10:28:42 +010045 help
46 This option allows to call the function board_mtdparts_default to
47 dynamically build the variables mtdids and mtdparts at runtime.
48
Adam Ford76da1b22018-10-14 15:10:50 -050049config FLASH_CFI_DRIVER
50 bool "Enable CFI Flash driver"
Patrick Delaunay1576abf2022-01-04 14:24:00 +010051 select USE_SYS_MAX_FLASH_BANKS
Adam Ford76da1b22018-10-14 15:10:50 -050052 help
53 The Common Flash Interface specification was developed by Intel,
54 AMD and other flash manufactures. It provides a universal method
55 for probing the capabilities of flash devices. If you wish to
56 support any device that is CFI-compliant, you need to enable this
57 option. Visit <http://www.amd.com/products/nvd/overview/cfi.html>
58 for more information on CFI.
59
Tom Rini2c562792022-05-13 09:18:27 -040060choice
61 prompt "Data-width of the flash device"
62 depends on FLASH_CFI_DRIVER
63 default SYS_FLASH_CFI_WIDTH_8BIT
64
65config SYS_FLASH_CFI_WIDTH_8BIT
66 bool "Data-width of the device is 8-bit"
67
68config SYS_FLASH_CFI_WIDTH_16BIT
69 bool "Data-width of the device is 16-bit"
70
71config SYS_FLASH_CFI_WIDTH_32BIT
72 bool "Data-width of the device is 32-bit"
73
74config SYS_FLASH_CFI_WIDTH_64BIT
75 bool "Data-width of the device is 64-bit"
76
77endchoice
78
79config SYS_FLASH_CFI_WIDTH
80 hex
81 depends on FLASH_CFI_DRIVER
82 default 0x1 if SYS_FLASH_CFI_WIDTH_8BIT
83 default 0x2 if SYS_FLASH_CFI_WIDTH_16BIT
84 default 0x4 if SYS_FLASH_CFI_WIDTH_32BIT
85 default 0x8 if SYS_FLASH_CFI_WIDTH_64BIT
86 help
87 This must be kept in sync with the table in include/flash.h
88
Tom Rini01fe8142022-12-02 16:42:20 -050089config FLASH_SHOW_PROGRESS
90 int "Print out a countdown durinng writes"
91 depends on FLASH_CFI_DRIVER
92 default 45
93 help
94 If set to a non-zero value, print out countdown digits and dots.
95 Recommended value: 45 (9..1) for 80 column displays, 15 (3..1) for 40
96 column displays.
97
Thomas Chou47eae232015-11-07 14:31:08 +080098config CFI_FLASH
99 bool "Enable Driver Model for CFI Flash driver"
Miquel Raynala903be42019-10-03 19:50:04 +0200100 depends on DM_MTD
Bin Mengc78add42021-08-07 13:00:00 +0800101 select FLASH_CFI_DRIVER
Thomas Chou47eae232015-11-07 14:31:08 +0800102 help
103 The Common Flash Interface specification was developed by Intel,
104 AMD and other flash manufactures. It provides a universal method
105 for probing the capabilities of flash devices. If you wish to
106 support any device that is CFI-compliant, you need to enable this
107 option. Visit <http://www.amd.com/products/nvd/overview/cfi.html>
108 for more information on CFI.
109
Tom Rini18b76772022-02-25 11:19:52 -0500110config CFI_FLASH_USE_WEAK_ACCESSORS
111 bool "Allow read/write functions to be overridden"
112 depends on FLASH_CFI_DRIVER
113 help
114 Enable this option to allow for the flash_{read,write}{8,16,32,64}
115 functions to be overridden by the platform.
116
Tom Rinid6501752022-05-13 09:36:03 -0400117config SYS_CFI_FLASH_STATUS_POLL
118 bool "Poll status on AMD flash chips"
119 depends on FLASH_CFI_DRIVER
120
Adam Ford76da1b22018-10-14 15:10:50 -0500121config SYS_FLASH_USE_BUFFER_WRITE
122 bool "Enable buffered writes to flash"
123 depends on FLASH_CFI_DRIVER
124 help
125 Use buffered writes to flash.
126
Tom Rini302bd672022-07-23 13:04:55 -0400127config SYS_FLASH_EMPTY_INFO
128 bool "Enable displaying empty sectors in flash info"
129 depends on FLASH_CFI_DRIVER
130
Tom Rini6fb86c12022-12-02 16:42:21 -0500131config FLASH_SPANSION_S29WS_N
132 bool "Non-standard s29ws-n MirrorBit flash"
133 depends on FLASH_CFI_DRIVER
134 help
135 Enable this if the s29ws-n MirrorBit flash has non-standard addresses
136 for buffered write commands.
137
Adam Ford76da1b22018-10-14 15:10:50 -0500138config FLASH_CFI_MTD
139 bool "Enable CFI MTD driver"
Michal Simek7463b002023-07-04 14:04:04 +0200140 depends on FLASH_CFI_DRIVER && MTD
Adam Ford76da1b22018-10-14 15:10:50 -0500141 help
142 This option enables the building of the cfi_mtd driver
143 in the drivers directory. The driver exports CFI flash
144 to the MTD layer.
145
146config SYS_FLASH_PROTECTION
147 bool "Use hardware flash protection"
148 depends on FLASH_CFI_DRIVER
149 help
150 If defined, hardware flash sectors protection is used
151 instead of U-Boot software protection.
152
153config SYS_FLASH_CFI
154 bool "Define extra elements in CFI for flash geometry"
155 depends on FLASH_CFI_DRIVER
156 help
157 Define if the flash driver uses extra elements in the
158 common flash structure for storing flash geometry.
159
Tom Rini2e35d822022-07-23 13:05:05 -0400160config SYS_FLASH_QUIET_TEST
161 bool "Disable printing a warning about not recognizing some flash banks"
162 depends on FLASH_CFI_DRIVER
163 help
164 If this option is enabled, the common CFI flash doesn't print it's
165 warning upon not recognized FLASH banks. This is useful, if some of
166 the configured banks are only optionally available.
167
Tom Rinicb5e3c12022-07-23 13:04:59 -0400168config SYS_FLASH_CHECKSUM
169 bool "Compute and print flash CRC if 'flashchecksum' is set in the environment"
170 depends on MTD_NOR_FLASH
171 help
172 If the variable flashchecksum is set in the environment, perform a CRC
173 of the flash and print the value to console.
174
Tom Rini6fb86c12022-12-02 16:42:21 -0500175config FLASH_VERIFY
176 bool "Compare writes to NOR flash with source location"
177 depends on MTD_NOR_FLASH
178 help
179 If enabled, the content of the flash (destination) is compared
180 against the source after the write operation. An error message will
181 be printed when the contents are not identical. Please note that
182 this option is useless in nearly all cases, since such flash
183 programming errors usually are detected earlier while
184 unprotecting/erasing/programming. Please only enable this option if
185 you really know what you are doing.
186
Thomas Choucdc11522015-11-09 14:56:02 +0800187config ALTERA_QSPI
188 bool "Altera Generic Quad SPI Controller"
Miquel Raynala903be42019-10-03 19:50:04 +0200189 depends on DM_MTD
Patrick Delaunay1576abf2022-01-04 14:24:00 +0100190 select USE_SYS_MAX_FLASH_BANKS
Thomas Choucdc11522015-11-09 14:56:02 +0800191 help
192 This enables access to Altera EPCQ/EPCS flash chips using the
193 Altera Generic Quad SPI Controller. The controller converts SPI
194 NOR flash to parallel flash interface. Please find details on the
195 "Embedded Peripherals IP User Guide" of Altera.
196
Marek Vasutc1cb3562017-08-19 23:24:08 +0200197config RENESAS_RPC_HF
Heinrich Schuchardt382561d2020-09-17 18:07:44 +0200198 bool "Renesas RCar Gen3 RPC HyperFlash driver"
Miquel Raynala903be42019-10-03 19:50:04 +0200199 depends on RCAR_GEN3 && DM_MTD
Marek Vasutc1cb3562017-08-19 23:24:08 +0200200 help
Heinrich Schuchardt382561d2020-09-17 18:07:44 +0200201 This enables access to HyperFlash memory through the Renesas
Marek Vasutc1cb3562017-08-19 23:24:08 +0200202 RCar Gen3 RPC controller.
203
Vignesh Raghavendra2736c672019-10-23 13:30:01 +0530204config HBMC_AM654
205 bool "HyperBus controller driver for AM65x SoC"
206 depends on SYSCON
207 help
208 This is the driver for HyperBus controller on TI's AM65x and
209 other SoCs
210
Patrick Delaunay754ff3b2021-10-04 11:05:52 +0200211config STM32_FLASH
212 bool "STM32 MCU Flash driver"
213 depends on ARCH_STM32
Patrick Delaunay1576abf2022-01-04 14:24:00 +0100214 select USE_SYS_MAX_FLASH_BANKS
Patrick Delaunay754ff3b2021-10-04 11:05:52 +0200215 help
216 This is the driver of embedded flash for some STMicroelectronics
217 STM32 MCU.
218
Tom Rinid38112c2022-07-23 13:05:04 -0400219config SYS_MAX_FLASH_SECT
220 int "Maximumm number of sectors on a flash chip"
221 depends on MTD_NOR_FLASH || FLASH_CFI_DRIVER
222 default 512
223
Tom Rinid814ce22022-06-15 12:03:50 -0400224config SAMSUNG_ONENAND
225 bool "Samsung OneNAND driver support"
226
Patrick Delaunay1576abf2022-01-04 14:24:00 +0100227config USE_SYS_MAX_FLASH_BANKS
228 bool "Enable Max number of Flash memory banks"
229 help
230 When this option is enabled, the CONFIG_SYS_MAX_FLASH_BANKS
231 will be defined.
232
233config SYS_MAX_FLASH_BANKS
234 int "Max number of Flash memory banks"
235 depends on USE_SYS_MAX_FLASH_BANKS
236 default 1
237 help
238 Max number of Flash memory banks using by the MTD framework, in the
239 flash CFI driver and in some other driver to define the flash_info
240 struct declaration.
241
242config SYS_MAX_FLASH_BANKS_DETECT
243 bool "Detection of flash banks number in CFI driver"
244 depends on CFI_FLASH && FLASH_CFI_DRIVER
245 help
246 This enables detection of number of flash banks in CFI driver,
247 to reduce the effective number of flash bank, between 0 and
248 CONFIG_SYS_MAX_FLASH_BANKS
249
Masahiro Yamadac343b382014-10-03 19:21:03 +0900250source "drivers/mtd/nand/Kconfig"
Simon Glassd8b771d2015-02-05 21:41:35 -0700251
Tom Rini66c6feb2022-11-12 17:36:47 -0500252config SYS_NAND_MAX_OOBFREE
253 int "Maximum number of free OOB regions supported"
254 depends on SAMSUNG_ONENAND || MTD_RAW_NAND
255 range 2 32
256 default 32
257 help
258 Set the maximum number of free OOB regions supported. Useful for
259 reducing image size, especially with SPL.
260
261config SYS_NAND_MAX_ECCPOS
262 int "Maximum number of ECC bytes supported"
263 depends on SAMSUNG_ONENAND || MTD_RAW_NAND
264 range 48 2147483647
265 default 680
266 help
267 Set the maximum number of ECC bytes supported. Useful for reducing
268 image size, especially with SPL.
269
Tom Rini64fc3312021-09-22 14:50:36 -0400270config SYS_NAND_MAX_CHIPS
271 int "NAND max chips"
272 depends on MTD_RAW_NAND || CMD_ONENAND || TARGET_S5PC210_UNIVERSAL || \
273 SPL_OMAP3_ID_NAND
274 default 1
275 help
276 The maximum number of NAND chips per device to be supported.
277
Simon Glassd8b771d2015-02-05 21:41:35 -0700278source "drivers/mtd/spi/Kconfig"
Heiko Schocher09dbb852016-09-21 07:58:19 +0200279
280source "drivers/mtd/ubi/Kconfig"
Miquel Raynala4e7e212018-08-16 17:30:06 +0200281
Abdellatif El Khlifi857360c2023-04-17 10:11:52 +0100282source "drivers/mtd/nvmxip/Kconfig"
283
Tom Riniddb1ec12024-01-10 13:46:10 -0500284endif
285
Miquel Raynala4e7e212018-08-16 17:30:06 +0200286endmenu