blob: 08f7312a3fbdcab5eba7403c5410ad52d74fa1b8 [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
Maya Erez63c61d62012-05-31 21:00:18 +030011 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
33 cid Card Identifaction Register
34 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)
42 serial Product Serial Number (from CID Register)
43 erase_size Erase group size
44 preferred_erase_size Preferred erase size
45
46Note on Erase Size and Preferred Erase Size:
47
48 "erase_size" is the minimum size, in bytes, of an erase
49 operation. For MMC, "erase_size" is the erase group size
50 reported by the card. Note that "erase_size" does not apply
51 to trim or secure trim operations where the minimum size is
52 always one 512 byte sector. For SD, "erase_size" is 512
53 if the card is block-addressed, 0 otherwise.
54
55 SD/MMC cards can erase an arbitrarily large area up to and
56 including the whole card. When erasing a large area it may
57 be desirable to do it in smaller chunks for three reasons:
58 1. A single erase command will make all other I/O on
59 the card wait. This is not a problem if the whole card
60 is being erased, but erasing one partition will make
61 I/O for another partition on the same card wait for the
62 duration of the erase - which could be a several
63 minutes.
64 2. To be able to inform the user of erase progress.
65 3. The erase timeout becomes too large to be very
66 useful. Because the erase timeout contains a margin
67 which is multiplied by the size of the erase area,
68 the value can end up being several minutes for large
69 areas.
70
71 "erase_size" is not the most efficient unit to erase
72 (especially for SD where it is just one sector),
73 hence "preferred_erase_size" provides a good chunk
74 size for erasing large areas.
75
76 For MMC, "preferred_erase_size" is the high-capacity
77 erase size if a card specifies one, otherwise it is
78 based on the capacity of the card.
79
80 For SD, "preferred_erase_size" is the allocation unit
81 size specified by the card.
82
83 "preferred_erase_size" is in bytes.
Sujit Reddy Thumma597dd9d2011-11-14 13:53:29 +053084
85SD/MMC/SDIO Clock Gating Attribute
86==================================
87
88Read and write access is provided to following attribute.
89This attribute appears only if CONFIG_MMC_CLKGATE is enabled.
90
Stephen Boyd4137e502011-12-05 10:28:44 -080091 clkgate_delay Tune the clock gating delay with desired value in milliseconds.
Sujit Reddy Thumma597dd9d2011-11-14 13:53:29 +053092
93echo <desired delay> > /sys/class/mmc_host/mmcX/clkgate_delay