# <- this is for comment / total file size must be less than 4KB
# console ok

#For pure MBOOT.bin upgrade, use below part
fatload usb 0:1 80400000 mb140_mboot.bin
spi_wrc 0x80400000 0x00000000 0xA0000

#---------------------------------------------------------------------
### check file exist or not
fatload usb 0:1 0x80400000 mb140_en.bin
aesdec 0x80400000 $(filesize)
#---------------------------------------------------------------------
### direct partition

###### Skip Vestel header #VESTEL#HHHHHHHH (16byte - 0x10)
###  Write MBOOT, LEN = 0xB0000
spi wrc 0x80400010 0x0 0xB0000
###  Write KL, LEN = 0x100000
spi wrc 0x804B0010 0xB0000 0x100000
###  Write ROOTFS, LEN = 0x130000
spi wrc 0x805B0010 0x1B0000 0x130000
###  Write VENDOR, LEN = 0xA90000
spi wrc 0x806E0010 0x2E0000 0xA90000
###  Write KEY_BLK, LEN = 0x10000
spi rdc 0x81170010 0xD70000 0x1B20
spi wrc 0x81170010 0xD70000 0x10000
###  Write REV_BK, LEN = 0x10000
spi wrc 0x81180010 0xD80000 0x10000
###  Write BOOTLOGO, LEN = 0x20000
spi wrc 0x81190010 0xD90000 0x20000
###  Write CONF_BK, LEN = 0x50000
spi wrc 0x811B0010 0xDB0000 0x50000
###  Write CONFIG, LEN = 0x200000
spi wrc 0x81200010 0xE00000 0x200000

### sync environment.txt
setenv sync_environment 1
saveenv

reset

% <- this is end of file symbol
