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