From ea0553189c81bebe76e7e83a018970684c61d6f1 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Wed, 15 Apr 2015 11:33:15 +0200 Subject: trdx-image-fstype: sync Vybrid flash scripts Update to latest version (SVN r671) of burnflash. --- .../apalis-imx6/apalis-imx6_bin/flash_eth.img | Bin 1603 -> 1838 bytes .../apalis-imx6/apalis-imx6_bin/flash_eth.scr | 4 +++- .../apalis-imx6/apalis-imx6_bin/flash_mmc.img | Bin 1609 -> 1859 bytes .../apalis-imx6/apalis-imx6_bin/flash_mmc.scr | 4 +++- recipes/images/files/colibri-vf/README | 6 ++++-- recipes/images/files/colibri-vf/format_sd.sh | 2 +- recipes/images/files/colibri-vf/update.sh | 14 ++++++------- .../images/files/colibri-vf/vf_flash/imx_uart.m32 | Bin 27288 -> 0 bytes recipes/images/files/library/imx6/update.sh | 23 ++++++++++++++------- recipes/images/files/library/t30/update.sh | 2 +- 10 files changed, 34 insertions(+), 21 deletions(-) delete mode 100755 recipes/images/files/colibri-vf/vf_flash/imx_uart.m32 diff --git a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.img b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.img index d5987f5..50818f9 100644 Binary files a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.img and b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.img differ diff --git a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr index 9122758..a95d703 100644 --- a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr +++ b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr @@ -2,14 +2,16 @@ setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt setenv set_nextnum 'setexpr filenum ${filenum} + 1; setexpr blkstart ${blkstart} + ${blkcnt}' setenv cp_file_chunk 'tftpboot ${loadaddr} root.ext3-${filenum}; run set_blkcnt; mmc dev 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' setenv update_uboot 'tftpboot ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}' +setenv update_uboot_it 'tftpboot ${loadaddr} u-boot-it.imx && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}' setenv update_kernel 'tftpboot ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' setenv update_fdt 'tftpboot ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' setenv update_configblock 'tftpboot ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x500 ${blkcnt}' setenv update 'run update_1; run update_uboot; run update_2; run update_3; reset' +setenv update_it 'run update_1; run update_uboot_it; run update_2; run update_3; reset' setenv update_1 'tftpboot ${loadaddr} mbr.bin && mmc dev 0 && mmc write ${loadaddr} 0x0 0x1' setenv update_2 'tftpboot ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' #do it in chunks of 256M to fit into DDR RAM of the smallest module #split root.ext3 into multiple 256M chunks before copying to TFTP folder as follows #split -a 1 -b `expr 256 \* 1024 \* 1024` -d root.ext3 root.ext3- setenv update_3 'setenv filesize 10000000; setenv filenum 0; setenv blkstart a000; while test ${filesize} -eq "10000000"; do run cp_file_chunk; run set_nextnum; done' -echo 'enter "run update" to update the entire module' +echo 'enter "run update" or "run update_it" to update the entire module' diff --git a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.img b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.img index 72348fd..d78d920 100644 Binary files a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.img and b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.img differ diff --git a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.scr b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.scr index 5d26cb8..e144905 100644 --- a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.scr +++ b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.scr @@ -3,12 +3,14 @@ setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' setenv cp_file_chunk 'fatload mmc ${drive}:1 ${loadaddr} root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' setenv update_uboot 'fatload mmc ${drive}:1 ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}' +setenv update_uboot_it 'fatload mmc ${drive}:1 ${loadaddr} u-boot-it.imx && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}' setenv update_kernel 'fatload mmc ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' setenv update_fdt 'fatload mmc ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' setenv update_configblock 'fatload mmc ${drive}:1 ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x500 ${blkcnt}' setenv update 'run update_1; run update_uboot; run update_2; run update_3; reset' +setenv update_it 'run update_1; run update_uboot_it; run update_2; run update_3; reset' setenv update_1 'fatload mmc ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 && mmc write ${loadaddr} 0x0 0x1' setenv update_2 'fatload mmc ${drive}:1 ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' #do it in chunks of 256M to fit into DDR RAM of the smallest module setenv update_3 'setenv filesize 10000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "10000000"; do run cp_file_chunk; run set_nextpos; done' -echo 'enter "run update" to update the entire module' +echo 'enter "run update" or "run update_it" to update the entire module' diff --git a/recipes/images/files/colibri-vf/README b/recipes/images/files/colibri-vf/README index d350ef7..8d283da 100644 --- a/recipes/images/files/colibri-vf/README +++ b/recipes/images/files/colibri-vf/README @@ -1,4 +1,6 @@ Toradex Linux BSP +================= -Use the update.sh script to update your module. Also check the Release Notes -located in the same directory of the BSP release tarball. +Use the update.sh script to update your module. Check the Release Notes for +detailed instruction how to use flash your module. The Release Notes is located +in the same directory of the BSP release tarball. diff --git a/recipes/images/files/colibri-vf/format_sd.sh b/recipes/images/files/colibri-vf/format_sd.sh index a1e2e86..717ccd0 100755 --- a/recipes/images/files/colibri-vf/format_sd.sh +++ b/recipes/images/files/colibri-vf/format_sd.sh @@ -91,7 +91,7 @@ sudo umount ${DEV}${PART_PREFIX}? # partition and format the vfat partition sudo parted -s $DEV mklabel msdos mkpart primary fat32 1MB 512MB mkpart primary ext3 512MB 100% sudo umount ${DEV}${PART_PREFIX}1 -sudo mkfs.vfat -n KERNEL ${DEV}${PART_PREFIX}1 +sudo mkfs.vfat -n UPDATE ${DEV}${PART_PREFIX}1 # dd U-Boot onto the SD card sudo dd if=colibri-vf_bin/u-boot.imx of=${DEV} bs=512 seek=2 diff --git a/recipes/images/files/colibri-vf/update.sh b/recipes/images/files/colibri-vf/update.sh index 014c475..1eea0b4 100755 --- a/recipes/images/files/colibri-vf/update.sh +++ b/recipes/images/files/colibri-vf/update.sh @@ -12,7 +12,7 @@ Flash() echo "To flash the Colibri VFxx module a running U-Boot is required. Boot the" echo "module to the U-Boot prompt and" echo "" - echo "insert the SD card and enter:" + echo "insert the USB flash drive or SD card and enter:" echo "# run setupdate" echo "" echo "to update all components enter:" @@ -42,11 +42,11 @@ Usage() echo "" echo "Prepares and copies files for flashing the internal NAND of a Colibri VFxx" echo "" - echo "The recommended way is to copy the files on a SD card. The script format_sd.sh" - echo "may be used to format the SD card." + echo "The recommended way is to copy the files on a SD card or USB flash drive." + echo "The script format_sd.sh may be used to format the SD card." echo "" - echo "Will require a running U-Boot on the target. Either one already flashed" - echo "on the NAND or download using serial downloader (argument -d)." + echo "The flash step requires a running U-Boot on the target. Either one already" + echo "flashed on the NAND or download using serial downloader (argument -d)." echo "" echo "-d uart_dev : use UART connection to copy and execute U-Boot from module's RAM" echo "-f : flash instructions" @@ -81,7 +81,7 @@ while getopts "d:fnho:s" Option ; do ;; h) Usage # Exit if only usage (-h) was specified. - if [[ $# -eq 1 ]] ; then + if [ $# -eq 1 ] ; then exit 10 fi exit 0 @@ -96,7 +96,7 @@ while getopts "d:fnho:s" Option ; do esac done -if [[ "$OUT_DIR" = "" && "$UBOOT_RECOVERY" = "0" ]] ; then +if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then Usage exit 0 fi diff --git a/recipes/images/files/colibri-vf/vf_flash/imx_uart.m32 b/recipes/images/files/colibri-vf/vf_flash/imx_uart.m32 deleted file mode 100755 index 6251202..0000000 Binary files a/recipes/images/files/colibri-vf/vf_flash/imx_uart.m32 and /dev/null differ diff --git a/recipes/images/files/library/imx6/update.sh b/recipes/images/files/library/imx6/update.sh index 6f91728..c9a8ed5 100755 --- a/recipes/images/files/library/imx6/update.sh +++ b/recipes/images/files/library/imx6/update.sh @@ -20,18 +20,19 @@ Flash() echo "To flash the Apalis/Colibri iMX6 module, boot the module to the U-Boot prompt and" echo "" echo "when using a SD-card, insert the SD-card and enter:" - echo "run setupdate" + echo "'run setupdate'" echo "" echo "when using tftp, connect Ethernet and enter:" - echo "tftp \$loadaddr flash_eth.img ; source \$loadaddr" + echo "'tftp \$loadaddr flash_eth.img ; source \$loadaddr'" echo "" echo "then enter to update all:" - echo "run update" + echo "'run update' or 'run update_it'" echo "" echo "to update a single component enter one of:" - echo "run update_uboot" - echo "run update_kernel" + echo "'run update_uboot' or 'run update_uboot_it'" + echo "'run update_kernel'" echo "" + echo "Use the version with '_it' if you have an IT module, e.g. 'Apalis iMX6Q 2GB IT'" echo "" echo "If you don't have a working U-Boot anymore, connect your PC to the module's" echo "USB client port, bring the module in the serial download mode and start" @@ -92,6 +93,7 @@ if [ "$CNT" -ge 1 ] ; then MODTYPE=colibri-imx6 IMAGEFILE=root.ext3 U_BOOT_BINARY=u-boot.imx + U_BOOT_BINARY_IT=u-boot.imx KERNEL_DEVICETREE="imx6dl-colibri-eval-v3.dtb" LOCPATH="imx_flash" # eMMC size [in sectors of 512] @@ -103,6 +105,7 @@ else MODTYPE=apalis-imx6 IMAGEFILE=root.ext3 U_BOOT_BINARY=u-boot.imx + U_BOOT_BINARY_IT=u-boot-it.imx KERNEL_DEVICETREE="imx6q-apalis-eval.dtb imx6q-apalis-eval_v1_0.dtb" LOCPATH="imx_flash" # eMMC size [in sectors of 512] @@ -118,7 +121,8 @@ BINARIES=${MODTYPE}_bin #is only U-Boot to be copied to RAM? if [ "$UBOOT_RECOVERY" -ge 1 ] ; then cd ${LOCPATH} - sudo ./imx_usb ../${BINARIES}/${U_BOOT_BINARY} + #the IT timings work for all modules, so use it during recovery + sudo ./imx_usb ../${BINARIES}/${U_BOOT_BINARY_IT} exit 1 fi @@ -138,8 +142,9 @@ then exit 1 fi -#sanity check for existens of U-Boot and kernel +#sanity check for existence of U-Boot and kernel [ -e ${BINARIES}/${U_BOOT_BINARY} ] || { echo "${BINARIES}/${U_BOOT_BINARY} does not exist"; exit 1; } +[ -e ${BINARIES}/${U_BOOT_BINARY_IT} ] || { echo "${BINARIES}/${U_BOOT_BINARY_IT} does not exist"; exit 1; } [ -e ${BINARIES}/uImage ] || { echo "${BINARIES}/uImage does not exist"; exit 1; } #sanity check for some programs @@ -160,6 +165,7 @@ rm ${BINARIES}/versions.txt touch ${BINARIES}/versions.txt echo "Component Versions" > ${BINARIES}/versions.txt basename "`readlink -e ${BINARIES}/${U_BOOT_BINARY}`" >> ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/${U_BOOT_BINARY_IT}`" >> ${BINARIES}/versions.txt basename "`readlink -e ${BINARIES}/uImage`" >> ${BINARIES}/versions.txt $ECHO -n "Rootfs " >> ${BINARIES}/versions.txt grep -i imx6 rootfs/etc/issue >> ${BINARIES}/versions.txt @@ -253,7 +259,8 @@ sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || #copy to $OUT_DIR -sudo cp ${BINARIES}/configblock.bin ${BINARIES}/${U_BOOT_BINARY} ${BINARIES}/uImage ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat ${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR" +sudo cp ${BINARIES}/configblock.bin ${BINARIES}/${U_BOOT_BINARY} ${BINARIES}/${U_BOOT_BINARY_IT} ${BINARIES}/uImage ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat \ + ${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR" sync Flash diff --git a/recipes/images/files/library/t30/update.sh b/recipes/images/files/library/t30/update.sh index 21b4ac6..d92b9b7 100755 --- a/recipes/images/files/library/t30/update.sh +++ b/recipes/images/files/library/t30/update.sh @@ -143,7 +143,7 @@ then exit 1 fi -#sanity check for existens of U-Boot and kernel +#sanity check for existence of U-Boot and kernel [ -e ${BINARIES}/${U_BOOT_BINARY} ] || { echo "${BINARIES}/${U_BOOT_BINARY} does not exist"; exit 1; } [ -e ${BINARIES}/uImage ] || { echo "${BINARIES}/uImage does not exist"; exit 1; } -- cgit v1.2.3