summaryrefslogtreecommitdiff
path: root/recipes/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr')
-rw-r--r--recipes/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr19
1 files changed, 12 insertions, 7 deletions
diff --git a/recipes/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr b/recipes/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr
index 58d1282..b2a3bf6 100644
--- a/recipes/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr
+++ b/recipes/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr
@@ -1,16 +1,21 @@
setenv create_bcb 'nand erase.part vf-bcb && writebcb 0x20000 0x20000'
setenv update_configblock 'fatload ${interface} 0:1 ${loadaddr} configblock.bin && nand write ${loadaddr} 0x800 ${filesize}'
+setenv prepare_rootfs 'ubi part ubi && ubi check rootfs || ubi create rootfs'
setenv update_uboot 'fatload ${interface} 0:1 ${loadaddr} u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && nand write ${loadaddr} u-boot'
-setenv update_rootfs 'fatload ${interface} 0:1 ${loadaddr} ubifs.img && nand erase.part ubi && ubi part ubi && ubi createvol rootfs && ubi write ${loadaddr} rootfs ${filesize}'
+setenv update_rootfs 'fatload ${interface} 0:1 ${loadaddr} ubifs.img && run prepare_rootfs && ubi write ${loadaddr} rootfs ${filesize}'
-setenv echo_v2.1b3 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.1b3\" to complete update"
-setenv migrate_v2.1b3 'nand read ${loadaddr} 0x40000 0x800 && nand erase.chip && writebcb 0x20000 0x20000 && nand write ${loadaddr} 0x800 0x800 && run update_new'
-setenv update_v2.1b3 'run update_uboot; run echo_v2.1b3'
+setenv update_new 'run update_uboot; run update_rootfs; reset'
-setenv mtdparts 'mtdparts=fsl_nfc:128k(vf-bcb)ro,1408k(u-boot)ro,512k(u-boot-env),-(ubi)'
+# Upgrade part 1, write new U-Boot, but with old ECC format still...
+# Store config block temporarly in memory at kernel_addr_r.
+setenv upgrade_part1 'run update_uboot && nand read ${kernel_addr_r} 0x800 0x20 && echo "successfully updated U-Boot, enter \"reset\", interrupt boot process and enter \"run setupdate\; run upgrade_part2\" to complete upgrade"'
-setenv update_new 'run update_uboot; run update_rootfs; reset'
-setenv update 'if test -v $ver; then run update_new; else run update_v2.1b3; fi'
+# Upgrade part 2, use new ECC format for the whole device...
+setenv upgrade_part2 'run create_bcb && nand write ${kernel_addr_r} 0x800 0x20 && \
+run update_uboot && nand erase.part ubi && run update_rootfs'
+
+# fsl_nfc indicates old NAND format (24-bit ECC), start migration process
+setenv update 'mtdparts default && if test "${mtdids}" = "nand0=fsl_nfc"; then; run upgrade_part1; else run update_new; fi'
echo 'enter "run update" to update the entire module'