From c2fad0831e2ea2e353b2b65abe833ff541085a6e Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Tue, 5 May 2015 09:48:53 +0200 Subject: 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. --- .../apalis-imx6/apalis-imx6_bin/flash_blk.img | Bin 1978 -> 1987 bytes .../apalis-imx6/apalis-imx6_bin/flash_blk.scr | 12 +++++------ .../apalis-imx6/apalis-imx6_bin/flash_eth.img | Bin 1838 -> 1850 bytes .../apalis-imx6/apalis-imx6_bin/flash_eth.scr | 13 +++++------ .../apalis-imx6/apalis-imx6_bin/flash_mmc.img | Bin 326 -> 326 bytes .../files/apalis-t30/apalis-t30_bin/flash_blk.img | Bin 3661 -> 3847 bytes .../files/apalis-t30/apalis-t30_bin/flash_blk.scr | 24 +++++++++++++-------- .../files/apalis-t30/apalis-t30_bin/flash_eth.img | Bin 3398 -> 3754 bytes .../files/apalis-t30/apalis-t30_bin/flash_eth.scr | 16 ++++++++++---- .../files/apalis-t30/apalis-t30_bin/flash_mmc.img | Bin 0 -> 326 bytes .../files/apalis-t30/apalis-t30_bin/flash_mmc.scr | 6 ++++++ .../colibri-imx6/colibri-imx6_bin/flash_blk.img | Bin 1732 -> 1740 bytes .../colibri-imx6/colibri-imx6_bin/flash_blk.scr | 10 ++++----- .../colibri-imx6/colibri-imx6_bin/flash_eth.img | Bin 1614 -> 1624 bytes .../colibri-imx6/colibri-imx6_bin/flash_eth.scr | 11 +++++----- .../colibri-imx6/colibri-imx6_bin/flash_mmc.img | Bin 163 -> 326 bytes .../colibri-t20/colibri-t20_bin/flash_blk.img | Bin 848 -> 848 bytes .../colibri-t20/colibri-t20_bin/flash_blk.scr | 2 +- .../colibri-t20/colibri-t20_bin/flash_eth.img | Bin 728 -> 728 bytes .../colibri-t30/colibri-t30_bin/flash_blk.img | Bin 3662 -> 3848 bytes .../colibri-t30/colibri-t30_bin/flash_blk.scr | 24 +++++++++++++-------- .../colibri-t30/colibri-t30_bin/flash_eth.img | Bin 3399 -> 3755 bytes .../colibri-t30/colibri-t30_bin/flash_eth.scr | 16 ++++++++++---- .../colibri-t30/colibri-t30_bin/flash_mmc.img | Bin 0 -> 326 bytes .../colibri-t30/colibri-t30_bin/flash_mmc.scr | 6 ++++++ 25 files changed, 91 insertions(+), 49 deletions(-) create mode 100644 recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img create mode 100644 recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.scr create mode 100644 recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img create mode 100644 recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.scr 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 index d2f5ce4..b6f538b 100644 Binary files a/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.img and b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.img differ 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 index 9cfac8f..506688c 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 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 index 305ee8b..98dd92f 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-t30/apalis-t30_bin/flash_blk.img b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img index 4cb856d..0700be8 100644 Binary files a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img and b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img differ 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 index 3f4c2f1..792bd47 100644 Binary files a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.img and b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.img differ 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 new file mode 100644 index 0000000..71093e8 Binary files /dev/null and b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img differ 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 index 7e2cde2..c152522 100644 Binary files a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.img and b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.img differ 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 index 1c59d15..46a5808 100644 Binary files a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.img and b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.img differ 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 index 5be627e..6656c76 100644 Binary files a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.img and b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.img differ 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 index 91246e1..9df988e 100644 Binary files a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.img and b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.img differ 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 index 8ad27ab..e0014c1 100644 Binary files a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.img and b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.img differ 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 index ce5f26c..a256780 100644 Binary files a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img and b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img differ 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 index 139d4d3..c0665cb 100644 Binary files a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.img and b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.img differ 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 new file mode 100644 index 0000000..550f077 Binary files /dev/null and b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img differ 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} -- cgit v1.2.3