emmc启动分区设置

  • Post author:
  • Post category:其他


下图是emmc寄存器设置。

不使能引导,将BOOT_PARTITION_ENABLE设置为0,

使能boot1,将BOOT_PARTITION_ENABLE设置为1,

使能boot2,将BOOT_PARTITION_ENABLE设置为2,

使能UDA,将BOOT_PARTITION_ENABLE设置为7.

在这里插入图片描述

在这里插入图片描述

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 <boot_bus_width> <reset_boot_bus_width> <boot_mode>

mmc bootpart-resize

mmc partconf <boot_ack> # 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



版权声明:本文为shalan88原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。