emmc启动分区设置

下图是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

  • 8
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kaira88

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值