xref: /openbmc/linux/drivers/mtd/Kconfig (revision 56a0eccd)
1menuconfig MTD
2	tristate "Memory Technology Device (MTD) support"
3	depends on GENERIC_IO
4	help
5	  Memory Technology Devices are flash, RAM and similar chips, often
6	  used for solid state file systems on embedded devices. This option
7	  will provide the generic support for MTD drivers to register
8	  themselves with the kernel and for potential users of MTD devices
9	  to enumerate the devices which are present and obtain a handle on
10	  them. It will also allow you to select individual drivers for
11	  particular hardware and users of MTD devices. If unsure, say N.
12
13if MTD
14
15config MTD_TESTS
16	tristate "MTD tests support (DANGEROUS)"
17	depends on m
18	help
19	  This option includes various MTD tests into compilation. The tests
20	  should normally be compiled as kernel modules. The modules perform
21	  various checks and verifications when loaded.
22
23	  WARNING: some of the tests will ERASE entire MTD device which they
24	  test. Do not use these tests unless you really know what you do.
25
26config MTD_REDBOOT_PARTS
27	tristate "RedBoot partition table parsing"
28	---help---
29	  RedBoot is a ROM monitor and bootloader which deals with multiple
30	  'images' in flash devices by putting a table one of the erase
31	  blocks on the device, similar to a partition table, which gives
32	  the offsets, lengths and names of all the images stored in the
33	  flash.
34
35	  If you need code which can detect and parse this table, and register
36	  MTD 'partitions' corresponding to each image in the table, enable
37	  this option.
38
39	  You will still need the parsing functions to be called by the driver
40	  for your particular device. It won't happen automatically. The
41	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
42	  example.
43
44if MTD_REDBOOT_PARTS
45
46config MTD_REDBOOT_DIRECTORY_BLOCK
47	int "Location of RedBoot partition table"
48	default "-1"
49	---help---
50	  This option is the Linux counterpart to the
51	  CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time
52	  option.
53
54	  The option specifies which Flash sectors holds the RedBoot
55	  partition table.  A zero or positive value gives an absolute
56	  erase block number. A negative value specifies a number of
57	  sectors before the end of the device.
58
59	  For example "2" means block number 2, "-1" means the last
60	  block and "-2" means the penultimate block.
61
62config MTD_REDBOOT_PARTS_UNALLOCATED
63	bool "Include unallocated flash regions"
64	help
65	  If you need to register each unallocated flash region as a MTD
66	  'partition', enable this option.
67
68config MTD_REDBOOT_PARTS_READONLY
69	bool "Force read-only for RedBoot system images"
70	help
71	  If you need to force read-only for 'RedBoot', 'RedBoot Config' and
72	  'FIS directory' images, enable this option.
73
74endif # MTD_REDBOOT_PARTS
75
76config MTD_CMDLINE_PARTS
77	tristate "Command line partition table parsing"
78	depends on MTD
79	---help---
80	  Allow generic configuration of the MTD partition tables via the kernel
81	  command line. Multiple flash resources are supported for hardware where
82	  different kinds of flash memory are available.
83
84	  You will still need the parsing functions to be called by the driver
85	  for your particular device. It won't happen automatically. The
86	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
87	  example.
88
89	  The format for the command line is as follows:
90
91	  mtdparts=<mtddef>[;<mtddef]
92	  <mtddef>  := <mtd-id>:<partdef>[,<partdef>]
93	  <partdef> := <size>[@offset][<name>][ro]
94	  <mtd-id>  := unique id used in mapping driver/device
95	  <size>    := standard linux memsize OR "-" to denote all
96	  remaining space
97	  <name>    := (NAME)
98
99	  Due to the way Linux handles the command line, no spaces are
100	  allowed in the partition definition, including mtd id's and partition
101	  names.
102
103	  Examples:
104
105	  1 flash resource (mtd-id "sa1100"), with 1 single writable partition:
106	  mtdparts=sa1100:-
107
108	  Same flash, but 2 named partitions, the first one being read-only:
109	  mtdparts=sa1100:256k(ARMboot)ro,-(root)
110
111	  If unsure, say 'N'.
112
113config MTD_AFS_PARTS
114	tristate "ARM Firmware Suite partition parsing"
115	depends on (ARM || ARM64)
116	---help---
117	  The ARM Firmware Suite allows the user to divide flash devices into
118	  multiple 'images'. Each such image has a header containing its name
119	  and offset/size etc.
120
121	  If you need code which can detect and parse these tables, and
122	  register MTD 'partitions' corresponding to each image detected,
123	  enable this option.
124
125	  You will still need the parsing functions to be called by the driver
126	  for your particular device. It won't happen automatically. The
127	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
128
129config MTD_OF_PARTS
130	tristate "OpenFirmware partitioning information support"
131	default y
132	depends on OF
133	help
134	  This provides a partition parsing function which derives
135	  the partition map from the children of the flash node,
136	  as described in Documentation/devicetree/bindings/mtd/partition.txt.
137
138config MTD_AR7_PARTS
139	tristate "TI AR7 partitioning support"
140	---help---
141	  TI AR7 partitioning support
142
143config MTD_BCM63XX_PARTS
144	tristate "BCM63XX CFE partitioning support"
145	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
146	select CRC32
147	help
148	  This provides partions parsing for BCM63xx devices with CFE
149	  bootloaders.
150
151config MTD_BCM47XX_PARTS
152	tristate "BCM47XX partitioning support"
153	depends on BCM47XX || ARCH_BCM_5301X
154	help
155	  This provides partitions parser for devices based on BCM47xx
156	  boards.
157
158comment "User Modules And Translation Layers"
159
160#
161# MTD block device support is select'ed if needed
162#
163config MTD_BLKDEVS
164	tristate
165
166config MTD_BLOCK
167	tristate "Caching block device access to MTD devices"
168	depends on BLOCK
169	select MTD_BLKDEVS
170	---help---
171	  Although most flash chips have an erase size too large to be useful
172	  as block devices, it is possible to use MTD devices which are based
173	  on RAM chips in this manner. This block device is a user of MTD
174	  devices performing that function.
175
176	  At the moment, it is also required for the Journalling Flash File
177	  System(s) to obtain a handle on the MTD device when it's mounted
178	  (although JFFS and JFFS2 don't actually use any of the functionality
179	  of the mtdblock device).
180
181	  Later, it may be extended to perform read/erase/modify/write cycles
182	  on flash chips to emulate a smaller block size. Needless to say,
183	  this is very unsafe, but could be useful for file systems which are
184	  almost never written to.
185
186	  You do not need this option for use with the DiskOnChip devices. For
187	  those, enable NFTL support (CONFIG_NFTL) instead.
188
189config MTD_BLOCK_RO
190	tristate "Readonly block device access to MTD devices"
191	depends on MTD_BLOCK!=y && BLOCK
192	select MTD_BLKDEVS
193	help
194	  This allows you to mount read-only file systems (such as cramfs)
195	  from an MTD device, without the overhead (and danger) of the caching
196	  driver.
197
198	  You do not need this option for use with the DiskOnChip devices. For
199	  those, enable NFTL support (CONFIG_NFTL) instead.
200
201config FTL
202	tristate "FTL (Flash Translation Layer) support"
203	depends on BLOCK
204	select MTD_BLKDEVS
205	---help---
206	  This provides support for the original Flash Translation Layer which
207	  is part of the PCMCIA specification. It uses a kind of pseudo-
208	  file system on a flash device to emulate a block device with
209	  512-byte sectors, on top of which you put a 'normal' file system.
210
211	  You may find that the algorithms used in this code are patented
212	  unless you live in the Free World where software patents aren't
213	  legal - in the USA you are only permitted to use this on PCMCIA
214	  hardware, although under the terms of the GPL you're obviously
215	  permitted to copy, modify and distribute the code as you wish. Just
216	  not use it.
217
218config NFTL
219	tristate "NFTL (NAND Flash Translation Layer) support"
220	depends on BLOCK
221	select MTD_BLKDEVS
222	---help---
223	  This provides support for the NAND Flash Translation Layer which is
224	  used on M-Systems' DiskOnChip devices. It uses a kind of pseudo-
225	  file system on a flash device to emulate a block device with
226	  512-byte sectors, on top of which you put a 'normal' file system.
227
228	  You may find that the algorithms used in this code are patented
229	  unless you live in the Free World where software patents aren't
230	  legal - in the USA you are only permitted to use this on DiskOnChip
231	  hardware, although under the terms of the GPL you're obviously
232	  permitted to copy, modify and distribute the code as you wish. Just
233	  not use it.
234
235config NFTL_RW
236	bool "Write support for NFTL"
237	depends on NFTL
238	help
239	  Support for writing to the NAND Flash Translation Layer, as used
240	  on the DiskOnChip.
241
242config INFTL
243	tristate "INFTL (Inverse NAND Flash Translation Layer) support"
244	depends on BLOCK
245	select MTD_BLKDEVS
246	---help---
247	  This provides support for the Inverse NAND Flash Translation
248	  Layer which is used on M-Systems' newer DiskOnChip devices. It
249	  uses a kind of pseudo-file system on a flash device to emulate
250	  a block device with 512-byte sectors, on top of which you put
251	  a 'normal' file system.
252
253	  You may find that the algorithms used in this code are patented
254	  unless you live in the Free World where software patents aren't
255	  legal - in the USA you are only permitted to use this on DiskOnChip
256	  hardware, although under the terms of the GPL you're obviously
257	  permitted to copy, modify and distribute the code as you wish. Just
258	  not use it.
259
260config RFD_FTL
261        tristate "Resident Flash Disk (Flash Translation Layer) support"
262	depends on BLOCK
263	select MTD_BLKDEVS
264	---help---
265	  This provides support for the flash translation layer known
266	  as the Resident Flash Disk (RFD), as used by the Embedded BIOS
267	  of General Software. There is a blurb at:
268
269		http://www.gensw.com/pages/prod/bios/rfd.htm
270
271config SSFDC
272	tristate "NAND SSFDC (SmartMedia) read only translation layer"
273	depends on BLOCK
274	select MTD_BLKDEVS
275	help
276	  This enables read only access to SmartMedia formatted NAND
277	  flash. You can mount it with FAT file system.
278
279
280config SM_FTL
281	tristate "SmartMedia/xD new translation layer"
282	depends on BLOCK
283	select MTD_BLKDEVS
284	select MTD_NAND_ECC
285	help
286	  This enables EXPERIMENTAL R/W support for SmartMedia/xD
287	  FTL (Flash translation layer).
288	  Write support is only lightly tested, therefore this driver
289	  isn't recommended to use with valuable data (anyway if you have
290	  valuable data, do backups regardless of software/hardware you
291	  use, because you never know what will eat your data...)
292	  If you only need R/O access, you can use older R/O driver
293	  (CONFIG_SSFDC)
294
295config MTD_OOPS
296	tristate "Log panic/oops to an MTD buffer"
297	help
298	  This enables panic and oops messages to be logged to a circular
299	  buffer in a flash partition where it can be read back at some
300	  later point.
301
302config MTD_SWAP
303	tristate "Swap on MTD device support"
304	depends on MTD && SWAP
305	select MTD_BLKDEVS
306	help
307	  Provides volatile block device driver on top of mtd partition
308          suitable for swapping.  The mapping of written blocks is not saved.
309	  The driver provides wear leveling by storing erase counter into the
310	  OOB.
311
312config MTD_PARTITIONED_MASTER
313	bool "Retain master device when partitioned"
314	default n
315	depends on MTD
316	help
317	  For historical reasons, by default, either a master is present or
318	  several partitions are present, but not both. The concern was that
319	  data listed in multiple partitions was dangerous; however, SCSI does
320	  this and it is frequently useful for applications. This config option
321	  leaves the master in even if the device is partitioned. It also makes
322	  the parent of the partition device be the master device, rather than
323	  what lies behind the master.
324
325source "drivers/mtd/chips/Kconfig"
326
327source "drivers/mtd/maps/Kconfig"
328
329source "drivers/mtd/devices/Kconfig"
330
331source "drivers/mtd/nand/Kconfig"
332
333source "drivers/mtd/onenand/Kconfig"
334
335source "drivers/mtd/lpddr/Kconfig"
336
337source "drivers/mtd/spi-nor/Kconfig"
338
339source "drivers/mtd/ubi/Kconfig"
340
341endif # MTD
342