162306a36Sopenharmony_ciWhat: /sys/class/mtd/ 262306a36Sopenharmony_ciDate: April 2009 362306a36Sopenharmony_ciKernelVersion: 2.6.29 462306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 562306a36Sopenharmony_ciDescription: 662306a36Sopenharmony_ci The mtd/ class subdirectory belongs to the MTD subsystem 762306a36Sopenharmony_ci (MTD core). 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/ 1062306a36Sopenharmony_ciDate: April 2009 1162306a36Sopenharmony_ciKernelVersion: 2.6.29 1262306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 1362306a36Sopenharmony_ciDescription: 1462306a36Sopenharmony_ci The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond 1562306a36Sopenharmony_ci to each /dev/mtdX character device. These may represent 1662306a36Sopenharmony_ci physical/simulated flash devices, partitions on a flash 1762306a36Sopenharmony_ci device, or concatenated flash devices. 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdXro/ 2062306a36Sopenharmony_ciDate: April 2009 2162306a36Sopenharmony_ciKernelVersion: 2.6.29 2262306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 2362306a36Sopenharmony_ciDescription: 2462306a36Sopenharmony_ci These directories provide the corresponding read-only device 2562306a36Sopenharmony_ci nodes for /sys/class/mtd/mtdX/ . 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/dev 2862306a36Sopenharmony_ciDate: April 2009 2962306a36Sopenharmony_ciKernelVersion: 2.6.29 3062306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 3162306a36Sopenharmony_ciDescription: 3262306a36Sopenharmony_ci Major and minor numbers of the character device corresponding 3362306a36Sopenharmony_ci to this MTD device (in <major>:<minor> format). This is the 3462306a36Sopenharmony_ci read-write device so <minor> will be even. 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdXro/dev 3762306a36Sopenharmony_ciDate: April 2009 3862306a36Sopenharmony_ciKernelVersion: 2.6.29 3962306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 4062306a36Sopenharmony_ciDescription: 4162306a36Sopenharmony_ci Major and minor numbers of the character device corresponding 4262306a36Sopenharmony_ci to the read-only variant of the MTD device (in 4362306a36Sopenharmony_ci <major>:<minor> format). In this case <minor> will be odd. 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/erasesize 4662306a36Sopenharmony_ciDate: April 2009 4762306a36Sopenharmony_ciKernelVersion: 2.6.29 4862306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 4962306a36Sopenharmony_ciDescription: 5062306a36Sopenharmony_ci "Major" erase size for the device. If numeraseregions is 5162306a36Sopenharmony_ci zero, this is the eraseblock size for the entire device. 5262306a36Sopenharmony_ci Otherwise, the MEMGETREGIONCOUNT/MEMGETREGIONINFO ioctls 5362306a36Sopenharmony_ci can be used to determine the actual eraseblock layout. 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/flags 5662306a36Sopenharmony_ciDate: April 2009 5762306a36Sopenharmony_ciKernelVersion: 2.6.29 5862306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 5962306a36Sopenharmony_ciDescription: 6062306a36Sopenharmony_ci A hexadecimal value representing the device flags, ORed 6162306a36Sopenharmony_ci together: 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ci 0x0400: MTD_WRITEABLE - device is writable 6462306a36Sopenharmony_ci 0x0800: MTD_BIT_WRITEABLE - single bits can be flipped 6562306a36Sopenharmony_ci 0x1000: MTD_NO_ERASE - no erase necessary 6662306a36Sopenharmony_ci 0x2000: MTD_POWERUP_LOCK - always locked after reset 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/name 6962306a36Sopenharmony_ciDate: April 2009 7062306a36Sopenharmony_ciKernelVersion: 2.6.29 7162306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 7262306a36Sopenharmony_ciDescription: 7362306a36Sopenharmony_ci A human-readable ASCII name for the device or partition. 7462306a36Sopenharmony_ci This will match the name in /proc/mtd . 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/numeraseregions 7762306a36Sopenharmony_ciDate: April 2009 7862306a36Sopenharmony_ciKernelVersion: 2.6.29 7962306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 8062306a36Sopenharmony_ciDescription: 8162306a36Sopenharmony_ci For devices that have variable eraseblock sizes, this 8262306a36Sopenharmony_ci provides the total number of erase regions. Otherwise, 8362306a36Sopenharmony_ci it will read back as zero. 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/oobsize 8662306a36Sopenharmony_ciDate: April 2009 8762306a36Sopenharmony_ciKernelVersion: 2.6.29 8862306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 8962306a36Sopenharmony_ciDescription: 9062306a36Sopenharmony_ci Number of OOB bytes per page. 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/size 9362306a36Sopenharmony_ciDate: April 2009 9462306a36Sopenharmony_ciKernelVersion: 2.6.29 9562306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 9662306a36Sopenharmony_ciDescription: 9762306a36Sopenharmony_ci Total size of the device/partition, in bytes. 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/type 10062306a36Sopenharmony_ciDate: April 2009 10162306a36Sopenharmony_ciKernelVersion: 2.6.29 10262306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 10362306a36Sopenharmony_ciDescription: 10462306a36Sopenharmony_ci One of the following ASCII strings, representing the device 10562306a36Sopenharmony_ci type: 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci absent, ram, rom, nor, nand, mlc-nand, dataflash, ubi, unknown 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/writesize 11062306a36Sopenharmony_ciDate: April 2009 11162306a36Sopenharmony_ciKernelVersion: 2.6.29 11262306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 11362306a36Sopenharmony_ciDescription: 11462306a36Sopenharmony_ci Minimal writable flash unit size. This will always be 11562306a36Sopenharmony_ci a positive integer. 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci In the case of NOR flash it is 1 (even though individual 11862306a36Sopenharmony_ci bits can be cleared). 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci In the case of NAND flash it is one NAND page (or a 12162306a36Sopenharmony_ci half page, or a quarter page). 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci In the case of ECC NOR, it is the ECC block size. 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/ecc_strength 12662306a36Sopenharmony_ciDate: April 2012 12762306a36Sopenharmony_ciKernelVersion: 3.4 12862306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 12962306a36Sopenharmony_ciDescription: 13062306a36Sopenharmony_ci Maximum number of bit errors that the device is capable of 13162306a36Sopenharmony_ci correcting within each region covering an ECC step (see 13262306a36Sopenharmony_ci ecc_step_size). This will always be a non-negative integer. 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci In the case of devices lacking any ECC capability, it is 0. 13562306a36Sopenharmony_ci 13662306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/bitflip_threshold 13762306a36Sopenharmony_ciDate: April 2012 13862306a36Sopenharmony_ciKernelVersion: 3.4 13962306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 14062306a36Sopenharmony_ciDescription: 14162306a36Sopenharmony_ci This allows the user to examine and adjust the criteria by which 14262306a36Sopenharmony_ci mtd returns -EUCLEAN from mtd_read() and mtd_read_oob(). If the 14362306a36Sopenharmony_ci maximum number of bit errors that were corrected on any single 14462306a36Sopenharmony_ci region comprising an ecc step (as reported by the driver) equals 14562306a36Sopenharmony_ci or exceeds this value, -EUCLEAN is returned. Otherwise, absent 14662306a36Sopenharmony_ci an error, 0 is returned. Higher layers (e.g., UBI) use this 14762306a36Sopenharmony_ci return code as an indication that an erase block may be 14862306a36Sopenharmony_ci degrading and should be scrutinized as a candidate for being 14962306a36Sopenharmony_ci marked as bad. 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_ci The initial value may be specified by the flash device driver. 15262306a36Sopenharmony_ci If not, then the default value is ecc_strength. 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ci The introduction of this feature brings a subtle change to the 15562306a36Sopenharmony_ci meaning of the -EUCLEAN return code. Previously, it was 15662306a36Sopenharmony_ci interpreted to mean simply "one or more bit errors were 15762306a36Sopenharmony_ci corrected". Its new interpretation can be phrased as "a 15862306a36Sopenharmony_ci dangerously high number of bit errors were corrected on one or 15962306a36Sopenharmony_ci more regions comprising an ecc step". The precise definition of 16062306a36Sopenharmony_ci "dangerously high" can be adjusted by the user with 16162306a36Sopenharmony_ci bitflip_threshold. Users are discouraged from doing this, 16262306a36Sopenharmony_ci however, unless they know what they are doing and have intimate 16362306a36Sopenharmony_ci knowledge of the properties of their device. Broadly speaking, 16462306a36Sopenharmony_ci bitflip_threshold should be low enough to detect genuine erase 16562306a36Sopenharmony_ci block degradation, but high enough to avoid the consequences of 16662306a36Sopenharmony_ci a persistent return value of -EUCLEAN on devices where sticky 16762306a36Sopenharmony_ci bitflips occur. Note that if bitflip_threshold exceeds 16862306a36Sopenharmony_ci ecc_strength, -EUCLEAN is never returned by the read operations. 16962306a36Sopenharmony_ci Conversely, if bitflip_threshold is zero, -EUCLEAN is always 17062306a36Sopenharmony_ci returned, absent a hard error. 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci This is generally applicable only to NAND flash devices with ECC 17362306a36Sopenharmony_ci capability. It is ignored on devices lacking ECC capability; 17462306a36Sopenharmony_ci i.e., devices for which ecc_strength is zero. 17562306a36Sopenharmony_ci 17662306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/ecc_step_size 17762306a36Sopenharmony_ciDate: May 2013 17862306a36Sopenharmony_ciKernelVersion: 3.10 17962306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 18062306a36Sopenharmony_ciDescription: 18162306a36Sopenharmony_ci The size of a single region covered by ECC, known as the ECC 18262306a36Sopenharmony_ci step. Devices may have several equally sized ECC steps within 18362306a36Sopenharmony_ci each writesize region. 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci It will always be a non-negative integer. In the case of 18662306a36Sopenharmony_ci devices lacking any ECC capability, it is 0. 18762306a36Sopenharmony_ci 18862306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/ecc_failures 18962306a36Sopenharmony_ciDate: June 2014 19062306a36Sopenharmony_ciKernelVersion: 3.17 19162306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 19262306a36Sopenharmony_ciDescription: 19362306a36Sopenharmony_ci The number of failures reported by this device's ECC. Typically, 19462306a36Sopenharmony_ci these failures are associated with failed read operations. 19562306a36Sopenharmony_ci 19662306a36Sopenharmony_ci It will always be a non-negative integer. In the case of 19762306a36Sopenharmony_ci devices lacking any ECC capability, it is 0. 19862306a36Sopenharmony_ci 19962306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/corrected_bits 20062306a36Sopenharmony_ciDate: June 2014 20162306a36Sopenharmony_ciKernelVersion: 3.17 20262306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 20362306a36Sopenharmony_ciDescription: 20462306a36Sopenharmony_ci The number of bits that have been corrected by means of the 20562306a36Sopenharmony_ci device's ECC. 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci It will always be a non-negative integer. In the case of 20862306a36Sopenharmony_ci devices lacking any ECC capability, it is 0. 20962306a36Sopenharmony_ci 21062306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/bad_blocks 21162306a36Sopenharmony_ciDate: June 2014 21262306a36Sopenharmony_ciKernelVersion: 3.17 21362306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 21462306a36Sopenharmony_ciDescription: 21562306a36Sopenharmony_ci The number of blocks marked as bad, if any, in this partition. 21662306a36Sopenharmony_ci 21762306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/bbt_blocks 21862306a36Sopenharmony_ciDate: June 2014 21962306a36Sopenharmony_ciKernelVersion: 3.17 22062306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 22162306a36Sopenharmony_ciDescription: 22262306a36Sopenharmony_ci The number of blocks that are marked as reserved, if any, in 22362306a36Sopenharmony_ci this partition. These are typically used to store the in-flash 22462306a36Sopenharmony_ci bad block table (BBT). 22562306a36Sopenharmony_ci 22662306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/offset 22762306a36Sopenharmony_ciDate: March 2015 22862306a36Sopenharmony_ciKernelVersion: 4.1 22962306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 23062306a36Sopenharmony_ciDescription: 23162306a36Sopenharmony_ci For a partition, the offset of that partition from the start 23262306a36Sopenharmony_ci of the parent (another partition or a flash device) in bytes. 23362306a36Sopenharmony_ci This attribute is absent on flash devices, so it can be used 23462306a36Sopenharmony_ci to distinguish them from partitions. 23562306a36Sopenharmony_ci 23662306a36Sopenharmony_ciWhat: /sys/class/mtd/mtdX/oobavail 23762306a36Sopenharmony_ciDate: April 2018 23862306a36Sopenharmony_ciKernelVersion: 4.16 23962306a36Sopenharmony_ciContact: linux-mtd@lists.infradead.org 24062306a36Sopenharmony_ciDescription: 24162306a36Sopenharmony_ci Number of bytes available for a client to place data into 24262306a36Sopenharmony_ci the out of band area. 243