# The file name must be imi_update.txt  kevin lee add at 2021-11-15

# <- this is for comment / total file size must be less than 4KB
#fatload mmc 0 0x80600000 images/BOOT.bin
#nand erase.part BOOT
#nand write.e 0x80600000 BOOT ${filesize}

# <- this is for comment / total file size must be less than 4KB
fatload mmc 0 0x80600000 images/ubi.rootfs.squashfs
nand erase.part ROOTFS
nand write.e 0x80600000 ROOTFS ${filesize}

# <- this is for comment / total file size must be less than 4KB
fatload mmc 0 0x80600000 images/kernel.xz.img
nand erase.part A_KERNEL
nand write.e 0x80600000 A_KERNEL ${filesize}
nand erase.part B_KERNEL
nand write.e 0x80600000 B_KERNEL ${filesize}

# <- this is for comment / total file size must be less than 4KB
fatload mmc 0 0x80600000 images/ubi.usr.squashfs
nand erase.part A_USRFS
nand write.e 0x80600000 A_USRFS ${filesize}
nand erase.part B_USRFS
nand write.e 0x80600000 B_USRFS ${filesize}

fatload mmc 0 0x80600000 images/ubi.sound.squashfs;
nand erase.part SOUND
nand write.e 0x80600000 SOUND ${filesize}

#fatload mmc 0 0x80600000 images/factory.bin;
#nand erase.part FACTORY
#nand write.e 0x80600000 FACTORY ${filesize}

# <- this is for comment / total file size must be less than 4KB
nand erase.part DATA
ubi part DATA
ubi create data
fatload mmc 0 0x80600000 images/data.ubifs
ubi write 0x80600000 data ${filesize}

# <- this is for comment / total file size must be less than 4KB
#setenv bootargs 'console=ttyS1,115200n8 ubi.mtd=8,2048 mem=128M@0x0 rmem=64M@0x8000000 nmem=64M@0xC000000 init=/linuxrc rootfstype=squashfs root=/dev/mtdblock1 ro mtdparts=sfc_nand:1024k(BOOT),3072k(ROOTFS),3072k(A_KERNEL),46080k(A_USRFS),3072k(B_KERNEL),46080k(B_USRFS),3072k(SOUND),256k(FACTORY),-(DATA)

#setenv mtdparts 'mtdparts=nand:1024k(BOOT),3072k(ROOTFS),3072k(A_KERNEL),46080k(A_USRFS),3072k(B_KERNEL),46080k(B_USRFS),3072k(SOUND),256k(FACTORY),-(DATA)'

#setenv bootcmd 'nand read 0x80600000 0x400000 0x300000;bootm 0x80600000'

#setenv boot_flag 0
#saveenv
% <- this is end of file symbol

