Вы находитесь на странице: 1из 14

TN-52-07: eMMC Partitioning

Introduction

Technical Note
eMMC Partitioning
Introduction
Partitioning enables the host system to configure some regions of an embedded memory device (eMMC) as optimized for endurance, reliability, and performance. Special
attention is required by the host to configure different partitions to better fulfill these
different usage models. For example, mass-storage applications typically do not have
strict constraints in terms of endurance; however, they do have requirements for data
retention and higher write bandwidth in order to store code and software applications.
This technical note is a guide for partitioning an eMMC device according to the 4.41
version of the JEDEC specification. The following sections discuss how to set a physical
partition configuration, how to set a general or enhanced partition, and how to access a
partition. Finally, the registers used in partitioning are explained in detail.

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

Products and specifications discussed herein are subject to change by Micron without notice.

TN-52-07: eMMC Partitioning


Physical Partition Configuration

Physical Partition Configuration


Before any partitioning operationat time zerothe memory configuration consists
of:
User data area (to store data)
Boot area partitions (to boot the device)
Replay-protected memory-block partition (RPMB) (to manage data in an authenticated and replay-protected manner)
The following figure shows how the memory logical addressable space is configured at
time zero in the eMMC device.
Figure 1: eMMC Memory Organization at Time Zero

Boot area
partition 1

RPMB
partition 1

Boot partitions

RPMB
partition 1

User data area

RPMB partitions

The host can customize memory organization by splitting the user data area into different partitions, each with independent addressable space starting from logical address
0x00000000. It is possible to create up to four general-purpose area partitions to store
sensitive data or for other host usage models.
Part of the user data area and each general-purpose area partition can be configured as
enhanced with technological features that distinguish them from the default storage
media. If the device supports the enhanced features, boot and RPMB area partitions are
enhanced by default. The following figure shows an example of partition configuration.

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Physical Partition Configuration
Figure 2: Example of Partition Configuration

Boot area 1

Boot area 1

Boot area 2

RPMB area

User data area

Boot area 2

RPMB area
General
partition 1

General
partition 2

General
partition 3

General
partition 4

After system
integration
configuration

User data area

Enhanced user data area

Default storage media


Enhanced storage media

MLC NAND Flash


SLC NAND Flash

A partition that is configured as enhanced ensures higher performance and reliability


than the default partition. Enhanced partitions are shaped as SLC NAND portions,
while default partitions are shaped as MLC NAND portions. Both boot and RPMB area
partition sizes and attributes are read-only and defined by the memory manufacturer.
Enhanced user data area and general-purpose area partition sizes and attributes can be
programmed by the host only once in the device's lifecycle. The host can specify the
starting location of the enhanced segment in the user data area.
Note:
Once a partition has been enhanced, the enhancement cannot be reversed.
The granularity of boot, RPMB, general-purpose partition, and enhanced user data area
size is quantified in units of high-capacity write-protect group (WPG) size, that is, the
minimal unit that may be individually write-protected. The size of a WPG is stored in
the card-specific data (CSD) register when ERASE_GROUP_DEF (see the Erase Group

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Physical Partition Configuration
Size Definition section) is disabled and in the extended CSD (EXT_CSD) register when it
is enabled.
Previously stored data is destroyed by configuration of general-purpose partitions and
enhanced data areas. Moreover, these configurations can also affect device initialization
time.

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Configuring General-Purpose Partitions and Enhanced User
Data Areas

Configuring General-Purpose Partitions and Enhanced User Data Areas


The following flowchart describes the procedure for configuring the parameters of general-purpose partitions and enhanced user data areas.
Figure 3: Configuration Process Flow

Transfer state

No

Check
partitioning
EN=1

Partitioning feature not supported/


device not configurable

Yes

No

Does the host want to set


ENH attribute to partions?

Yes
Check
ENH
attribute =1

No

Yes
CMD6 to set:
Number and size of general purpose partitions
ENH attribute on general purpose
Enhanced user area data

CMD6 to set:
Number and size of
general purpose partitions

CMD6 to set:
PARTITIONING_SETTING_COMPLETED
(to notify the device that the host has
completed partitioning configuration)

Power-cycle

Possible changes in size


parameters for user data area

Partitions correctly configured

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Configuring General-Purpose Partitions and Enhanced User
Data Areas
First, the host must check the supported partitioning feature to see whether the enhanced attribute is available by scanning the PARTITIONING_SUPPORT register (see
the Partitioning Support section), located in the EXT_CSD register. Then the host issues
a SWITCH command (CMD6) to completely set the general-purpose partitions and enhanced user data area, defining several EXT_CSD registers. In particular, the host may
issue a SWITCH command to set the R/W field of partition features, containing the following parameters:
General-Purpose Partition The size and attributes of a maximum of four partitions.
The field in the modes segment of the EXT_CSD register to be set are:
GP_SIZE_MULT_GP0 - GP_SIZE_MULT_GP0 [154:143] (See the Partitions Attribute section.)
PARTITIONS_ATTRIBUTE [156]: Defines which areas will be seen as enhanced or
as default. (See the Enhanced User Data Area Size section.)
Enhanced User Data Area The start address and attribute of the region. The field in
the modes segment of the EXT_CSD register to be set are:
ENH_START_ADDR [139-136]: Defines the starting address of the enhanced user
data area. (See the Starting Address of Enhanced User Data Area section.)
ENH_SIZE_MULT [142:140]: Defines the enhanced user data area size. (See the
Max Enhanced Area Size section.)
PARTITIONS_ATTRIBUTE
If the partition parameters are sent to a device by CMD6 before setting the
ERASE_GROUP_DEF bit, the slave shows SWITCH_ERROR.
Next, the host sends CMD6, setting bit 0 in PARTITIONING_SETTING_COMPLETED to
notify the device that partitioning configuration has successfully completed. If the total
size of the configured partitions and user data area fits the available space of the device,
no error occurs. Otherwise, the device may show SWITCH_ERROR. By setting this bit,
the host protects the partitioning sequence against an unexpected power-loss event. In
fact, if a sudden power loss occurs when the partitioning process has been only partially
executed, at the next power-up the device can detect and invalidate (if this bit is not set)
the previous incomplete partitioning process. Then the host can repeat and correctly
complete it.
The host can issue CMD13 (SEND_STATUS) to make sure that all the parameters are
correctly set; if they are not, the device raises a SWITCH_ERROR.
As shown in the Configuration Process Flow figure, the device actually configures itself,
according to partition parameters in the EXT_CSD, only after a power-cycle. Any valid
commands issued after the PARTITIONING_SETTING_COMPLETED bit is set, but before a power-cycle takes place, execute normally.
The initialization delay for the first power-on, after partitioning, is calculated from
INI_TIMEOUT_PA (the EXT_CSD register, byte 241), instead of one second. This timeout applies only for the first initialization after successful partitioning. For all subsequent initializations, a one-second timeout applies.
If the host tries to change general-purpose partitions and enhanced user data area features set by CMD6 after the power-up following the partition configuration procedure,
the device sets the SWITCH_ERROR bit in the status register without performing any internal action.

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Accessing a Partition
Note that the host can read partition configuration parameters in EXT_CSD registers by
issuing a SEND_EXT_CSD command (CMD8) even though the PARTITIONING_SETTING_COMPLETED bit has not yet been set.

Accessing a Partition
The following steps must be executed each time the host wants to access a partition:
1. Because the ERASE_GROUP_DEF bit is reset after power-up, the host must set it to
HIGH before issuing READ, WRITE, ERASE, and WRITE PROTECT commands.
2. To address one of the partitions, issue CMD6 to set the PARTITION_ACCESS bits in
the PARTITION_CONFIG field (see the Partitions Configuration section) of the
EXT_CSD register; all commands issued by the host are then referred to the selected partition.
3. Restore the PARTITION_ACCESS bits to redirect the commands to another partition or to the user data area.
Note:
If an unexpected power loss occurs, or after all reset events, access will be restored to
the user data area by default.
Note:
If the host tries to access a partition that has not yet been created, the device sets the
SWITCH_ERROR bit in the status register, and the PARTITION_ACCESS bits do not
change.

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Register Details

Register Details
Erase Group Size Definition Register [175]
This register allows the master to select high-capacity erase unit size and write-protect
group size.
Table 1: ERASE_GROUP_DEF
Bit
7

Reserved

0
Enable

1. Bit[7:1]: Reserved
2. Bit0: Enable
0x0: Use the default erase group size and WPG size definition.
0x1: Use the high-capacity erase group size (see High Capacity Erase Group Size
Register [224] section) and high-capacity WPG size (see High Capacity Write Protect
Group Size Register [221] section) definitions.
3. Bit is set to 0 on power-on by default.

Notes:

High Capacity Erase Group Size Register [224]


This register defines the unit of erase size for high-capacity memory.
Erase unit size = 512Kb x HC_ERASE_GRP_SIZE.
Table 2: HC_ERASE_GRP_SIZE
Hex Values

Parameter

0x00

No support for high-capacity erase unit size

0x01

512Kb x 1 = 524,288 bytes

0x02
:
0xFF

512Kb x 2 = 1.048,576 bytes


:
512Kb x 255 = 133.693,440 bytes

If the master set bit 0 to enable in ERASE_GROUP_DEF [175], the slave uses this value
for the ERASE operation. But if the enable is cleared to LOW, or HC_WP_GRP_SIZE is set
to 0x00, the WPG sizes to the default.

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Register Details
High Capacity Write Protect Group Size Register [221]
This register defines the WPG size for high-capacity memory.
If the enable bit in ERASE_GROUP_DEF [175] is set to HIGH, the WPG size is defined as
WPG size = 512Kb x HC_ERASE_GRP_SIZE x HC_WP_GRP_SIZE.
Table 3: HC_WP_GRP_SIZE
Hex Values

Parameter

0x00

No support for high-capacity WPG size

0x01

1 high-capacity erase unit size

0x02

2 high-capacity erase unit size

0xFF

255 high-capacity erase unit size

Partitioning Support Register [160]


This register defines the supported partition features.
Table 4: PARTITIONING_SUPPORT
Bit
7

Reserved
Notes:

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

ENH_ATTRIBUTE_EN

PARTITIONING_EN

1. Bit[0]: PARTITIONING_EN
0x0: Device does not support partitioning features.
0x1: Device supports partitioning features.
2. Bit[1]: ENH_ATTRIBUTE_EN
0x0: Device cannot have enhanced technological features in general-purpose partitions and in the user data area.
0x1: Device can have enhanced technological features in general-purpose partitions and in the user data area.

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Register Details
General Purpose Partitions Size Register [154:153]
This register defines general-purpose partition sizes and is expressed in terms of a highcapacity WPG.
Table 5: GP_SIZE_MULT_GP0 - GP_SIZE_MULT_GP3
Bit
7

GP_SIZE_MULT_X_2
GP_SIZE_MULT_X_1
GP_SIZE_MULT_X_0
Notes:

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

1. General_Purpose_Partition_X = (GP_SIZE_MULT_X_2x216+ GP_SIZE_MULT_X_1x28+


GP_SIZE_MULT_X_0x20) x HC_WP_GRP_SIZE x HC_ERASE_GRP_SIZE x 512Kb
2. GPP1:
GP_SIZE_MULT_1_0 = EXT_CSD [143]
GP_SIZE_MULT_1_1 = EXT_CSD [144]
GP_SIZE_MULT_1_2 = EXT_CSD [145]
3. GPP2:
GP_SIZE_MULT_2_0 = EXT_CSD [146]
GP_SIZE_MULT_2_1 = EXT_CSD [147]
GP_SIZE_MULT_2_2 = EXT_CSD [148]
4. GPP3:
GP_SIZE_MULT_3_0 = EXT_CSD [149]
GP_SIZE_MULT_3_1 = EXT_CSD [150]
GP_SIZE_MULT_3_2 = EXT_CSD [151]
5. GPP4:
GP_SIZE_MULT_4_0 = EXT_CSD [152]
GP_SIZE_MULT_4_1 = EXT_CSD [153]
GP_SIZE_MULT_4_2 = EXT_CSD [154]

10

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Register Details
Partitions Attribute Register [156]
This register sets enhanced attributes in general-purpose partitions.
Table 6: PARTITIONS_ATTRIBUTE
Bit
7

Reserved

ENH_4

ENH_3

ENH_2

ENH_1

ENH_USR

1. Bit[7:5]: Reserved
2. Bit[4]: ENH_4
0x0: Default
0x1: Sets enhanced attribute in general-purpose partition 4.
3. Bit[3]: ENH_3
0x0: Default
0x1: Sets enhanced attribute in general-purpose partition 3.
4. Bit[2]: ENH_2
0x0: Default
0x1: Sets enhanced attribute in general-purpose partition 2.
5. Bit[1]: ENH_1
0x0: Default
0x1: Sets enhanced attribute in general-purpose partition 1.
6. Bit[0]: ENH_USR
0x0: Default
0x1: Sets enhanced attribute in user data areas.

Notes:

Enhanced User Data Area Size Register [142:140]


This register defines the enhanced user data area size and is expressed in terms of a
high-capacity WPG.
Table 7: ENH_SIZE_MULT
Bit
7

ENH_SIZE_MULT_2
ENH_SIZE_MULT_1
ENH_SIZE_MULT_0

Enhanced User Data Area Size = (ENH_SIZE_MULT_2 x 216 + ENH_SIZE_MULT_1 x 28 +


ENH_SIZE_MULT_0 x 20) x HC_WP_GRP_SIZE x HC_ERASE_GRP_SIZE x 512KB

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

11

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Register Details
Max Enhanced Area Size Register [159:157]
This register defines the maximum amount of memory area that can have the enhanced
attribute.
Table 8: MAX_ENH_SIZE_MULT
Bit
7

MAX_ENH_SIZE_MULT_2
MAX_ENH_SIZE_MULT_1
MAX_ENH_SIZE_MULT_0

The maximum enhanced area must be estimated according to Max Enhanced Area =
MAX_ENH_SIZE_MULT x HC_WP_GRP_SIZE x HC_ERASE_GRP_SIZE x 512Kb.
In the case of low-capacity cards (2GB and below), the EXT_CSD register is set as
HC_WP_GRP_SIZE = 0, HC_ERASE_GRP_SIZE = 0. In this case, an alternative formula
has to be used:
Max Enhanced Area = (MAX_ENH_SIZE_MULT_2 x 2^16 + MAX_ENH_SIZE_MULT_1 x
2^8 + MAX_ENH_SIZE_MULT_0 x 2^0) x (WP_GRP_SIZE+1) x (ERASE_GRP_SIZE+1) x
(ERASE_GRP_MULT+1) x 512 bytes.
The MAX_ENH_SIZE_MULT value is available in EXT_CSD (bytes [159:157)),
WP_GRP_SIZE in CSD (bytes [36:32]), ERASE_GRP_SIZE in CSD (bytes [46:42]), and
ERASE_GRP_MULTI in CSD (bytes [41:37]).
This is valid both for enhanced and general-purpose partitions.

Starting Address of Enhanced User Data Area Register [139:136]


This register defines the starting address of the enhanced user data area and is expressed in bytes or in sectors (in the case of high-capacity devices).
Table 9: ENH_START_ADDR
Bit
7

ENH_START_ADDR_3
ENH_START_ADDR_2
ENH_START_ADDR_1
ENH_START_ADDR_0

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

12

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Register Details
Partitions Configuration Register [179]
This register defines the partition configurations and the access to boot-area partitions.
Table 10: PARTITION_CONFIG
Bit
7

Reserved

BOOT_ACK

BOOT_PARTITION_ENABLE

PARTITION_ACCESS

R/W/E

R/W/E

R/W/E

Notes:

1. Bit[7]: Reserved
2. Bit[6]: BOOT_ACK
0x0: No boot acknowledge is sent (default).
0x1: Boot acknowledge is sent during the boot operation.
3. Bit[5:3]: BOOT_PARTITION_ENABLE
The user selects the boot data that will be sent to the master.
0x0: Device is not boot-enabled (default).
0x1: Boot partition 1 is enabled for boot.
0x2: Boot partition 2 is enabled for boot.
0x3 to 0x6: Reserved
0x7: User area is enabled for boot.
4. Bit[2:0]: PARTITION_ACCESS (before BOOT_PARTITION_ACCESS)
The user selects the partition to access.
0x0: Access to user data area
0x1: R/W boot partition 1
0x2: R/W boot partition 2
0x3: R/W replay-protected memory block (RPMB)
0x4: Access to general-purpose partition 1
0x5: Access to general-purpose partition 2
0x6: Access to general-purpose partition 3
0x7: Access to general-purpose partition 4

PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

13

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

TN-52-07: eMMC Partitioning


Revision History

Revision History
Rev. A 5/12
Initial release.

8000 S. Federal Way, P.O. Box 6, Boise, ID 83707-0006, Tel: 208-368-3900


www.micron.com/productsupport Customer Comment Line: 800-932-4992
Micron and the Micron logo are trademarks of Micron Technology, Inc.
All other trademarks are the property of their respective owners.
This data sheet contains minimum and maximum limits specified over the power supply and temperature range set forth herein.
Although considered final, these specifications are subject to change, as further product development and data characterization sometimes occur.
PDF: 09005aef84c0eb5e
tn5207_emmc_partitioning.pdf - Rev. A 5/12 EN

14

Micron Technology, Inc. reserves the right to change products or specifications without notice.
2012 Micron Technology, Inc. All rights reserved.

Вам также может понравиться