sysfs-class-mtd 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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, mlc-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 (see
  114. ecc_step_size). This will always be a non-negative integer.
  115. In the case of devices lacking any ECC capability, it is 0.
  116. What: /sys/class/mtd/mtdX/bitflip_threshold
  117. Date: April 2012
  118. KernelVersion: 3.4
  119. Contact: linux-mtd@lists.infradead.org
  120. Description:
  121. This allows the user to examine and adjust the criteria by which
  122. mtd returns -EUCLEAN from mtd_read() and mtd_read_oob(). If the
  123. maximum number of bit errors that were corrected on any single
  124. region comprising an ecc step (as reported by the driver) equals
  125. or exceeds this value, -EUCLEAN is returned. Otherwise, absent
  126. an error, 0 is returned. Higher layers (e.g., UBI) use this
  127. return code as an indication that an erase block may be
  128. degrading and should be scrutinized as a candidate for being
  129. marked as bad.
  130. The initial value may be specified by the flash device driver.
  131. If not, then the default value is ecc_strength.
  132. The introduction of this feature brings a subtle change to the
  133. meaning of the -EUCLEAN return code. Previously, it was
  134. interpreted to mean simply "one or more bit errors were
  135. corrected". Its new interpretation can be phrased as "a
  136. dangerously high number of bit errors were corrected on one or
  137. more regions comprising an ecc step". The precise definition of
  138. "dangerously high" can be adjusted by the user with
  139. bitflip_threshold. Users are discouraged from doing this,
  140. however, unless they know what they are doing and have intimate
  141. knowledge of the properties of their device. Broadly speaking,
  142. bitflip_threshold should be low enough to detect genuine erase
  143. block degradation, but high enough to avoid the consequences of
  144. a persistent return value of -EUCLEAN on devices where sticky
  145. bitflips occur. Note that if bitflip_threshold exceeds
  146. ecc_strength, -EUCLEAN is never returned by the read operations.
  147. Conversely, if bitflip_threshold is zero, -EUCLEAN is always
  148. returned, absent a hard error.
  149. This is generally applicable only to NAND flash devices with ECC
  150. capability. It is ignored on devices lacking ECC capability;
  151. i.e., devices for which ecc_strength is zero.
  152. What: /sys/class/mtd/mtdX/ecc_step_size
  153. Date: May 2013
  154. KernelVersion: 3.10
  155. Contact: linux-mtd@lists.infradead.org
  156. Description:
  157. The size of a single region covered by ECC, known as the ECC
  158. step. Devices may have several equally sized ECC steps within
  159. each writesize region.
  160. It will always be a non-negative integer. In the case of
  161. devices lacking any ECC capability, it is 0.
  162. What: /sys/class/mtd/mtdX/ecc_failures
  163. Date: June 2014
  164. KernelVersion: 3.17
  165. Contact: linux-mtd@lists.infradead.org
  166. Description:
  167. The number of failures reported by this device's ECC. Typically,
  168. these failures are associated with failed read operations.
  169. It will always be a non-negative integer. In the case of
  170. devices lacking any ECC capability, it is 0.
  171. What: /sys/class/mtd/mtdX/corrected_bits
  172. Date: June 2014
  173. KernelVersion: 3.17
  174. Contact: linux-mtd@lists.infradead.org
  175. Description:
  176. The number of bits that have been corrected by means of the
  177. device's ECC.
  178. It will always be a non-negative integer. In the case of
  179. devices lacking any ECC capability, it is 0.
  180. What: /sys/class/mtd/mtdX/bad_blocks
  181. Date: June 2014
  182. KernelVersion: 3.17
  183. Contact: linux-mtd@lists.infradead.org
  184. Description:
  185. The number of blocks marked as bad, if any, in this partition.
  186. What: /sys/class/mtd/mtdX/bbt_blocks
  187. Date: June 2014
  188. KernelVersion: 3.17
  189. Contact: linux-mtd@lists.infradead.org
  190. Description:
  191. The number of blocks that are marked as reserved, if any, in
  192. this partition. These are typically used to store the in-flash
  193. bad block table (BBT).
  194. What: /sys/class/mtd/mtdX/offset
  195. Date: March 2015
  196. KernelVersion: 4.1
  197. Contact: linux-mtd@lists.infradead.org
  198. Description:
  199. For a partition, the offset of that partition from the start
  200. of the master device in bytes. This attribute is absent on
  201. main devices, so it can be used to distinguish between
  202. partitions and devices that aren't partitions.