# 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 1 0x21000000 images/cis.bin
#nand erase  0x0 0x140000
#nand write 0x21000000 0x0 ${filesize}
#nand write 0x21000000 0x20000 ${filesize}
#nand write 0x21000000 0x40000 ${filesize}
#nand write 0x21000000 0x60000 ${filesize}
#nand write 0x21000000 0x80000 ${filesize}
#nand write 0x21000000 0xA0000 ${filesize}
#nand write 0x21000000 0xC0000 ${filesize}
#nand write 0x21000000 0xE0000 ${filesize}
#nand write 0x21000000 0x100000 ${filesize}
#nand write 0x21000000 0x120000 ${filesize}

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

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

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

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

fatload mmc 1 0x21000000 images/ubi.sound.squashfs;
nand erase.part SOUND
nand write.e 0x21000000 SOUND ${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 1 0x21000000 images/data.ubifs
ubi write 0x21000000 data ${filesize}

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

# <- this is for comment / total file size must be less than 4KB
#setenv bootargs 'WBWA console=ttyS0,115200 root=/dev/ubiblock0_0 rootfstype=squashfs ro init=/linuxrc LX_MEM=0x8000000 mma_heap=mma_heap_name0,miu=0,sz=0x3600000 mma_memblock_rem ove=1 cma=2M mtdparts=nand0:1536k@1280k(BOOT),1536k(BOOT_BAK),256k(ENV),5m(ROOTFS),4m(A_KERNEL),70m(A_USRFS),4m(B_KERNEL),70m(B_USRFS),3m(SOUND),90m(DATA),384k@0XFFA0000(FACTORY)'

#setenv mtdparts 'mtdparts=nand0:1536k@1280k(BOOT),1536k(BOOT_BAK),256k(ENV),5m(ROOTFS),4m(A_KERNEL),70m(A_USRFS),4m(B_KERNEL),70m(B_USRFS),3m(SOUND),90m(DATA),384k@0XFFA0000(FACTORY)'

#setenv bootcmd 'nand read 0x23000000 0x980000 0x400000;bootm 0x23000000'

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