diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-05-05 09:48:53 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2015-05-12 10:06:08 +0200 |
commit | 2602b3986aa66203ecd375139f9eba0cbd5543c3 (patch) | |
tree | 156e23eb1bcff949e19ec32c51e64677f3c441f9 /recipes/images | |
parent | a1f6d5b25c105b5088c3aa1b407c4fed8389064a (diff) |
apalis/colibri_imx6/t20/t30: revamp update scripts
iMX6: Always do use a secondary argument for the 'mmc dev' command.
T30: Do rootfs update of eMMC in chunks as well. Requires pre-splitting
file in Ethernet case. As an advantage allows flashing rootfs bigger
than RAM plus avoids timeouts during flashing. Added wrapper flash_mmc
script as well for backwards compatibility reason.
While at it cleanup various whitespaces throughout the update scripts.
Diffstat (limited to 'recipes/images')
25 files changed, 91 insertions, 49 deletions
diff --git a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.img b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.img Binary files differindex d2f5ce4..b6f538b 100644 --- a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.img +++ b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.img diff --git a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr index 7d431aa..353ff70 100644 --- a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr +++ b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr @@ -4,16 +4,16 @@ test -n ${drive} || setenv drive 1 setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' -setenv cp_file_chunk 'fatload ${interface} ${drive}:1 ${loadaddr} root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' -setenv update_uboot 'fatload ${interface} ${drive}:1 ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}' -setenv update_uboot_it 'fatload ${interface} ${drive}:1 ${loadaddr} u-boot-it.imx && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}' +setenv cp_file_chunk 'fatload ${interface} ${drive}:1 ${loadaddr} root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' +setenv update_uboot 'fatload ${interface} ${drive}:1 ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}' +setenv update_uboot_it 'fatload ${interface} ${drive}:1 ${loadaddr} u-boot-it.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}' setenv update_kernel 'fatload ${interface} ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' setenv update_fdt 'fatload ${interface} ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' -setenv update_configblock 'fatload ${interface} ${drive}:1 ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x500 ${blkcnt}' +setenv update_configblock 'fatload ${interface} ${drive}:1 ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 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 ${interface} ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 && mmc write ${loadaddr} 0x0 0x1' -setenv update_2 'fatload ${interface} ${drive}:1 ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +setenv update_1 'fatload ${interface} ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'fatload ${interface} ${drive}:1 ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 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" or "run update_it" to update the entire module' 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 Binary files differindex 9cfac8f..506688c 100644 --- a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.img +++ b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.img 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 a95d703..b68654b 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 @@ -1,15 +1,16 @@ setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' 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 cp_file_chunk 'tftpboot ${loadaddr} root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' +setenv update_uboot 'tftpboot ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}' +setenv update_uboot_it 'tftpboot ${loadaddr} u-boot-it.imx && run set_blkcnt && mmc dev 0 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_configblock 'tftpboot ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 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}' +setenv update_1 'tftpboot ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'tftpboot ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 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- 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 Binary files differindex 305ee8b..98dd92f 100644 --- a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.img +++ b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.img diff --git a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img Binary files differindex 4cb856d..0700be8 100644 --- a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img +++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img diff --git a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr index 2c72480..4908b49 100644 --- a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr +++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr @@ -1,10 +1,13 @@ -test -n ${drive} || setenv drive 1 test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 -setenv check_1 'setenv conf_blk_offset 0x1fff; mmc dev 0 1; mmc read $loadaddr $conf_blk_offset 1' -setenv check_2 'setenv conf_blk_offset 0xfff; mmc dev 0 1; mmc read $loadaddr $conf_blk_offset 1' -setenv check_3 'setenv conf_blk_offset 0x7ff; mmc dev 0 1; mmc read $loadaddr $conf_blk_offset 1' -setenv check_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run check_1 || run check_2 || run check_3; crc32 -v $toradex_oui_addr 3 94305232' +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read $loadaddr $conf_blk_offset 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read $loadaddr $conf_blk_offset 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read $loadaddr $conf_blk_offset 1' +setenv check_configblock 'setexpr toradex_oui_addr $loadaddr + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v $toradex_oui_addr 3 94305232' setenv migrate_1 'mmc dev 0 0; mmc read ${loadaddr} 6000 1; setenv conf_blk_offset 0x1fff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' setenv migrate_2 'mmc dev 0 0; mmc read ${loadaddr} 8000 1; setenv conf_blk_offset 0xfff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' @@ -14,17 +17,20 @@ setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_off setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' setenv migrate_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' -setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 1; mmc write $loadaddr $conf_blk_offset ${blkcnt}' +setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' -setenv update_uboot 'fatload ${interface} ${drive}:1 ${loadaddr} apalis_t30.img && if setexpr blkcnt $filesize + 0x1ff; then setexpr blkcnt ${blkcnt} / 0x200; else setenv blkcnt 0x500; fi && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' +setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} apalis_t30.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' +setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} ${blkcnt}' + setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' -setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} boot.vfat && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' -setenv update_3 'load ${interface} ${drive}:1 ${loadaddr} root.ext3 && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0xa000 ${blkcnt}' +setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 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' setenv echo_v2.3b2 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b2\" to complete update" setenv migrate_v2.3b2 'run migrate_configblock; run update_new' diff --git a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.img b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.img Binary files differindex 3f4c2f1..792bd47 100644 --- a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.img +++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.img diff --git a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr index 520c05e..965549a 100644 --- a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr +++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr @@ -1,3 +1,6 @@ +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextnum 'setexpr filenum ${filenum} + 1; setexpr blkstart ${blkstart} + ${blkcnt}' + setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read $loadaddr $conf_blk_offset 1' setenv check_2 'setenv conf_blk_offset 0xfff; mmc read $loadaddr $conf_blk_offset 1' setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read $loadaddr $conf_blk_offset 1' @@ -11,17 +14,22 @@ setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_off setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' setenv migrate_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' -setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc write $loadaddr $conf_blk_offset ${blkcnt}' +setenv cp_file_chunk 'tftpboot ${loadaddr} root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' -setenv update_uboot 'tftpboot ${loadaddr} apalis_t30.img && if setexpr blkcnt $filesize + 0x1ff; then setexpr blkcnt ${blkcnt} / 0x200; else setenv blkcnt 0x500; fi && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' +setenv update_uboot 'tftpboot ${loadaddr} apalis_t30.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${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 'run check_configblock; tftpboot ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} ${blkcnt}' + setenv update_1 'tftpboot ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' -setenv update_2 'tftpboot ${loadaddr} boot.vfat && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' -setenv update_3 'tftpboot ${loadaddr} root.ext3 && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0xa000 ${blkcnt}' +setenv update_2 'tftpboot ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 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' setenv echo_v2.3b2 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b2\" to complete update" setenv migrate_v2.3b2 'run migrate_configblock; run update_new' diff --git a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img Binary files differnew file mode 100644 index 0000000..71093e8 --- /dev/null +++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img diff --git a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.scr b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.scr new file mode 100644 index 0000000..207c7db --- /dev/null +++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.scr @@ -0,0 +1,6 @@ +#flash_mmc has been renamed to flash_blk, ensure compatibilty when updating from older versions +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 + +fatload ${interface} ${drive}:1 ${loadaddr} flash_blk.img +source ${loadaddr} diff --git a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.img b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.img Binary files differindex 7e2cde2..c152522 100644 --- a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.img +++ b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.img diff --git a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr index a3713a6..2665a8c 100644 --- a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr +++ b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr @@ -4,14 +4,14 @@ test -n ${drive} || setenv drive 1 setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' -setenv cp_file_chunk 'fatload ${interface} ${drive}:1 ${loadaddr} root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' -setenv update_uboot 'fatload ${interface} ${drive}:1 ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}; patch_ddr_size' +setenv cp_file_chunk 'fatload ${interface} ${drive}:1 ${loadaddr} root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' +setenv update_uboot 'fatload ${interface} ${drive}:1 ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}; patch_ddr_size' setenv update_kernel 'fatload ${interface} ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' setenv update_fdt 'fatload ${interface} ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' -setenv update_configblock 'fatload ${interface} ${drive}:1 ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x500 ${blkcnt}' +setenv update_configblock 'fatload ${interface} ${drive}:1 ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x500 ${blkcnt}' setenv update 'run update_1; run update_uboot; run update_2; run update_3; reset' -setenv update_1 'fatload ${interface} ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 && mmc write ${loadaddr} 0x0 0x1' -setenv update_2 'fatload ${interface} ${drive}:1 ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +setenv update_1 'fatload ${interface} ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'fatload ${interface} ${drive}:1 ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' #do it in chunks of 64M to fit into DDR RAM of the smallest module setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done' echo 'enter "run update" to update the entire module' diff --git a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.img b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.img Binary files differindex 1c59d15..46a5808 100644 --- a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.img +++ b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.img diff --git a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr index 6eb57fb..e21870a 100644 --- a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr +++ b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr @@ -1,13 +1,14 @@ setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' 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}; patch_ddr_size' + +setenv cp_file_chunk 'tftpboot ${loadaddr} root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' +setenv update_uboot 'tftpboot ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}; patch_ddr_size' 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_configblock 'tftpboot ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x500 ${blkcnt}' setenv update 'run update_1; run update_uboot; 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}' +setenv update_1 'tftpboot ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'tftpboot ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' #do it in chunks of 64M to fit into DDR RAM of the smallest module #split root.ext3 into multiple 64M chunks before copying to TFTP folder as follows #split -a 1 -b `expr 64 \* 1024 \* 1024` -d root.ext3 root.ext3- diff --git a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.img b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.img Binary files differindex 5be627e..6656c76 100644 --- a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.img +++ b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.img diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.img b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.img Binary files differindex 91246e1..9df988e 100644 --- a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.img +++ b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.img diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr index 6ed07dc..9346761 100644 --- a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr +++ b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr @@ -1,5 +1,5 @@ -test -n ${drive} || setenv drive 1 test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 setenv prepare_rootfs 'ubi part ubi && ubi check rootfs || ubi create rootfs' setenv update_configblock 'load ${interface} 0:1 ${loadaddr} configblock.bin && nand erase.part cfgblock && nand write ${loadaddr} cfgblock ${filesize}' diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.img b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.img Binary files differindex 8ad27ab..e0014c1 100644 --- a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.img +++ b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.img diff --git a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img Binary files differindex ce5f26c..a256780 100644 --- a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img +++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img diff --git a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr index 2aa843a..d47ae8a 100644 --- a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr +++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr @@ -1,10 +1,13 @@ -test -n ${drive} || setenv drive 1 test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 -setenv check_1 'setenv conf_blk_offset 0x1fff; mmc dev 0 1; mmc read $loadaddr $conf_blk_offset 1' -setenv check_2 'setenv conf_blk_offset 0xfff; mmc dev 0 1; mmc read $loadaddr $conf_blk_offset 1' -setenv check_3 'setenv conf_blk_offset 0x7ff; mmc dev 0 1; mmc read $loadaddr $conf_blk_offset 1' -setenv check_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run check_1 || run check_2 || run check_3; crc32 -v $toradex_oui_addr 3 94305232' +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read $loadaddr $conf_blk_offset 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read $loadaddr $conf_blk_offset 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read $loadaddr $conf_blk_offset 1' +setenv check_configblock 'setexpr toradex_oui_addr $loadaddr + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v $toradex_oui_addr 3 94305232' setenv migrate_1 'mmc dev 0 0; mmc read ${loadaddr} 6000 1; setenv conf_blk_offset 0x1fff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' setenv migrate_2 'mmc dev 0 0; mmc read ${loadaddr} 8000 1; setenv conf_blk_offset 0xfff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' @@ -14,17 +17,20 @@ setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_off setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' setenv migrate_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' -setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 1; mmc write $loadaddr $conf_blk_offset ${blkcnt}' +setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' -setenv update_uboot 'fatload ${interface} ${drive}:1 ${loadaddr} colibri_t30.img && if setexpr blkcnt $filesize + 0x1ff; then setexpr blkcnt ${blkcnt} / 0x200; else setenv blkcnt 0x500; fi && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' +setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} colibri_t30.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' +setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} ${blkcnt}' + setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' -setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} boot.vfat && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' -setenv update_3 'load ${interface} ${drive}:1 ${loadaddr} root.ext3 && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0xa000 ${blkcnt}' +setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 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' setenv echo_v2.3b1 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b1\" to complete update" setenv migrate_v2.3b1 'run migrate_configblock; run update_new' diff --git a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.img b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.img Binary files differindex 139d4d3..c0665cb 100644 --- a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.img +++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.img diff --git a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr index 05dffa4..e3e7a59 100644 --- a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr +++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr @@ -1,3 +1,6 @@ +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextnum 'setexpr filenum ${filenum} + 1; setexpr blkstart ${blkstart} + ${blkcnt}' + setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read $loadaddr $conf_blk_offset 1' setenv check_2 'setenv conf_blk_offset 0xfff; mmc read $loadaddr $conf_blk_offset 1' setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read $loadaddr $conf_blk_offset 1' @@ -11,17 +14,22 @@ setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_off setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v $toradex_oui_addr 3 94305232 && mmc dev 0 1 && mmc write $loadaddr $conf_blk_offset 1' setenv migrate_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' -setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc write $loadaddr $conf_blk_offset ${blkcnt}' +setenv cp_file_chunk 'tftpboot ${loadaddr} root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' -setenv update_uboot 'tftpboot ${loadaddr} colibri_t30.img && if setexpr blkcnt $filesize + 0x1ff; then setexpr blkcnt ${blkcnt} / 0x200; else setenv blkcnt 0x500; fi && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' +setenv update_uboot 'tftpboot ${loadaddr} colibri_t30.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${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 'run check_configblock; tftpboot ${loadaddr} configblock.bin && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} ${blkcnt}' + setenv update_1 'tftpboot ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' -setenv update_2 'tftpboot ${loadaddr} boot.vfat && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' -setenv update_3 'tftpboot ${loadaddr} root.ext3 && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0xa000 ${blkcnt}' +setenv update_2 'tftpboot ${loadaddr} boot.vfat && run set_blkcnt && mmc dev 0 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' setenv echo_v2.3b1 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b1\" to complete update" setenv migrate_v2.3b1 'run migrate_configblock; run update_new' diff --git a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img Binary files differnew file mode 100644 index 0000000..550f077 --- /dev/null +++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img diff --git a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.scr b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.scr new file mode 100644 index 0000000..207c7db --- /dev/null +++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.scr @@ -0,0 +1,6 @@ +#flash_mmc has been renamed to flash_blk, ensure compatibilty when updating from older versions +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 + +fatload ${interface} ${drive}:1 ${loadaddr} flash_blk.img +source ${loadaddr} |