blob: 4f44b1b730d638578faa573187a8871114b65492 [file] [log] [blame]
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -03001==================================
Andrei Warkentin371a6892011-04-11 18:10:25 -05002SD and MMC Block Device Attributes
3==================================
4
5These attributes are defined for the block devices associated with the
6SD or MMC device.
7
8The following attributes are read/write.
9
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030010 ======== ===============================================
11 force_ro Enforce read-only access even if write protect switch is off.
12 ======== ===============================================
Andrei Warkentin371a6892011-04-11 18:10:25 -050013
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070014SD and MMC Device Attributes
15============================
16
17All attributes are read-only.
18
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030019 ====================== ===============================================
Tamara Diaconita80352232017-03-17 20:00:34 +020020 cid Card Identification Register
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070021 csd Card Specific Data Register
22 scr SD Card Configuration Register (SD only)
23 date Manufacturing Date (from CID Register)
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030024 fwrev Firmware/Product Revision (from CID Register)
25 (SD and MMCv1 only)
26 hwrev Hardware/Product Revision (from CID Register)
27 (SD and MMCv1 only)
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070028 manfid Manufacturer ID (from CID Register)
29 name Product Name (from CID Register)
30 oemid OEM/Application ID (from CID Register)
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030031 prv Product Revision (from CID Register)
32 (SD and MMCv4 only)
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070033 serial Product Serial Number (from CID Register)
34 erase_size Erase group size
35 preferred_erase_size Preferred erase size
Loic Pallardy188cc042012-08-06 17:12:29 +020036 raw_rpmb_size_mult RPMB partition size
37 rel_sectors Reliable write sector count
Bojan Prtvar5fb06af2016-07-04 13:56:55 +020038 ocr Operation Conditions Register
Bojan Prtvar6825a602016-07-19 11:16:38 +020039 dsr Driver Stage Register
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030040 cmdq_en Command Queue enabled:
41
42 1 => enabled, 0 => not enabled
43 ====================== ===============================================
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070044
45Note on Erase Size and Preferred Erase Size:
46
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
54 SD/MMC cards can erase an arbitrarily large area up to and
55 including the whole card. When erasing a large area it may
56 be desirable to do it in smaller chunks for three reasons:
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030057
58 1. A single erase command will make all other I/O on
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070059 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.
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030064 2. To be able to inform the user of erase progress.
65 3. The erase timeout becomes too large to be very
Adrian Hunterdfe86cb2010-08-11 14:17:46 -070066 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 Thumma597dd9d792011-11-14 13:53:29 +053084
Loic Pallardy188cc042012-08-06 17:12:29 +020085Note on raw_rpmb_size_mult:
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030086
Tamara Diaconita80352232017-03-17 20:00:34 +020087 "raw_rpmb_size_mult" is a multiple of 128kB block.
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030088
Loic Pallardy188cc042012-08-06 17:12:29 +020089 RPMB size in byte is calculated by using the following equation:
Mauro Carvalho Chehabf4085102019-04-18 14:44:06 -030090
91 RPMB partition size = 128kB x raw_rpmb_size_mult