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