I am running an i.MX 8M Mini processor and have partitioned the eMMC to 4 user partitions so that I can update the OS remotely with swupdate.
/dev/mmcblk2p1 <--OS1 boot
/dev/mmcblk2p2 <--OS1 Filesystem
/dev/mmcblk2p3 <--OS2 boot
/dev/mmcblk2p4 <--OS2 Filesystem
In U-Boot I can set:
mmcpart=1 and mmcroot=/dev/mmcblk2p2 and it will boot OS1 or
mmcpart=3 and mmcroot=/dev/mmcblk2p4 and it will boot OS2
However, every time the board restarts mmcroot gets reset to /dev/mmcblk2p2. I can setenv mmcpart to be either 1 or 3 and it is persistent everytime I reboot. But mmcroot is always overwritten to /dev/mmcblk2p2.
When Uboot loads or I saveenv, it also seems to load and properly.
MMC: FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... Run CMD11 1.8V switch
OK
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(2)... OK
I am saving my environment to eMMC and my config looks like this:
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_MMC_ENV_DEV=2
CONFIG_SYS_MMC_ENV_PART=2
CONFIG_ENV_SIZE=0x1000
CONFIG_ENV_SECT_SIZE=0x10000
CONFIG_ENV_OFFSET=0x400000
I also have at /etc/fw_env.confg
# device name, Device offset, Env. size, Flash sector size
/dev/mmcblk2 0x400000 0x1000 0x10000
I can use fw_setenv to set mmcpart and it works properly and is read when in Uboot, but the same thing happens when I tried to set mmcroot where it always reverts back to /dev/mmcblk2p2.
How can I make mmcroot be persistent across reboots?
The i.MX8MM can not support two OS, so the setting is not available.
It work at default one /dev/mmcblk2p2.
Just use the default value, do not recommend you to modify.
Hope this can do help for you.