18f2fe0c8SHeiko Schochermenu "UBI support" 28f2fe0c8SHeiko Schocher 3*0d5390ceSPetr Vorelconfig CONFIG_UBI_SILENCE_MSG 4*0d5390ceSPetr Vorel bool "UBI silence verbose messages" 5*0d5390ceSPetr Vorel default ENV_IS_IN_UBI 6*0d5390ceSPetr Vorel help 7*0d5390ceSPetr Vorel Make the verbose messages from UBI stop printing. This leaves 8*0d5390ceSPetr Vorel warnings and errors enabled. 9*0d5390ceSPetr Vorel 108f2fe0c8SHeiko Schocherconfig MTD_UBI 118f2fe0c8SHeiko Schocher bool "Enable UBI - Unsorted block images" 12fc94f209SKarl Beldan select RBTREE 13f8dc5a0fSKarl Beldan select MTD_PARTITIONS 148f2fe0c8SHeiko Schocher help 158f2fe0c8SHeiko Schocher UBI is a software layer above MTD layer which admits of LVM-like 168f2fe0c8SHeiko Schocher logical volumes on top of MTD devices, hides some complexities of 178f2fe0c8SHeiko Schocher flash chips like wear and bad blocks and provides some other useful 188f2fe0c8SHeiko Schocher capabilities. Please, consult the MTD web site for more details 198f2fe0c8SHeiko Schocher (www.linux-mtd.infradead.org). 208f2fe0c8SHeiko Schocher 218f2fe0c8SHeiko Schocherif MTD_UBI 228f2fe0c8SHeiko Schocher 238f2fe0c8SHeiko Schocherconfig MTD_UBI_WL_THRESHOLD 248f2fe0c8SHeiko Schocher int "UBI wear-leveling threshold" 258f2fe0c8SHeiko Schocher default 4096 268f2fe0c8SHeiko Schocher range 2 65536 278f2fe0c8SHeiko Schocher help 288f2fe0c8SHeiko Schocher This parameter defines the maximum difference between the highest 298f2fe0c8SHeiko Schocher erase counter value and the lowest erase counter value of eraseblocks 308f2fe0c8SHeiko Schocher of UBI devices. When this threshold is exceeded, UBI starts performing 318f2fe0c8SHeiko Schocher wear leveling by means of moving data from eraseblock with low erase 328f2fe0c8SHeiko Schocher counter to eraseblocks with high erase counter. 338f2fe0c8SHeiko Schocher 348f2fe0c8SHeiko Schocher The default value should be OK for SLC NAND flashes, NOR flashes and 358f2fe0c8SHeiko Schocher other flashes which have eraseblock life-cycle 100000 or more. 368f2fe0c8SHeiko Schocher However, in case of MLC NAND flashes which typically have eraseblock 378f2fe0c8SHeiko Schocher life-cycle less than 10000, the threshold should be lessened (e.g., 388f2fe0c8SHeiko Schocher to 128 or 256, although it does not have to be power of 2). 398f2fe0c8SHeiko Schocher 408f2fe0c8SHeiko Schocherconfig MTD_UBI_BEB_LIMIT 418f2fe0c8SHeiko Schocher int "Maximum expected bad eraseblock count per 1024 eraseblocks" 428f2fe0c8SHeiko Schocher default 20 438f2fe0c8SHeiko Schocher range 0 768 448f2fe0c8SHeiko Schocher help 458f2fe0c8SHeiko Schocher This option specifies the maximum bad physical eraseblocks UBI 468f2fe0c8SHeiko Schocher expects on the MTD device (per 1024 eraseblocks). If the underlying 478f2fe0c8SHeiko Schocher flash does not admit of bad eraseblocks (e.g. NOR flash), this value 488f2fe0c8SHeiko Schocher is ignored. 498f2fe0c8SHeiko Schocher 508f2fe0c8SHeiko Schocher NAND datasheets often specify the minimum and maximum NVM (Number of 518f2fe0c8SHeiko Schocher Valid Blocks) for the flashes' endurance lifetime. The maximum 528f2fe0c8SHeiko Schocher expected bad eraseblocks per 1024 eraseblocks then can be calculated 538f2fe0c8SHeiko Schocher as "1024 * (1 - MinNVB / MaxNVB)", which gives 20 for most NANDs 548f2fe0c8SHeiko Schocher (MaxNVB is basically the total count of eraseblocks on the chip). 558f2fe0c8SHeiko Schocher 568f2fe0c8SHeiko Schocher To put it differently, if this value is 20, UBI will try to reserve 578f2fe0c8SHeiko Schocher about 1.9% of physical eraseblocks for bad blocks handling. And that 588f2fe0c8SHeiko Schocher will be 1.9% of eraseblocks on the entire NAND chip, not just the MTD 598f2fe0c8SHeiko Schocher partition UBI attaches. This means that if you have, say, a NAND 608f2fe0c8SHeiko Schocher flash chip admits maximum 40 bad eraseblocks, and it is split on two 618f2fe0c8SHeiko Schocher MTD partitions of the same size, UBI will reserve 40 eraseblocks when 628f2fe0c8SHeiko Schocher attaching a partition. 638f2fe0c8SHeiko Schocher 648f2fe0c8SHeiko Schocher This option can be overridden by the "mtd=" UBI module parameter or 658f2fe0c8SHeiko Schocher by the "attach" ioctl. 668f2fe0c8SHeiko Schocher 678f2fe0c8SHeiko Schocher Leave the default value if unsure. 688f2fe0c8SHeiko Schocher 698f2fe0c8SHeiko Schocherconfig MTD_UBI_FASTMAP 708f2fe0c8SHeiko Schocher bool "UBI Fastmap (Experimental feature)" 718f2fe0c8SHeiko Schocher default n 728f2fe0c8SHeiko Schocher help 738f2fe0c8SHeiko Schocher Important: this feature is experimental so far and the on-flash 748f2fe0c8SHeiko Schocher format for fastmap may change in the next kernel versions 758f2fe0c8SHeiko Schocher 768f2fe0c8SHeiko Schocher Fastmap is a mechanism which allows attaching an UBI device 778f2fe0c8SHeiko Schocher in nearly constant time. Instead of scanning the whole MTD device it 788f2fe0c8SHeiko Schocher only has to locate a checkpoint (called fastmap) on the device. 798f2fe0c8SHeiko Schocher The on-flash fastmap contains all information needed to attach 808f2fe0c8SHeiko Schocher the device. Using fastmap makes only sense on large devices where 818f2fe0c8SHeiko Schocher attaching by scanning takes long. UBI will not automatically install 828f2fe0c8SHeiko Schocher a fastmap on old images, but you can set the UBI module parameter 838f2fe0c8SHeiko Schocher fm_autoconvert to 1 if you want so. Please note that fastmap-enabled 848f2fe0c8SHeiko Schocher images are still usable with UBI implementations without 858f2fe0c8SHeiko Schocher fastmap support. On typical flash devices the whole fastmap fits 868f2fe0c8SHeiko Schocher into one PEB. UBI will reserve PEBs to hold two fastmaps. 878f2fe0c8SHeiko Schocher 888f2fe0c8SHeiko Schocher If in doubt, say "N". 898f2fe0c8SHeiko Schocher 908f2fe0c8SHeiko Schocherconfig MTD_UBI_FASTMAP_AUTOCONVERT 918f2fe0c8SHeiko Schocher int "enable UBI Fastmap autoconvert" 928f2fe0c8SHeiko Schocher depends on MTD_UBI_FASTMAP 938f2fe0c8SHeiko Schocher default 0 948f2fe0c8SHeiko Schocher help 958f2fe0c8SHeiko Schocher Set this parameter to enable fastmap automatically on images 968f2fe0c8SHeiko Schocher without a fastmap. 978f2fe0c8SHeiko Schocher 988f2fe0c8SHeiko Schocherconfig MTD_UBI_FM_DEBUG 998f2fe0c8SHeiko Schocher int "Enable UBI fastmap debug" 1008f2fe0c8SHeiko Schocher depends on MTD_UBI_FASTMAP 1018f2fe0c8SHeiko Schocher default 0 1028f2fe0c8SHeiko Schocher help 1038f2fe0c8SHeiko Schocher Enable UBI fastmap debug 1048f2fe0c8SHeiko Schocher 1058f2fe0c8SHeiko Schocherendif # MTD_UBI 1068f2fe0c8SHeiko Schocherendmenu # "Enable UBI - Unsorted block images" 107