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