summaryrefslogtreecommitdiff
path: root/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr')
-rw-r--r--recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr28
1 files changed, 28 insertions, 0 deletions
diff --git a/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr b/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr
new file mode 100644
index 0000000..8fa5af9
--- /dev/null
+++ b/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr
@@ -0,0 +1,28 @@
+setenv create_bcb 'nand erase.part vf-bcb && writebcb 0x20000 0x20000'
+setenv update_configblock 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/configblock.bin && nand write ${loadaddr} 0x800 ${filesize}'
+
+# Migrate to UBI volume based boot schema
+setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static'
+setenv prepare_rootfs 'ubi create rootfs 0 dynamic'
+setenv prepare_ubi 'ubi part ubi && if ubi check rootfs; then if ubi check kernel; then else ubi remove rootfs && run prepare_kernel_fdt && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_rootfs; fi'
+
+setenv update_uboot 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && nand write ${loadaddr} u-boot'
+setenv update_kernel 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}'
+setenv update_fdt 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && ubi write ${loadaddr} dtb ${filesize}'
+setenv update_rootfs 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/ubifs.img && ubi write ${loadaddr} rootfs ${filesize}'
+
+setenv update_new 'run update_uboot; run prepare_ubi && run update_kernel && run update_fdt && run update_rootfs; reset'
+
+# 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 "${upgrade_part1_msg}"'
+setenv upgrade_part1_msg 'Successfully updated U-Boot, NAND upgrade required. Enter "reset", interrupt boot process and enter "run setupdate; run upgrade_part2" to complete upgrade.'
+
+# 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 && echo ${upgrade_part2_msg}'
+setenv upgrade_part2_msg 'Successfully upgraded module, enter "reset" to restart the module.'
+
+# 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'