| Andrei Warkentin | 371a689 | 2011-04-11 18:10:25 -0500 | [diff] [blame] | 1 | SD and MMC Block Device Attributes | 
|  | 2 | ================================== | 
|  | 3 |  | 
|  | 4 | These attributes are defined for the block devices associated with the | 
|  | 5 | SD or MMC device. | 
|  | 6 |  | 
|  | 7 | The following attributes are read/write. | 
|  | 8 |  | 
|  | 9 | force_ro		Enforce read-only access even if write protect switch is off. | 
|  | 10 |  | 
| Adrian Hunter | dfe86cb | 2010-08-11 14:17:46 -0700 | [diff] [blame] | 11 | SD and MMC Device Attributes | 
|  | 12 | ============================ | 
|  | 13 |  | 
|  | 14 | All attributes are read-only. | 
|  | 15 |  | 
|  | 16 | cid			Card Identifaction Register | 
|  | 17 | csd			Card Specific Data Register | 
|  | 18 | scr			SD Card Configuration Register (SD only) | 
|  | 19 | date			Manufacturing Date (from CID Register) | 
|  | 20 | fwrev			Firmware/Product Revision (from CID Register) (SD and MMCv1 only) | 
|  | 21 | hwrev			Hardware/Product Revision (from CID Register) (SD and MMCv1 only) | 
|  | 22 | manfid			Manufacturer ID (from CID Register) | 
|  | 23 | name			Product Name (from CID Register) | 
|  | 24 | oemid			OEM/Application ID (from CID Register) | 
|  | 25 | serial			Product Serial Number (from CID Register) | 
|  | 26 | erase_size		Erase group size | 
|  | 27 | preferred_erase_size	Preferred erase size | 
| Loic Pallardy | 188cc04 | 2012-08-06 17:12:29 +0200 | [diff] [blame] | 28 | raw_rpmb_size_mult	RPMB partition size | 
|  | 29 | rel_sectors		Reliable write sector count | 
| Adrian Hunter | dfe86cb | 2010-08-11 14:17:46 -0700 | [diff] [blame] | 30 |  | 
|  | 31 | Note on Erase Size and Preferred Erase Size: | 
|  | 32 |  | 
|  | 33 | "erase_size" is the  minimum size, in bytes, of an erase | 
|  | 34 | operation.  For MMC, "erase_size" is the erase group size | 
|  | 35 | reported by the card.  Note that "erase_size" does not apply | 
|  | 36 | to trim or secure trim operations where the minimum size is | 
|  | 37 | always one 512 byte sector.  For SD, "erase_size" is 512 | 
|  | 38 | if the card is block-addressed, 0 otherwise. | 
|  | 39 |  | 
|  | 40 | SD/MMC cards can erase an arbitrarily large area up to and | 
|  | 41 | including the whole card.  When erasing a large area it may | 
|  | 42 | be desirable to do it in smaller chunks for three reasons: | 
|  | 43 | 1. A single erase command will make all other I/O on | 
|  | 44 | the card wait.  This is not a problem if the whole card | 
|  | 45 | is being erased, but erasing one partition will make | 
|  | 46 | I/O for another partition on the same card wait for the | 
|  | 47 | duration of the erase - which could be a several | 
|  | 48 | minutes. | 
|  | 49 | 2. To be able to inform the user of erase progress. | 
|  | 50 | 3. The erase timeout becomes too large to be very | 
|  | 51 | useful.  Because the erase timeout contains a margin | 
|  | 52 | which is multiplied by the size of the erase area, | 
|  | 53 | the value can end up being several minutes for large | 
|  | 54 | areas. | 
|  | 55 |  | 
|  | 56 | "erase_size" is not the most efficient unit to erase | 
|  | 57 | (especially for SD where it is just one sector), | 
|  | 58 | hence "preferred_erase_size" provides a good chunk | 
|  | 59 | size for erasing large areas. | 
|  | 60 |  | 
|  | 61 | For MMC, "preferred_erase_size" is the high-capacity | 
|  | 62 | erase size if a card specifies one, otherwise it is | 
|  | 63 | based on the capacity of the card. | 
|  | 64 |  | 
|  | 65 | For SD, "preferred_erase_size" is the allocation unit | 
|  | 66 | size specified by the card. | 
|  | 67 |  | 
|  | 68 | "preferred_erase_size" is in bytes. | 
| Sujit Reddy Thumma | 597dd9d79 | 2011-11-14 13:53:29 +0530 | [diff] [blame] | 69 |  | 
| Loic Pallardy | 188cc04 | 2012-08-06 17:12:29 +0200 | [diff] [blame] | 70 | Note on raw_rpmb_size_mult: | 
|  | 71 | "raw_rpmb_size_mult" is a mutliple of 128kB block. | 
|  | 72 | RPMB size in byte is calculated by using the following equation: | 
|  | 73 | RPMB partition size = 128kB x raw_rpmb_size_mult | 
|  | 74 |  | 
| Sujit Reddy Thumma | 597dd9d79 | 2011-11-14 13:53:29 +0530 | [diff] [blame] | 75 | SD/MMC/SDIO Clock Gating Attribute | 
|  | 76 | ================================== | 
|  | 77 |  | 
|  | 78 | Read and write access is provided to following attribute. | 
|  | 79 | This attribute appears only if CONFIG_MMC_CLKGATE is enabled. | 
|  | 80 |  | 
| Stephen Boyd | 4137e50 | 2011-12-05 10:28:44 -0800 | [diff] [blame] | 81 | clkgate_delay	Tune the clock gating delay with desired value in milliseconds. | 
| Sujit Reddy Thumma | 597dd9d79 | 2011-11-14 13:53:29 +0530 | [diff] [blame] | 82 |  | 
|  | 83 | echo <desired delay> > /sys/class/mmc_host/mmcX/clkgate_delay |