summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-01-05 11:08:17 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2017-01-11 20:18:11 +0100
commitc121c46ae099341aec678c5a12edcce8f91a0f51 (patch)
treed82a8c7e7b189e271938755cab9c865572b86156
parente133fe5f0b3337a80354562acd6b089240d8cdd9 (diff)
flash scripts: fix create_bcb to work for flashing from scratch
Do not save/restore config block in create_bcb since we use this command in flashing from scratch. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr5
-rw-r--r--recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr7
2 files changed, 7 insertions, 5 deletions
diff --git a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr
index ee922b9..f1e73bb 100644
--- a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr
+++ b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr
@@ -1,4 +1,5 @@
-setenv create_bcb 'nand read ${loadaddr} 0x800 0x800 && nand erase.part mx7-bcb && writebcb 80000 200000 && nand write ${loadaddr} 0x800 0x800'
+setenv create_bcb 'nand erase.part mx7-bcb && writebcb 80000 200000'
+setenv recreate_bcb 'nand read ${loadaddr} 0x800 0x800 && run create_bcb && nand write ${loadaddr} 0x800 0x800'
# Migrate to UBI volume based boot schema
setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static'
@@ -6,7 +7,7 @@ setenv prepare_m4firmware 'ubi create m4firmware 0xe0000 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_m4firmware && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_m4firmware && run prepare_rootfs; fi'
-setenv upgrade_msg 'echo && echo "Upgraded U-Boot, please reset the board and complete update with" && echo "# run setupdate && run create_bcb && run update" && echo && echo "(note the create_bcb command in between!)"'
+setenv upgrade_msg 'echo && echo "Upgraded U-Boot, please reset the board and complete update with" && echo "# run setupdate && run recreate_bcb && run update" && echo && echo "(note the recreate_bcb command in between!)"'
setenv update_uboot_old 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && writeboot ${loadaddr} 80000 200000 $filesize && nand erase.part u-boot-env && nand erase.part ubi && run upgrade_msg'
setenv update_uboot 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot1 && nand write ${loadaddr} u-boot1 ${filesize} && nand erase.part u-boot2 && nand write ${loadaddr} u-boot2 ${filesize}'
setenv update_kernel 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}'
diff --git a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr
index 5a54bfa..66cd29d 100644
--- a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr
+++ b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr
@@ -1,4 +1,5 @@
-setenv create_bcb 'nand read ${loadaddr} 0x800 0x800 && nand erase.part mx7-bcb && writebcb 80000 200000 && nand write ${loadaddr} 0x800 0x800'
+setenv create_bcb 'nand erase.part mx7-bcb && writebcb 80000 200000'
+setenv recreate_bcb 'nand read ${loadaddr} 0x800 0x800 && run create_bcb && nand write ${loadaddr} 0x800 0x800'
# Migrate to UBI volume based boot schema
setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static'
@@ -6,7 +7,7 @@ setenv prepare_m4firmware 'ubi create m4firmware 0xe0000 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_m4firmware && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_m4firmware && run prepare_rootfs; fi'
-setenv upgrade_msg 'echo && echo "Upgraded U-Boot, please reset the board and complete update with" && echo "# run setupdate && run create_bcb && run update" && echo && echo "(note the create_bcb command in between!)"'
+setenv upgrade_msg 'echo && echo "Upgraded U-Boot, please reset the board and complete update with" && echo "# run setupdate && run recreate_bcb && run update" && echo && echo "(note the recreate_bcb command in between!)"'
setenv update_uboot_old 'tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && writeboot ${loadaddr} 80000 200000 $filesize && nand erase.part u-boot-env && nand erase.part ubi && run upgrade_msg'
setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot1 && nand write ${loadaddr} u-boot1 ${filesize} && nand erase.part u-boot2 && nand write ${loadaddr} u-boot2 ${filesize}'
setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}'
@@ -21,7 +22,7 @@ echo &&
echo 'NOTE: The U-Boot provided with this BSP version does not support the' &&
echo 'early tapeout/stepping of i.MX 7 used on your module. You still can' &&
echo 'update the kernel/device-tree/rootfs manually using: ' &&
-echo '# run prepare_ubi && run update_kernel && run update_fdt && update_rootfs' &&
+echo '# run prepare_ubi && run update_kernel && run update_fdt && run update_rootfs' &&
echo && setenv update_uboot; setenv update_uboot_old; setenv update
else
echo 'enter "run update" to update the entire module'