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