blob: 1d832d430f66ea0855b5322a7069dbccb7b9f06d [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 Brokhmanc879b062014-12-03 23:38:06 +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
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070028SD and MMC Device Attributes
29============================
30
31All attributes are read-only.
32
Sujit Reddy Thumma00d52ac2012-11-07 21:23:14 +053033 cid Card Identification Register
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070034 csd Card Specific Data Register
35 scr SD Card Configuration Register (SD only)
36 date Manufacturing Date (from CID Register)
37 fwrev Firmware/Product Revision (from CID Register) (SD and MMCv1 only)
38 hwrev Hardware/Product Revision (from CID Register) (SD and MMCv1 only)
39 manfid Manufacturer ID (from CID Register)
40 name Product Name (from CID Register)
41 oemid OEM/Application ID (from CID Register)
Bernie Thompson51e7e8b2013-02-27 12:19:17 -080042 prv Product Revision (from CID Register) (SD and MMCv4 only)
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070043 serial Product Serial Number (from CID Register)
44 erase_size Erase group size
45 preferred_erase_size Preferred erase size
Loic Pallardy188cc042012-08-06 17:12:29 +020046 raw_rpmb_size_mult RPMB partition size
47 rel_sectors Reliable write sector count
Bojan Prtvar5fb06af2016-07-04 13:56:55 +020048 ocr Operation Conditions Register
Bojan Prtvar6825a602016-07-19 11:16:38 +020049 dsr Driver Stage Register
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070050
51Note on Erase Size and Preferred Erase Size:
52
53 "erase_size" is the minimum size, in bytes, of an erase
54 operation. For MMC, "erase_size" is the erase group size
55 reported by the card. Note that "erase_size" does not apply
56 to trim or secure trim operations where the minimum size is
57 always one 512 byte sector. For SD, "erase_size" is 512
58 if the card is block-addressed, 0 otherwise.
59
60 SD/MMC cards can erase an arbitrarily large area up to and
61 including the whole card. When erasing a large area it may
62 be desirable to do it in smaller chunks for three reasons:
63 1. A single erase command will make all other I/O on
64 the card wait. This is not a problem if the whole card
65 is being erased, but erasing one partition will make
66 I/O for another partition on the same card wait for the
67 duration of the erase - which could be a several
68 minutes.
69 2. To be able to inform the user of erase progress.
70 3. The erase timeout becomes too large to be very
71 useful. Because the erase timeout contains a margin
72 which is multiplied by the size of the erase area,
73 the value can end up being several minutes for large
74 areas.
75
76 "erase_size" is not the most efficient unit to erase
77 (especially for SD where it is just one sector),
78 hence "preferred_erase_size" provides a good chunk
79 size for erasing large areas.
80
81 For MMC, "preferred_erase_size" is the high-capacity
82 erase size if a card specifies one, otherwise it is
83 based on the capacity of the card.
84
85 For SD, "preferred_erase_size" is the allocation unit
86 size specified by the card.
87
88 "preferred_erase_size" is in bytes.
Sujit Reddy Thumma597dd9d792011-11-14 13:53:29 +053089
Loic Pallardy188cc042012-08-06 17:12:29 +020090Note on raw_rpmb_size_mult:
91 "raw_rpmb_size_mult" is a mutliple of 128kB block.
92 RPMB size in byte is calculated by using the following equation:
93 RPMB partition size = 128kB x raw_rpmb_size_mult
Subhash Jadavanidff31262016-04-19 16:21:16 -070094
95SD/MMC/SDIO Clock Gating Attribute
96==================================
97
98Read and write access is provided to following attribute.
99This attribute appears only if CONFIG_MMC_CLKGATE is enabled.
100
101 clkgate_delay Tune the clock gating delay with desired value in milliseconds.
102
103echo <desired delay> > /sys/class/mmc_host/mmcX/clkgate_delay
Sujit Reddy Thumma00d52ac2012-11-07 21:23:14 +0530104
105SD/MMC/SDIO Clock Scaling Attributes
106====================================
107
108Read and write accesses are provided to following attributes.
109
110 polling_interval Measured in milliseconds, this attribute
111 defines how often we need to check the card
112 usage and make decisions on frequency scaling.
113
114 up_threshold This attribute defines what should be the
115 average card usage between the polling
116 interval for the mmc core to make a decision
117 on whether it should increase the frequency.
118 For example when it is set to '35' it means
119 that between the checking intervals the card
120 needs to be on average more than 35% in use to
121 scale up the frequency. The value should be
122 between 0 - 100 so that it can be compared
123 against load percentage.
124
125 down_threshold Similar to up_threshold, but on lowering the
126 frequency. For example, when it is set to '2'
127 it means that between the checking intervals
128 the card needs to be on average less than 2%
129 in use to scale down the clocks to minimum
130 frequency. The value should be between 0 - 100
131 so that it can be compared against load
132 percentage.
133
134 enable Enable clock scaling for hosts (and cards)
135 that support ultrahigh speed modes
136 (SDR104, DDR50, HS200).
137
138echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/polling_interval
139echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/up_threshold
140echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/down_threshold
141echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/enable