mmc-dev-attrs.txt 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. SD and MMC Block Device Attributes
  2. ==================================
  3. These attributes are defined for the block devices associated with the
  4. SD or MMC device.
  5. The following attributes are read/write.
  6. force_ro Enforce read-only access even if write protect switch is off.
  7. num_wr_reqs_to_start_packing This attribute is used to determine
  8. the trigger for activating the write packing, in case the write
  9. packing control feature is enabled.
  10. When the MMC manages to reach a point where num_wr_reqs_to_start_packing
  11. write requests could be packed, it enables the write packing feature.
  12. This allows us to start the write packing only when it is beneficial
  13. and has minimum affect on the read latency.
  14. The number of potential packed requests that will trigger the packing
  15. can be configured via sysfs by writing the required value to:
  16. /sys/block/<block_dev_name>/num_wr_reqs_to_start_packing.
  17. The default value of num_wr_reqs_to_start_packing was determined by
  18. running parallel lmdd write and lmdd read operations and calculating
  19. the max number of packed writes requests.
  20. bkops_check_threshold This attribute is used to determine whether
  21. the status bit that indicates the need for BKOPS should be checked.
  22. The value should be given in percentages of the card size.
  23. This value is used to calculate the minimum number of sectors that
  24. needs to be changed in the device (written or discarded) in order to
  25. require the status-bit of BKOPS to be checked.
  26. The value can modified via sysfs by writing the required value to:
  27. /sys/block/<block_dev_name>/bkops_check_threshold
  28. SD and MMC Device Attributes
  29. ============================
  30. All attributes are read-only.
  31. cid Card Identification Register
  32. csd Card Specific Data Register
  33. scr SD Card Configuration Register (SD only)
  34. date Manufacturing Date (from CID Register)
  35. fwrev Firmware/Product Revision (from CID Register) (SD and MMCv1 only)
  36. hwrev Hardware/Product Revision (from CID Register) (SD and MMCv1 only)
  37. manfid Manufacturer ID (from CID Register)
  38. name Product Name (from CID Register)
  39. oemid OEM/Application ID (from CID Register)
  40. prv Product Revision (from CID Register) (SD and MMCv4 only)
  41. serial Product Serial Number (from CID Register)
  42. erase_size Erase group size
  43. preferred_erase_size Preferred erase size
  44. raw_rpmb_size_mult RPMB partition size
  45. rel_sectors Reliable write sector count
  46. Note on Erase Size and Preferred Erase Size:
  47. "erase_size" is the minimum size, in bytes, of an erase
  48. operation. For MMC, "erase_size" is the erase group size
  49. reported by the card. Note that "erase_size" does not apply
  50. to trim or secure trim operations where the minimum size is
  51. always one 512 byte sector. For SD, "erase_size" is 512
  52. if the card is block-addressed, 0 otherwise.
  53. SD/MMC cards can erase an arbitrarily large area up to and
  54. including the whole card. When erasing a large area it may
  55. be desirable to do it in smaller chunks for three reasons:
  56. 1. A single erase command will make all other I/O on
  57. the card wait. This is not a problem if the whole card
  58. is being erased, but erasing one partition will make
  59. I/O for another partition on the same card wait for the
  60. duration of the erase - which could be a several
  61. minutes.
  62. 2. To be able to inform the user of erase progress.
  63. 3. The erase timeout becomes too large to be very
  64. useful. Because the erase timeout contains a margin
  65. which is multiplied by the size of the erase area,
  66. the value can end up being several minutes for large
  67. areas.
  68. "erase_size" is not the most efficient unit to erase
  69. (especially for SD where it is just one sector),
  70. hence "preferred_erase_size" provides a good chunk
  71. size for erasing large areas.
  72. For MMC, "preferred_erase_size" is the high-capacity
  73. erase size if a card specifies one, otherwise it is
  74. based on the capacity of the card.
  75. For SD, "preferred_erase_size" is the allocation unit
  76. size specified by the card.
  77. "preferred_erase_size" is in bytes.
  78. Note on raw_rpmb_size_mult:
  79. "raw_rpmb_size_mult" is a mutliple of 128kB block.
  80. RPMB size in byte is calculated by using the following equation:
  81. RPMB partition size = 128kB x raw_rpmb_size_mult
  82. SD/MMC/SDIO Clock Gating Attribute
  83. ==================================
  84. Read and write access is provided to following attribute.
  85. This attribute appears only if CONFIG_MMC_CLKGATE is enabled.
  86. clkgate_delay Tune the clock gating delay with desired value in milliseconds.
  87. echo <desired delay> > /sys/class/mmc_host/mmcX/clkgate_delay
  88. SD/MMC/SDIO Clock Scaling Attributes
  89. ====================================
  90. Read and write accesses are provided to following attributes.
  91. polling_interval Measured in milliseconds, this attribute
  92. defines how often we need to check the card
  93. usage and make decisions on frequency scaling.
  94. up_threshold This attribute defines what should be the
  95. average card usage between the polling
  96. interval for the mmc core to make a decision
  97. on whether it should increase the frequency.
  98. For example when it is set to '35' it means
  99. that between the checking intervals the card
  100. needs to be on average more than 35% in use to
  101. scale up the frequency. The value should be
  102. between 0 - 100 so that it can be compared
  103. against load percentage.
  104. down_threshold Similar to up_threshold, but on lowering the
  105. frequency. For example, when it is set to '2'
  106. it means that between the checking intervals
  107. the card needs to be on average less than 2%
  108. in use to scale down the clocks to minimum
  109. frequency. The value should be between 0 - 100
  110. so that it can be compared against load
  111. percentage.
  112. enable Enable clock scaling for hosts (and cards)
  113. that support ultrahigh speed modes
  114. (SDR104, DDR50, HS200).
  115. echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/polling_interval
  116. echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/up_threshold
  117. echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/down_threshold
  118. echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/enable