blob: 9884f921a42e729d45e670e553d1a7fc430eb330 [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 Brokhman98e67812012-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 Erez860cef92013-01-16 09:48:25 +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 Gardiab0b6b02012-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 Thumma70a5c032012-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
54
55Note on Erase Size and Preferred Erase Size:
56
57 "erase_size" is the minimum size, in bytes, of an erase
58 operation. For MMC, "erase_size" is the erase group size
59 reported by the card. Note that "erase_size" does not apply
60 to trim or secure trim operations where the minimum size is
61 always one 512 byte sector. For SD, "erase_size" is 512
62 if the card is block-addressed, 0 otherwise.
63
64 SD/MMC cards can erase an arbitrarily large area up to and
65 including the whole card. When erasing a large area it may
66 be desirable to do it in smaller chunks for three reasons:
67 1. A single erase command will make all other I/O on
68 the card wait. This is not a problem if the whole card
69 is being erased, but erasing one partition will make
70 I/O for another partition on the same card wait for the
71 duration of the erase - which could be a several
72 minutes.
73 2. To be able to inform the user of erase progress.
74 3. The erase timeout becomes too large to be very
75 useful. Because the erase timeout contains a margin
76 which is multiplied by the size of the erase area,
77 the value can end up being several minutes for large
78 areas.
79
80 "erase_size" is not the most efficient unit to erase
81 (especially for SD where it is just one sector),
82 hence "preferred_erase_size" provides a good chunk
83 size for erasing large areas.
84
85 For MMC, "preferred_erase_size" is the high-capacity
86 erase size if a card specifies one, otherwise it is
87 based on the capacity of the card.
88
89 For SD, "preferred_erase_size" is the allocation unit
90 size specified by the card.
91
92 "preferred_erase_size" is in bytes.
Sujit Reddy Thumma597dd9d2011-11-14 13:53:29 +053093
94SD/MMC/SDIO Clock Gating Attribute
95==================================
96
97Read and write access is provided to following attribute.
98This attribute appears only if CONFIG_MMC_CLKGATE is enabled.
99
Stephen Boyd4137e502011-12-05 10:28:44 -0800100 clkgate_delay Tune the clock gating delay with desired value in milliseconds.
Sujit Reddy Thumma597dd9d2011-11-14 13:53:29 +0530101
102echo <desired delay> > /sys/class/mmc_host/mmcX/clkgate_delay
Sujit Reddy Thumma70a5c032012-11-07 21:23:14 +0530103
104SD/MMC/SDIO Clock Scaling Attributes
105====================================
106
107Read and write accesses are provided to following attributes.
108
109 polling_interval Measured in milliseconds, this attribute
110 defines how often we need to check the card
111 usage and make decisions on frequency scaling.
112
113 up_threshold This attribute defines what should be the
114 average card usage between the polling
115 interval for the mmc core to make a decision
116 on whether it should increase the frequency.
117 For example when it is set to '35' it means
118 that between the checking intervals the card
119 needs to be on average more than 35% in use to
120 scale up the frequency. The value should be
121 between 0 - 100 so that it can be compared
122 against load percentage.
123
124 down_threshold Similar to up_threshold, but on lowering the
125 frequency. For example, when it is set to '2'
126 it means that between the checking intervals
127 the card needs to be on average less than 2%
128 in use to scale down the clocks to minimum
129 frequency. The value should be between 0 - 100
130 so that it can be compared against load
131 percentage.
132
133 enable Enable clock scaling for hosts (and cards)
134 that support ultrahigh speed modes
135 (SDR104, DDR50, HS200).
136
137echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/polling_interval
138echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/up_threshold
139echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/down_threshold
140echo <desired value> > /sys/class/mmc_host/mmcX/clk_scaling/enable