Writing eMMC firmware boot image from Linux on IMX8MQ-EVK

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Writing eMMC firmware boot image from Linux on IMX8MQ-EVK

跳至解决方案
3,338 次查看
cminyard
Contributor II

I have an iMX8MQuadEVK board.  I can use mkimage to build an image and burn it to eMMC with uuu.  I can boot an ARM systemready SD card without issue.

I haven't found any instructions to write the eMMC firmware image from Linux.

On the target I have /dev/mmcblk0, which I assume is the eMMC.  There are three partitions, boot0, boot1, and rpmb.  I know what rpmb is.  How do I write the image to these devices?  Can you make it switch between boot0 and boot1?

Thanks.

0 项奖励
回复
1 解答
3,313 次查看
cminyard
Contributor II

I was able to figure this out by trial and error.  The boot image that you normally write with uuu can be written on the target from Linux using:

# echo 0 > /sys/block/mmcblk0boot0/force_ro
# dd if=<image> of=/dev/mmcblk0boot0 bs=1024 seek=33 status=progress
# sync
# echo 1 > /sys/block/mmcblk0boot0/force_ro

So the boot loader starts 33K from the beginning of the boot0 partition.

It would be nice to know if you could use the boot1 partition as a backup partition, but that doesn't seem possible.  I suppose you could write a small firmware loader that ran in boot0 that would load from boot0 or boot1.  But that's kind of a pain.

I don't know if this will work on other boards, but I assume they have something similar.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
3,314 次查看
cminyard
Contributor II

I was able to figure this out by trial and error.  The boot image that you normally write with uuu can be written on the target from Linux using:

# echo 0 > /sys/block/mmcblk0boot0/force_ro
# dd if=<image> of=/dev/mmcblk0boot0 bs=1024 seek=33 status=progress
# sync
# echo 1 > /sys/block/mmcblk0boot0/force_ro

So the boot loader starts 33K from the beginning of the boot0 partition.

It would be nice to know if you could use the boot1 partition as a backup partition, but that doesn't seem possible.  I suppose you could write a small firmware loader that ran in boot0 that would load from boot0 or boot1.  But that's kind of a pain.

I don't know if this will work on other boards, but I assume they have something similar.

0 项奖励
回复
3,010 次查看
yixinchi
Contributor I
你好,您知道/dev/mmcblk0和/dev/mmcblk1在emmc的地址吗,我可以uboot命令行下将uboot进行在线更新吗
0 项奖励
回复
2,998 次查看
cminyard
Contributor II

> Hello, do you know the addresses of /dev/mmcblk0 and /dev/mmcblk1 in emmc? Can you update uboot online under the uboot command line?

You can look in the device tree for that information.

You could update it from the uboot command line, but I have not tried it.

0 项奖励
回复