^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ==================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) SD and MMC Block Device Attributes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ==================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) These attributes are defined for the block devices associated with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) SD or MMC device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) The following attributes are read/write.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) ======== ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) force_ro Enforce read-only access even if write protect switch is off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) ======== ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) SD and MMC Device Attributes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) All attributes are read-only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) ====================== ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) cid Card Identification Register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) csd Card Specific Data Register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) scr SD Card Configuration Register (SD only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) date Manufacturing Date (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) fwrev Firmware/Product Revision (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) (SD and MMCv1 only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) hwrev Hardware/Product Revision (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) (SD and MMCv1 only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) manfid Manufacturer ID (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) name Product Name (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) oemid OEM/Application ID (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) prv Product Revision (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) (SD and MMCv4 only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) serial Product Serial Number (from CID Register)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) erase_size Erase group size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) preferred_erase_size Preferred erase size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) raw_rpmb_size_mult RPMB partition size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) rel_sectors Reliable write sector count
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) ocr Operation Conditions Register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) dsr Driver Stage Register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) cmdq_en Command Queue enabled:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 1 => enabled, 0 => not enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ====================== ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) Note on Erase Size and Preferred Erase Size:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) "erase_size" is the minimum size, in bytes, of an erase
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) operation. For MMC, "erase_size" is the erase group size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) reported by the card. Note that "erase_size" does not apply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) to trim or secure trim operations where the minimum size is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) always one 512 byte sector. For SD, "erase_size" is 512
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) if the card is block-addressed, 0 otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) SD/MMC cards can erase an arbitrarily large area up to and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) including the whole card. When erasing a large area it may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) be desirable to do it in smaller chunks for three reasons:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 1. A single erase command will make all other I/O on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) the card wait. This is not a problem if the whole card
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) is being erased, but erasing one partition will make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) I/O for another partition on the same card wait for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) duration of the erase - which could be a several
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) minutes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 2. To be able to inform the user of erase progress.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 3. The erase timeout becomes too large to be very
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) useful. Because the erase timeout contains a margin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) which is multiplied by the size of the erase area,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) the value can end up being several minutes for large
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) areas.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) "erase_size" is not the most efficient unit to erase
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) (especially for SD where it is just one sector),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) hence "preferred_erase_size" provides a good chunk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) size for erasing large areas.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) For MMC, "preferred_erase_size" is the high-capacity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) erase size if a card specifies one, otherwise it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) based on the capacity of the card.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) For SD, "preferred_erase_size" is the allocation unit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) size specified by the card.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) "preferred_erase_size" is in bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) Note on raw_rpmb_size_mult:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) "raw_rpmb_size_mult" is a multiple of 128kB block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) RPMB size in byte is calculated by using the following equation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) RPMB partition size = 128kB x raw_rpmb_size_mult