xref: /openbmc/u-boot/drivers/mtd/ubi/Kconfig (revision 82bd2f29)
1menu "UBI support"
2
3config MTD_UBI
4	bool "Enable UBI - Unsorted block images"
5	select CRC32
6	help
7	  UBI is a software layer above MTD layer which admits of LVM-like
8	  logical volumes on top of MTD devices, hides some complexities of
9	  flash chips like wear and bad blocks and provides some other useful
10	  capabilities. Please, consult the MTD web site for more details
11	  (www.linux-mtd.infradead.org).
12
13if MTD_UBI
14
15config MTD_UBI_WL_THRESHOLD
16	int "UBI wear-leveling threshold"
17	default 4096
18	range 2 65536
19	help
20	  This parameter defines the maximum difference between the highest
21	  erase counter value and the lowest erase counter value of eraseblocks
22	  of UBI devices. When this threshold is exceeded, UBI starts performing
23	  wear leveling by means of moving data from eraseblock with low erase
24	  counter to eraseblocks with high erase counter.
25
26	  The default value should be OK for SLC NAND flashes, NOR flashes and
27	  other flashes which have eraseblock life-cycle 100000 or more.
28	  However, in case of MLC NAND flashes which typically have eraseblock
29	  life-cycle less than 10000, the threshold should be lessened (e.g.,
30	  to 128 or 256, although it does not have to be power of 2).
31
32config MTD_UBI_BEB_LIMIT
33	int "Maximum expected bad eraseblock count per 1024 eraseblocks"
34	default 20
35	range 0 768
36	help
37	  This option specifies the maximum bad physical eraseblocks UBI
38	  expects on the MTD device (per 1024 eraseblocks). If the underlying
39	  flash does not admit of bad eraseblocks (e.g. NOR flash), this value
40	  is ignored.
41
42	  NAND datasheets often specify the minimum and maximum NVM (Number of
43	  Valid Blocks) for the flashes' endurance lifetime. The maximum
44	  expected bad eraseblocks per 1024 eraseblocks then can be calculated
45	  as "1024 * (1 - MinNVB / MaxNVB)", which gives 20 for most NANDs
46	  (MaxNVB is basically the total count of eraseblocks on the chip).
47
48	  To put it differently, if this value is 20, UBI will try to reserve
49	  about 1.9% of physical eraseblocks for bad blocks handling. And that
50	  will be 1.9% of eraseblocks on the entire NAND chip, not just the MTD
51	  partition UBI attaches. This means that if you have, say, a NAND
52	  flash chip admits maximum 40 bad eraseblocks, and it is split on two
53	  MTD partitions of the same size, UBI will reserve 40 eraseblocks when
54	  attaching a partition.
55
56	  This option can be overridden by the "mtd=" UBI module parameter or
57	  by the "attach" ioctl.
58
59	  Leave the default value if unsure.
60
61config MTD_UBI_FASTMAP
62	bool "UBI Fastmap (Experimental feature)"
63	default n
64	help
65	   Important: this feature is experimental so far and the on-flash
66	   format for fastmap may change in the next kernel versions
67
68	   Fastmap is a mechanism which allows attaching an UBI device
69	   in nearly constant time. Instead of scanning the whole MTD device it
70	   only has to locate a checkpoint (called fastmap) on the device.
71	   The on-flash fastmap contains all information needed to attach
72	   the device. Using fastmap makes only sense on large devices where
73	   attaching by scanning takes long. UBI will not automatically install
74	   a fastmap on old images, but you can set the UBI module parameter
75	   fm_autoconvert to 1 if you want so. Please note that fastmap-enabled
76	   images are still usable with UBI implementations without
77	   fastmap support. On typical flash devices the whole fastmap fits
78	   into one PEB. UBI will reserve PEBs to hold two fastmaps.
79
80	   If in doubt, say "N".
81
82config MTD_UBI_FASTMAP_AUTOCONVERT
83	int "enable UBI Fastmap autoconvert"
84	depends on MTD_UBI_FASTMAP
85	default 0
86	help
87	  Set this parameter to enable fastmap automatically on images
88	  without a fastmap.
89
90config MTD_UBI_FM_DEBUG
91	int "Enable UBI fastmap debug"
92	depends on MTD_UBI_FASTMAP
93	default 0
94	help
95	  Enable UBI fastmap debug
96
97endif # MTD_UBI
98endmenu # "Enable UBI - Unsorted block images"
99