sysfs-class-mtd 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. What: /sys/class/mtd/
  2. Date: April 2009
  3. KernelVersion: 2.6.29
  4. Contact: linux-mtd@lists.infradead.org
  5. Description:
  6. The mtd/ class subdirectory belongs to the MTD subsystem
  7. (MTD core).
  8. What: /sys/class/mtd/mtdX/
  9. Date: April 2009
  10. KernelVersion: 2.6.29
  11. Contact: linux-mtd@lists.infradead.org
  12. Description:
  13. The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond
  14. to each /dev/mtdX character device. These may represent
  15. physical/simulated flash devices, partitions on a flash
  16. device, or concatenated flash devices.
  17. What: /sys/class/mtd/mtdXro/
  18. Date: April 2009
  19. KernelVersion: 2.6.29
  20. Contact: linux-mtd@lists.infradead.org
  21. Description:
  22. These directories provide the corresponding read-only device
  23. nodes for /sys/class/mtd/mtdX/ .
  24. What: /sys/class/mtd/mtdX/dev
  25. Date: April 2009
  26. KernelVersion: 2.6.29
  27. Contact: linux-mtd@lists.infradead.org
  28. Description:
  29. Major and minor numbers of the character device corresponding
  30. to this MTD device (in <major>:<minor> format). This is the
  31. read-write device so <minor> will be even.
  32. What: /sys/class/mtd/mtdXro/dev
  33. Date: April 2009
  34. KernelVersion: 2.6.29
  35. Contact: linux-mtd@lists.infradead.org
  36. Description:
  37. Major and minor numbers of the character device corresponding
  38. to the read-only variant of thie MTD device (in
  39. <major>:<minor> format). In this case <minor> will be odd.
  40. What: /sys/class/mtd/mtdX/erasesize
  41. Date: April 2009
  42. KernelVersion: 2.6.29
  43. Contact: linux-mtd@lists.infradead.org
  44. Description:
  45. "Major" erase size for the device. If numeraseregions is
  46. zero, this is the eraseblock size for the entire device.
  47. Otherwise, the MEMGETREGIONCOUNT/MEMGETREGIONINFO ioctls
  48. can be used to determine the actual eraseblock layout.
  49. What: /sys/class/mtd/mtdX/flags
  50. Date: April 2009
  51. KernelVersion: 2.6.29
  52. Contact: linux-mtd@lists.infradead.org
  53. Description:
  54. A hexadecimal value representing the device flags, ORed
  55. together:
  56. 0x0400: MTD_WRITEABLE - device is writable
  57. 0x0800: MTD_BIT_WRITEABLE - single bits can be flipped
  58. 0x1000: MTD_NO_ERASE - no erase necessary
  59. 0x2000: MTD_POWERUP_LOCK - always locked after reset
  60. What: /sys/class/mtd/mtdX/name
  61. Date: April 2009
  62. KernelVersion: 2.6.29
  63. Contact: linux-mtd@lists.infradead.org
  64. Description:
  65. A human-readable ASCII name for the device or partition.
  66. This will match the name in /proc/mtd .
  67. What: /sys/class/mtd/mtdX/numeraseregions
  68. Date: April 2009
  69. KernelVersion: 2.6.29
  70. Contact: linux-mtd@lists.infradead.org
  71. Description:
  72. For devices that have variable eraseblock sizes, this
  73. provides the total number of erase regions. Otherwise,
  74. it will read back as zero.
  75. What: /sys/class/mtd/mtdX/oobsize
  76. Date: April 2009
  77. KernelVersion: 2.6.29
  78. Contact: linux-mtd@lists.infradead.org
  79. Description:
  80. Number of OOB bytes per page.
  81. What: /sys/class/mtd/mtdX/size
  82. Date: April 2009
  83. KernelVersion: 2.6.29
  84. Contact: linux-mtd@lists.infradead.org
  85. Description:
  86. Total size of the device/partition, in bytes.
  87. What: /sys/class/mtd/mtdX/type
  88. Date: April 2009
  89. KernelVersion: 2.6.29
  90. Contact: linux-mtd@lists.infradead.org
  91. Description:
  92. One of the following ASCII strings, representing the device
  93. type:
  94. absent, ram, rom, nor, nand, dataflash, ubi, unknown
  95. What: /sys/class/mtd/mtdX/writesize
  96. Date: April 2009
  97. KernelVersion: 2.6.29
  98. Contact: linux-mtd@lists.infradead.org
  99. Description:
  100. Minimal writable flash unit size. This will always be
  101. a positive integer.
  102. In the case of NOR flash it is 1 (even though individual
  103. bits can be cleared).
  104. In the case of NAND flash it is one NAND page (or a
  105. half page, or a quarter page).
  106. In the case of ECC NOR, it is the ECC block size.
  107. What: /sys/class/mtd/mtdX/ecc_strength
  108. Date: April 2012
  109. KernelVersion: 3.4
  110. Contact: linux-mtd@lists.infradead.org
  111. Description:
  112. Maximum number of bit errors that the device is capable of
  113. correcting within each region covering an ecc step. This will
  114. always be a non-negative integer. Note that some devices will
  115. have multiple ecc steps within each writesize region.
  116. In the case of devices lacking any ECC capability, it is 0.
  117. What: /sys/class/mtd/mtdX/bitflip_threshold
  118. Date: April 2012
  119. KernelVersion: 3.4
  120. Contact: linux-mtd@lists.infradead.org
  121. Description:
  122. This allows the user to examine and adjust the criteria by which
  123. mtd returns -EUCLEAN from mtd_read() and mtd_read_oob(). If the
  124. maximum number of bit errors that were corrected on any single
  125. region comprising an ecc step (as reported by the driver) equals
  126. or exceeds this value, -EUCLEAN is returned. Otherwise, absent
  127. an error, 0 is returned. Higher layers (e.g., UBI) use this
  128. return code as an indication that an erase block may be
  129. degrading and should be scrutinized as a candidate for being
  130. marked as bad.
  131. The initial value may be specified by the flash device driver.
  132. If not, then the default value is ecc_strength.
  133. The introduction of this feature brings a subtle change to the
  134. meaning of the -EUCLEAN return code. Previously, it was
  135. interpreted to mean simply "one or more bit errors were
  136. corrected". Its new interpretation can be phrased as "a
  137. dangerously high number of bit errors were corrected on one or
  138. more regions comprising an ecc step". The precise definition of
  139. "dangerously high" can be adjusted by the user with
  140. bitflip_threshold. Users are discouraged from doing this,
  141. however, unless they know what they are doing and have intimate
  142. knowledge of the properties of their device. Broadly speaking,
  143. bitflip_threshold should be low enough to detect genuine erase
  144. block degradation, but high enough to avoid the consequences of
  145. a persistent return value of -EUCLEAN on devices where sticky
  146. bitflips occur. Note that if bitflip_threshold exceeds
  147. ecc_strength, -EUCLEAN is never returned by the read operations.
  148. Conversely, if bitflip_threshold is zero, -EUCLEAN is always
  149. returned, absent a hard error.
  150. This is generally applicable only to NAND flash devices with ECC
  151. capability. It is ignored on devices lacking ECC capability;
  152. i.e., devices for which ecc_strength is zero.