blob: 5783d36c048fbd9bdc4c1d3110987337bd7feeea [file] [log] [blame]
Heiko Schocher8f2fe0c2016-09-21 07:58:19 +02001menu "UBI support"
2
Markus Klotzbuecher5ebd3df2019-05-15 15:15:56 +02003config UBI_SILENCE_MSG
Petr Vorelc0ce4ce2018-03-24 01:49:24 +01004 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
Heiko Schocher8f2fe0c2016-09-21 07:58:19 +020010config MTD_UBI
11 bool "Enable UBI - Unsorted block images"
Karl Beldanfc94f202017-07-12 16:11:43 +000012 select RBTREE
Karl Beldanf8dc5a02017-07-12 16:11:45 +000013 select MTD_PARTITIONS
Heiko Schocher8f2fe0c2016-09-21 07:58:19 +020014 help
15 UBI is a software layer above MTD layer which admits of LVM-like
16 logical volumes on top of MTD devices, hides some complexities of
17 flash chips like wear and bad blocks and provides some other useful
18 capabilities. Please, consult the MTD web site for more details
19 (www.linux-mtd.infradead.org).
20
21if MTD_UBI
22
Tom Rini2c065ae2022-12-04 10:03:30 -050023config MTD_UBI_BLOCK
24 def_bool n
25
26config MTD_UBI_MODULE
27 def_bool y
28 help
29 ubi_init() disables returning error codes when built into the Linux
30 kernel so that it doesn't hang the Linux kernel boot process. Since
31 the U-Boot driver code depends on getting valid error codes from this
32 function we just tell the UBI layer that we are building as a module
33 (which only enables the additional error reporting).
34
Heiko Schocher8f2fe0c2016-09-21 07:58:19 +020035config MTD_UBI_WL_THRESHOLD
36 int "UBI wear-leveling threshold"
37 default 4096
38 range 2 65536
39 help
40 This parameter defines the maximum difference between the highest
41 erase counter value and the lowest erase counter value of eraseblocks
42 of UBI devices. When this threshold is exceeded, UBI starts performing
43 wear leveling by means of moving data from eraseblock with low erase
44 counter to eraseblocks with high erase counter.
45
46 The default value should be OK for SLC NAND flashes, NOR flashes and
47 other flashes which have eraseblock life-cycle 100000 or more.
48 However, in case of MLC NAND flashes which typically have eraseblock
49 life-cycle less than 10000, the threshold should be lessened (e.g.,
50 to 128 or 256, although it does not have to be power of 2).
51
52config MTD_UBI_BEB_LIMIT
53 int "Maximum expected bad eraseblock count per 1024 eraseblocks"
54 default 20
55 range 0 768
56 help
57 This option specifies the maximum bad physical eraseblocks UBI
58 expects on the MTD device (per 1024 eraseblocks). If the underlying
59 flash does not admit of bad eraseblocks (e.g. NOR flash), this value
60 is ignored.
61
62 NAND datasheets often specify the minimum and maximum NVM (Number of
63 Valid Blocks) for the flashes' endurance lifetime. The maximum
64 expected bad eraseblocks per 1024 eraseblocks then can be calculated
65 as "1024 * (1 - MinNVB / MaxNVB)", which gives 20 for most NANDs
66 (MaxNVB is basically the total count of eraseblocks on the chip).
67
68 To put it differently, if this value is 20, UBI will try to reserve
69 about 1.9% of physical eraseblocks for bad blocks handling. And that
70 will be 1.9% of eraseblocks on the entire NAND chip, not just the MTD
71 partition UBI attaches. This means that if you have, say, a NAND
72 flash chip admits maximum 40 bad eraseblocks, and it is split on two
73 MTD partitions of the same size, UBI will reserve 40 eraseblocks when
74 attaching a partition.
75
76 This option can be overridden by the "mtd=" UBI module parameter or
77 by the "attach" ioctl.
78
79 Leave the default value if unsure.
80
81config MTD_UBI_FASTMAP
82 bool "UBI Fastmap (Experimental feature)"
Heiko Schocher8f2fe0c2016-09-21 07:58:19 +020083 help
84 Important: this feature is experimental so far and the on-flash
85 format for fastmap may change in the next kernel versions
86
87 Fastmap is a mechanism which allows attaching an UBI device
88 in nearly constant time. Instead of scanning the whole MTD device it
89 only has to locate a checkpoint (called fastmap) on the device.
90 The on-flash fastmap contains all information needed to attach
91 the device. Using fastmap makes only sense on large devices where
92 attaching by scanning takes long. UBI will not automatically install
93 a fastmap on old images, but you can set the UBI module parameter
94 fm_autoconvert to 1 if you want so. Please note that fastmap-enabled
95 images are still usable with UBI implementations without
96 fastmap support. On typical flash devices the whole fastmap fits
97 into one PEB. UBI will reserve PEBs to hold two fastmaps.
98
99 If in doubt, say "N".
100
101config MTD_UBI_FASTMAP_AUTOCONVERT
102 int "enable UBI Fastmap autoconvert"
103 depends on MTD_UBI_FASTMAP
104 default 0
105 help
106 Set this parameter to enable fastmap automatically on images
107 without a fastmap.
108
109config MTD_UBI_FM_DEBUG
110 int "Enable UBI fastmap debug"
111 depends on MTD_UBI_FASTMAP
112 default 0
113 help
114 Enable UBI fastmap debug
115
116endif # MTD_UBI
117endmenu # "Enable UBI - Unsorted block images"