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