Changes between Version 6 and Version 7 of MMC


Ignore:
Timestamp:
05/16/2018 01:00:34 PM (5 months ago)
Author:
Tim Harvey
Comment:

added minimum sizes for emmc hardware partitions for eMMC used on Gateworks products

Legend:

Unmodified
Added
Removed
Modified
  • MMC

    v6 v7  
    4747
    4848Both Linux (see [#emmc-linux below]) and U-Boot (see [#emmc-uboot below]) support accessing the various partitions but in different ways.
     49
     50
     51[=#emmc-partition-sizes]
     52=== eMMC Partition Size Variations
     53eMMC parts are described as having a single size (ie 4GB, 8GB, 16GB, 32GB, 64GB) but like other block storage devices (rotational hard disks, SSD's, microSD, SD, USB Mass Storage) all vendors parts are not equivalent in the number of 512 Byte blocks (aka sectors) and thus vary in actual size.
     54
     55Gateworks boards with eMMC FLASH may have a variety of eMMC parts that differ slightly in block size of the boot0/boot1, rpmb, and user partitions. The minimum hardware partition sizes you should count on for Gateworks products are:
     56||= eMMC =||= BOOT0/BOOT1 =||= RPMB =||= User Sectors =||= User Size =||
     57|| 8GB  || 4MB || 128KB || 14876672  || 7264MB  ||
     58|| 16GB || 4MB || 128KB || 28835840  || 14080MB ||
     59|| 32GB || 4MB || 128KB || 57671680  || 28160MB ||
     60|| 64GB || 4MB || 128KB || 119537664 || 56448MB ||
     61
     62Note in some cases manufacturers may allow you to adjust the Boot and RPMB partition size with a one-time vendor command.
     63
     64eMMC information available via Linux Userspace:
     65* number of blocks in the various partitions reported by {{{/sys/class/block/mmcblk*/size}}}:
     66{{{#!bash
     67# size of user partition
     68printf "%dMiB\n" $((512*$(cat /sys/class/block/mmcblk0/size)/1024/1024))
     69# size of boot0 partition
     70printf "%dMiB\n" $((512*$(cat /sys/class/block/mmcblk0boot0/size)/1024/1024))
     71# size of boot1 partition (will always be the same as boot0)
     72printf "%dMiB\n" $((512*$(cat /sys/class/block/mmcblk0boot1/size)/1024/1024))
     73# size of rpmb partition
     74printf "%dMiB\n" $((512*$(cat /sys/class/block/mmcblk0rpmb/size)/1024/1024))
     75}}}
     76* Device name reported by {{{/sys/class/block/mmcblk*/device/name}}}
     77* eMMC has CID/OCR/CSD/ECSD registers:
     78 - CID: 128bits: Card IDentification; found in {/sys/block,/sys/class/block}/mmcblk0/device/name
     79 - OCR: 32bits: Operation Condition Register; found i n {/sys/block,/sys/class/block}/mmcblk0/device/ocr
     80 - CSD: 128bits: Card Specific Data; found in {/sys/block,/sys/class/block}/mmcblk0/device/csd
     81 - ECSD: 512Bytes: Extended Card Specific Data; found in {/sys/class/mmc_host/<hostdev>/csd
     82* kernel reports the sizes on detection. For example for a 8GB Micron MTFC8GAKAJCN-4M
     83{{{
     84mmcblk0: mmc0:0001 Q2J55L 7.09 GiB
     85mmcblk0boot0: mmc0:0001 Q2J55L partition 1 16.0 MiB
     86mmcblk0boot1: mmc0:0001 Q2J55L partition 2 16.0 MiB
     87mmcblk0rpmb: mmc0:0001 Q2J55L partition 3 4.00 MiB
     88}}}
     89
     90Datasheets show the following:
     91* Sector Count; SEC_COUNT - number of 512Byte blocks or sectors
     92* Boot partition size: BOOT_SIZE_MULT - mult by 128Kb for size of boot0/boot1
     93* RPMB size; RPMB_SIZE_MULT - mult by 128Kb for size of rpmb
     94
     95See also:
     96- http://tjworld.net/wiki/Android/HTC/EMMC/UnderstandingUserCapacity- https://gist.github.com/kylemanna/5692543
     97- https://translate.google.com/translate?hl=en&sl=zh-CN&u=https://linux.codingbelief.com/zh/storage/flash_memory/emmc/emmc_partitions.html&prev=search
     98- total 'user' capacity is the sum of the size of the enhanced user data area and the remaining user data area
     99- eMMC can be programmed once with enhanced capabilities which is done when the device is partitioned by the manufacturer. This programming includes number of boot partitions, size of replay protected memory block (RPMB), up to four general purpose partitions (which can be 0 len) and a user data area. Some manufacturers will provide the opportunity to re-configure.
    49100
    50101