From c52baf91b73348fe5d761b2e3cb64cf352c3a961 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Fri, 1 May 2015 14:41:49 +0200 Subject: Apalis/Colibri iMX6: extend U-Boot scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - rename flash_mmc script to flash_blk and adapt that it can also be used from a USB drive. - Add flash_mmc “proxy” script for the upgrade case --- .../files/apalis-imx6/apalis-imx6_bin/flash_blk.img | Bin 0 -> 1978 bytes .../files/apalis-imx6/apalis-imx6_bin/flash_blk.scr | 19 +++++++++++++++++++ .../files/apalis-imx6/apalis-imx6_bin/flash_eth.img | Bin 1838 -> 1838 bytes .../files/apalis-imx6/apalis-imx6_bin/flash_mmc.img | Bin 1859 -> 326 bytes .../files/apalis-imx6/apalis-imx6_bin/flash_mmc.scr | 20 +++++--------------- .../colibri-imx6/colibri-imx6_bin/flash_blk.img | Bin 0 -> 1732 bytes .../colibri-imx6/colibri-imx6_bin/flash_blk.scr | 17 +++++++++++++++++ .../colibri-imx6/colibri-imx6_bin/flash_eth.img | Bin 1614 -> 1614 bytes .../colibri-imx6/colibri-imx6_bin/flash_mmc.img | Bin 1622 -> 163 bytes .../colibri-imx6/colibri-imx6_bin/flash_mmc.scr | 18 +++++------------- 10 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.img create mode 100644 recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr create mode 100644 recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.img create mode 100644 recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.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 new file mode 100644 index 0000000..d2f5ce4 Binary files /dev/null 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 new file mode 100644 index 0000000..7d431aa --- /dev/null +++ b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr @@ -0,0 +1,19 @@ +test -n ${interface} || setenv interface mmc +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 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 '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}' +#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 50818f9..9cfac8f 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_mmc.img b/recipes/images/files/apalis-imx6/apalis-imx6_bin/flash_mmc.img index d78d920..305ee8b 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 e144905..207c7db 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 @@ -1,16 +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 -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 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" or "run update_it" to update the entire module' + +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 new file mode 100644 index 0000000..7e2cde2 Binary files /dev/null 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 new file mode 100644 index 0000000..a3713a6 --- /dev/null +++ b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr @@ -0,0 +1,17 @@ +test -n ${interface} || setenv interface mmc +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 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 '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}' +#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 2a2719f..1c59d15 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_mmc.img b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.img index c11c023..5be627e 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-imx6/colibri-imx6_bin/flash_mmc.scr b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.scr index 81e0d2b..207c7db 100644 --- a/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.scr +++ b/recipes/images/files/colibri-imx6/colibri-imx6_bin/flash_mmc.scr @@ -1,14 +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 -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 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}; patch_ddr_size' -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_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 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' + +fatload ${interface} ${drive}:1 ${loadaddr} flash_blk.img +source ${loadaddr} -- cgit v1.2.3