emmc启动分区设置

下图是emmc寄存器设置。
不使能引导,将BOOT_PARTITION_ENABLE设置为0,
使能boot1,将BOOT_PARTITION_ENABLE设置为1,
使能boot2,将BOOT_PARTITION_ENABLE设置为2,
使能UDA,将BOOT_PARTITION_ENABLE设置为7.
emmc启动分区设置_第1张图片
emmc启动分区设置_第2张图片
eg:
U-Boot provides access to eMMC devices through the mmc command and interface but adds an additional argument to the mmc interface to describe the hardware partition. The interface is therefore described as 'mmc ’ where ‘dev’ is the mmc device (some boards have more than one) and ‘part’ is the hardware partition: 0=user, 1=boot0, 2=boot1.

Use the mmc dev command to specify the device and partition:

mmc dev 0 0 # select user hw partition
mmc dev 0 1 # select boot0 hw partition
mmc dev 0 2 # select boot1 hw partition
If U-Boot has been built with CONFIG_SUPPORT_EMMC_BOOT some additional mmc commands are available:

mmc bootbus
mmc bootpart-resize
mmc partconf # set PARTITION_CONFIG field
mmc rst-function # change RST_n_FUNCTION field between 0|1|2 (write-once)
The mmc partconf command can be used to configure the PARTITION_CONFIG specifying what hardware partition to boot from:

mmc partconf 0 0 0 0 # disable boot partition (default unset condition; boots from user partition)
mmc partconf 0 1 1 0 # set boot0 partition (with ack)
mmc partconf 0 1 2 0 # set boot1 partition (with ack)
mmc partconf 0 1 7 0 # set user partition (with ack)
If U-Boot has been built with CONFIG_SUPPORT_EMMC_RPMB the mmc rpmb command is available for reading, writing and programming the key for the Replay Protection Memory Block (RPMB) partition in eMMC.

When using U-Boot to write to eMMC (or microSD) it is often useful to use the gzwrite command. For example if you have a compressed ‘disk image’ you can write it to your eMMC (assuming it is mmc dev 0) with:

tftpboot ${loadaddr} disk-image.gz && gzwrite mmc 0 ${loadaddr} ${filesize}
The disk-image.gz contains a partition table at offset 0x0 as well as partitions at their respective offsets (according to the partition table) and has been compressed with gzip
If you know the flash offset of a specific partition (which you can determine using the part list mmc 0 command) you can also use gzwrite to flash a compressed partition image

你可能感兴趣的:(问题杂谈,eMMC)