I don't have this model exactly. If you have serial access it should be easy.
There are some env variables with tftpboot
:
altkern=a680000
filesize=24a0000
flashimg=tftpboot $loadaddr $image && nand erase $prikern $imgsize && nand write $loadaddr $prikern $filesize
flashimg2=tftpboot $loadaddr $image && nand erase $altkern $imgsize && nand write $loadaddr $altkern $filesize
image=FW_MX4200TR_2.0.5.210476_prod.img
imgsize=9600000
loadaddr=44000000
prikern=1080000
So this command should work for kernel
partition:
tftpboot 44000000 192.168.1.76:FW_MX4200TR_2.0.5.210476_prod.img && nand erase 1080000 9600000 && nand write 44000000 1080000 2600000
and for alt_kernel
partition:
tftpboot 44000000 192.168.1.76:FW_MX4200TR_2.0.5.210476_prod.img && nand erase a680000 9600000 && nand write 44000000 a680000 2600000
The last value 2600000
need to be adjusted to actual OEM firmware size.
You can do the same by loading a file from USB:
usb start && fatload usb 0:1 44000000 FW_MX4200TR_2.0.5.210476_prod.img && nand erase 1080000 9600000 && nand write 44000000 1080000 2600000
usb start && fatload usb 0:1 44000000 FW_MX4200TR_2.0.5.210476_prod.img && nand erase a680000 9600000 && nand write 44000000 a680000 2600000
These two commands are only run when updating OEM firmware:
flash_erase /dev/mtd21 0 0
nandwrite -p /dev/mtd21 FW_MX4200TR_2.0.5.210476_prod.img
I'm not sure how the rootfs
UBI volume is transferred from the kernel
partition to the rootfs
partition.