Changes between Version 6 and Version 7 of MMC

05/16/2018 08:00:34 PM (6 years ago)
Tim Harvey

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


  • MMC

    v6 v7  
    4848Both Linux (see [#emmc-linux below]) and U-Boot (see [#emmc-uboot below]) support accessing the various partitions but in different ways.
     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.
     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 ||
     62Note in some cases manufacturers may allow you to adjust the Boot and RPMB partition size with a one-time vendor command.
     64eMMC information available via Linux Userspace:
     65* number of blocks in the various partitions reported by {{{/sys/class/block/mmcblk*/size}}}:
     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))
     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
     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
     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
     95See also:
     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.