History of partitioning scheme for mass storage devices
In 1983, MBR was publicly introduced with PC DOS 2.0. The organization of the partition table in the MBR limits the maximum addressable storage space of a disk to 2 TB (232 × 512 bytes). The MBR partitioning scheme is therefore in the process of being superseded by the GUID Partition Table (GPT).
GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk, using globally unique identifiers (GUID). Although it forms a part of the Unified Extensible Firmware Interface (UEFI) standard.
In 2005, Intel ceased development of the EFI specification at version 1.10, and contributed it to the Unified EFI Forum, which has evolved the specification as the UEFI. (The UEFI defines a software interface between an operating system and platform firmware. It is meant to replace the BIOS firmware interface)
GUID Partition Table
See specification of GPT in Figure 19 “GUID Partition Table (GPT) example” of UEFI_Spec_2_4_Errata_B (Unified Extensible Firmware Interface Specification)
Partition layout
The default area of the memory device consist of a User Data Area to store data, two possible boot area partitions for booting and the Replay Protected Memory Block Area Partition to manage data in an authenticated and replay protected manner like graph.(Reference: JESD84-B50-1 Figure 14 “eMMC memory organization at time zero” downloaded from www.jedec.org)
User Data Area Partition
For mobile phone with uboot, uboot-spl usually locate in “Boot Area 1”, uboot locates in “Boot Area 2” (Because of size of “Boot Area 2” is commonly too small, customized vendor’s bootloader is put in “User Data Area”)
In “User Data Area”, like destop-PC, we must partition this area with partition table. Here is layout of “User Data Area”.
MBR(1 block), GPT header(1 block)+GPT entries(x blocks), xxx, yyy, zzz, ..... (Sometime secondary GPT is used and located in last of entire partition).
In above EMMC layout, there are two boot areas and many user data areas. The sizes of boot area 1 and boot area 2 are fixed as per mmc chip, which could not be customized by user. User data area could be repartitioned by program. For example, some chip have 4MB-size boot partitaion, boot 0 and boot 1 is same as 4MB.
NOTE: In practice the size of each GPT entity is 128 bytes, the max number of GPT entities is 128, so the max size of GPT entities are 128 * 128 (i.e. 32 blocks); In general bootloader set GPT entities area is always 32 blocks even if less than 128 blocks. That’s to say, the first lively partition on eMMC user data area start from 34 blocks. Notice that eMMC specification does NOT limit 34 blocks, that decide by programmer. It seem some block is not used forever, however is flexible for development, becase start offset of first raw data is fixed located, if repartition.
Terms & Acronyms
Block alias of sector. For mobile device, sector is 512 bytes
LBA Logical Block Address
EFI Extensible Firmware Interface
GPT GUID Partition Table
GUID Globally Unique Identifier
References
1. eMMC standard (JESD84-B50-1) Chapter 6.2 “Partition Management”
2. UEFI_Spec_2_4_Errata_B.pdf
3. http://en.wikipedia.org/wiki/Master_Boot_Record
4. http://en.wikipedia.org/wiki/UEFI
5. http://en.wikipedia.org/wiki/GUID_Partition_Table