Hi!
After recently styruggling with OFFSET and SIZE values for i.MX8MP and then later with the WDOG_B signal assertion on each reset. I am now experiencing very weird behaviour when attempting to change the value of variable "mmcroot" responsible for pointing to the rootFS partition to be mounted.
When attempting to write to the U-boot environment from Linux, I am able to define extra variables and change such variables like "splashimage" and "bootdelay" and then see these changes via fw_printenv.
root@edm-g-imx8mp:~# fw_printenv
baseboard=wb
baudrate=115200
board_name=EDM-G
board_rev=iMX8MP
boot_fit=no
bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bo
oti ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc1,115200
emmc_dev=2
ethprime=eth1
fastboot_dev=mmc2
fdt_addr=0x43000000
fdt_buffer=8192
fdt_file=imx8mp-edm-g-wb.dtb
fdt_high=0xffffffffffffffff
fdtcontroladdr=fcbf78b8
image=Image
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
jh_clk=
jh_mmcboot=setenv fdt_file imx8mp-evk-root.dtb;setenv jh_clk clk_ignore_unused; if run loadimage; then run mmcboot; else run jh_netboot; fi;
jh_netboot=setenv fdt_file imx8mp-evk-root.dtb; setenv jh_clk clk_ignore_unused; run netboot;
kboot=booti
loadaddr=0x40480000
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=echo Loading fdt_file ${fdt_file}...; fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
loadoverlay=fdt addr ${fdt_addr} && fdt resize ${fdt_buffer}; setexpr fdtovaddr ${fdt_addr} + 0xF0000; for ov in ${dtoverlay}; do echo Overlaying ${ov}...; fatload mmc ${mmcdev}:${mmcpart} ${fdtovaddr} imx8mp-edm-g-${baseboard}-${ov}.dtbo && fdt apply ${fdtovaddr}; done
m7boot=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m7image}; cp.b ${loadaddr} ${m7loadaddr} ${filesize}; dcache flush; bootaux ${m7loadaddr}
m7image=hello_world.bin
m7loadaddr=0x007E0000
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fit} = yes || test ${boot_fit} = try; then bootm ${loadaddr}; else if run loadfdt; then run loadoverlay; booti ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; fi;
mmcdev=2
mmcpart=1
nandfit_part=yes
netargs=setenv bootargs ${jh_clk} console=${console} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${loadaddr} ${image}; if test ${boot_fit} = yes || test ${boot_fit} = try; then bootm ${loadaddr}; else if ${get_cmd} ${fdt_addr} ${fdt_file}; then booti ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; fi;
script=boot.scr
sd_dev=1
serial#=1b234800497c1a31
soc_type=imx8mp
splashimage=0x50000000
bootcmd=mmc dev ${mmcdev}; if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi;
bootdelay=2
mmcroot=/dev/mmcblk2p2 rootwait rw
root@edm-g-imx8mp:~# fw_setenv CRAP 100
root@edm-g-imx8mp:~# fw_setenv bootdelay 10
root@edm-g-imx8mp:~# fw_setenv mmcroot /dev/mmcblk2p3 rootwait rw
root@edm-g-imx8mp:~# fw_printenv
CRAP=100
bootdelay=10
mmcroot=/dev/mmcblk2p3 rootwait rw
However although the changes to bootdelay happen imidiately after issuing reboot command from Linux the mmcroot variable refuses to have the same value as sat via fw_setenv.
U-Boot 2020.04-235350493ba888d2340e29b6ec942314f2792761+g235350493b (Jun 11 2021 - 07:21:49 +0000)
CPU: i.MX8MP[8] rev1.1 1800 MHz (running at 1200 MHz)
CPU: Commercial temperature grade (0C to 95C) at 42C
Reset cause: POR
Model: TechNexion EDM-G-IMX8MP
DRAM: 4 GiB
MMC: FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
Can't find cec device id=0x3c
[*]-Video Link 1probe video device failed, ret -2
[0] lcd-controller@32e80000, video
[1] mipi_dsi@32e60000, video_bridge
[2] rm67191_panel, panel
probe video device failed, ret -2
In: serial
Out: serial
Err: serial
BuildInfo:
- ATF f1d7187
- U-Boot 2020.04-235350493ba888d2340e29b6ec942314f2792761+g235350493b
switch to partitions #0, OK
mmc2(part 0) is current device
flash target is MMC:2
Net: No ethernet found.
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 10
u-boot=> printenv CRAP
CRAP=100
u-boot=> printenv bootdelay
bootdelay=10
u-boot=> printenv mmcroot
mmcroot=/dev/mmcblk2p2 rootwait rw
Here's trimmed output of fw_printenv after rebooting of the device.
root@edm-g-imx8mp:~# fw_printenv
bootcmd=mmc dev ${mmcdev}; if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi;
CRAP=100
bootdelay=10
mmcroot=/dev/mmcblk2p3 rootwait rw
I have tested and I am able to change that variable manually to mount two separate rootFS partitions when overriding the variable from U-boot. However as I am supposed to implement A/B partition Software Update I really need to be able to do so via script from Linux.
Can somebody enlighten me how to fix this issue?