We use boot0 bootmode to boot the spl system on emmc via the uEnv.txt's uenvcmd command to boot switch between the 5th partition and the 6th partition.
The uenvcmd is "uenvcmd=set bootpart 0:5; set mmcdev 0;" and "uenvcmd=set bootpart 0:6; set mmcdev 0;".
The default emmc's mmcdev is also set to 0.
First, we do the partition follow the mksdboot.sh to emmc, our partition part is:
dd if=/dev/zero of=$device bs=1024 count=1024 sync cat << END | fdisk $device n p 1 +128M n p 2 +128M n e 3 n +2G n +2G n +512M n +512M n +256M n +256M n +1G n +64M n +64M n +16M n t 1 c t 2 c a 1 a 2 w END ... # make partitions. echo "Formatting ${device} ..." if [ -b ${PARTITION1} ]; then mkfs.vfat -F 32 -n "BOOT" ${PARTITION1} else echo "Cant find boot partition in /dev" fi if [ -b ${PARTITION2} ]; then mkfs.vfat -F 32 -n "BOOTB" ${PARTITION2} else echo "Cant find bootb partition in /dev" fi if [ -b ${PARTITION5} ]; then mkfs.ext4 -L "rootfs" ${PARTITION5} else echo "Cant find rootfs partition in /dev" fi if [ -b ${PARTITION6} ]; then mkfs.ext4 -L "rootfsb" ${PARTITION6} else echo "Cant find rootfsb partition in /dev" fi ...
Second, we extract the boot.tar.gz and rootfs.tar.gz to the BOOT BOOTB rootfs rootfsB partition.The first reboot will boot to rootfs.
Third, we extract the boot.tar.gz which uEnv.txt's uenvcmd will lead to boot to rootfsB, but it's next first reboot stay in the uboot.
The bootpart and mmcdev param restore to default 1:2 and 1.
Why this occurred? We need your help, please.