summaryrefslogtreecommitdiff
path: root/recipes-images
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2016-11-16 16:03:42 +0100
committerStefan Agner <stefan.agner@toradex.com>2017-01-10 16:01:49 -0800
commit823b590ba9a28352a5544949358cfe657102612e (patch)
tree03f03752ee2f337523b4c8ce7f7e120b56a8f29a /recipes-images
parenta034b8148b9f4b38d423cc4bab9ffbf080811714 (diff)
mx6: update scripts: change to use SPL
This changes the update scripts for a system which boots an SPL into static RAM which configures the DDR RAM, loads U-Boot proper into DDR and passes execution to U-Boot. The SPL is only written by the explicit update_spl command or when the script does not find a valid U-Boot in eMMC. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
Diffstat (limited to 'recipes-images')
l---------[-rw-r--r--]recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr46
l---------[-rw-r--r--]recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr47
l---------[-rw-r--r--]recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr42
l---------[-rw-r--r--]recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr43
-rw-r--r--recipes-images/images/files/library/imx6/flash_blk.scr48
-rw-r--r--recipes-images/images/files/library/imx6/flash_eth.scr50
-rwxr-xr-xrecipes-images/images/files/library/imx6/update.sh18
7 files changed, 110 insertions, 184 deletions
diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr
index 398c4de..e980bc6 100644..120000
--- a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr
+++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr
@@ -1,45 +1 @@
-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 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; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3'
-
-setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv migrate_uboot_old 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}'
-setenv migrate_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
-
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
-
-setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1'
-setenv update_uboot_it 'setenv module_type -it; run update_uboot'
-
-setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
-
-setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
-
-setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
-setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/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; true'
-
-setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update"
-setenv echo_migrate-it echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_it\" to complete update"
-setenv migrate 'run migrate_configblock; run update_latest; reset'
-setenv migrate_it 'setenv module_type -it; run migrate'
-setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate${module_type}'
-setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate${module_type}'
-
-setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3'
-setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3'
-setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1'
-setenv update_it 'setenv module_type -it; run update'
-
-echo 'enter "run update" or "run update_it" to update the entire module'
+../../library/imx6/flash_blk.scr \ No newline at end of file
diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr
index 2f64288..18c02a9 100644..120000
--- a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr
+++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr
@@ -1,46 +1 @@
-setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
-#workaround U-Boot counting in hex and split did in decimal
-setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
-setenv set_nextnum 'run incr_decimal; 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; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3'
-
-setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv migrate_uboot_old 'tftpboot ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}'
-setenv migrate_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
-
-setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
-
-setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1'
-setenv update_uboot_it 'setenv module_type -it; run update_uboot'
-
-setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
-
-setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
-
-setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
-setenv update_2 'tftpboot ${loadaddr} ${board_name}/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 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3-
-setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done; true'
-
-setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update"
-setenv echo_migrate-it echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_it\" to complete update"
-setenv migrate 'run migrate_configblock; run update_latest; reset'
-setenv migrate_it 'setenv module_type -it; run migrate'
-setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate${module_type}'
-setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate${module_type}'
-
-setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3'
-setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3'
-setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1'
-setenv update_it 'setenv module_type -it; run update'
-
-echo 'enter "run update" or "run update_it" to update the entire module'
+../../library/imx6/flash_eth.scr \ No newline at end of file
diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr
index 23c5b72..e980bc6 100644..120000
--- a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr
+++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr
@@ -1,41 +1 @@
-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 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; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3'
-
-setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv migrate_uboot_old 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}; patch_ddr_size'
-setenv migrate_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
-
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
-
-setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1'
-
-setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
-
-setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
-
-setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
-setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/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; true'
-
-setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update"
-setenv migrate 'run migrate_configblock; run update_latest; reset'
-setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate'
-setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate'
-
-setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3'
-setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3'
-setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1'
-
-echo 'enter "run update" to update the entire module'
+../../library/imx6/flash_blk.scr \ No newline at end of file
diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr
index 14f4104..18c02a9 100644..120000
--- a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr
+++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr
@@ -1,42 +1 @@
-setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
-#workaround U-Boot counting in hex and split did in decimal
-setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
-setenv set_nextnum 'run incr_decimal; 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; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3'
-
-setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv migrate_uboot_old 'tftpboot ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}; patch_ddr_size'
-setenv migrate_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
-
-setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
-
-setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1'
-
-setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
-
-setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
-
-setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
-
-setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
-setenv update_2 'tftpboot ${loadaddr} ${board_name}/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 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3-
-setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done; true'
-
-setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update"
-setenv migrate 'run migrate_configblock; run update_latest; reset'
-setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate'
-setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate'
-
-setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3'
-setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3'
-setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1'
-
-echo 'enter "run update" to update the entire module'
+../../library/imx6/flash_eth.scr \ No newline at end of file
diff --git a/recipes-images/images/files/library/imx6/flash_blk.scr b/recipes-images/images/files/library/imx6/flash_blk.scr
new file mode 100644
index 0000000..c87a2cc
--- /dev/null
+++ b/recipes-images/images/files/library/imx6/flash_blk.scr
@@ -0,0 +1,48 @@
+test -n ${interface} || setenv interface mmc
+test -n ${drive} || setenv drive 1
+setenv uboot_hwpart 1
+
+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; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3'
+
+setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
+
+setenv migrate_uboot_old 'setenv uboot_hwpart 0; run update_spl && run update_uboot_bin; setenv uboot_hwpart 1'
+setenv migrate_uboot 'run update_spl && run update_uboot_bin && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
+
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+
+setenv update_spl 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/SPL && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 2 ${blkcnt}'
+setenv update_uboot_bin 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx-spl && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 8a ${blkcnt}'
+setenv update_uboot 'run update_uboot_bin && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1'
+
+setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
+
+setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
+
+setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
+
+setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
+setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/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; true'
+
+setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update"
+setenv migrate 'run migrate_configblock; run update_latest; reset'
+setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate'
+setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate'
+
+# Not migrated to SPL if no U-Boot Image Magic Number at 69k into the eMMC
+setenv update_to_spl 'mmc dev 0 1; mmc read $loadaddr 8a 1; itest.l *12000000 -ne 56190527 && run update_spl'
+setenv update_latest 'run update_to_spl; run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3'
+# 'updt_fuse' not available in V2.5 Beta 3 and earlier, migration needed
+setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3'
+# 'mmc bootbus' not available in in V2.4 Beta 1 and earlier, migration needed
+setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1'
+
+echo 'enter "run update" to update the entire module'
diff --git a/recipes-images/images/files/library/imx6/flash_eth.scr b/recipes-images/images/files/library/imx6/flash_eth.scr
new file mode 100644
index 0000000..281bf5b
--- /dev/null
+++ b/recipes-images/images/files/library/imx6/flash_eth.scr
@@ -0,0 +1,50 @@
+setenv uboot_hwpart 1
+
+setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
+#workaround U-Boot counting in hex and split did in decimal
+setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
+setenv set_nextnum 'run incr_decimal; 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; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3'
+
+setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
+
+setenv migrate_uboot_old 'setenv uboot_hwpart 0; run update_spl && run update_uboot_bin; setenv uboot_hwpart 1'
+setenv migrate_uboot 'run update_spl && run update_uboot_bin && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
+
+setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+
+setenv update_spl 'tftpboot ${loadaddr} ${board_name}/SPL && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 2 ${blkcnt}'
+setenv update_uboot_bin 'tftpboot ${loadaddr} ${board_name}/u-boot.imx-spl && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 8a ${blkcnt}'
+setenv update_uboot 'run update_uboot_bin && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1'
+
+setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
+
+setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
+
+setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
+
+setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
+setenv update_2 'tftpboot ${loadaddr} ${board_name}/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 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3-
+setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done; true'
+
+setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update"
+setenv migrate 'run migrate_configblock; run update_latest; reset'
+setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate'
+setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate'
+
+# Not migrated to SPL if no U-Boot Image Magic Number at 69k into the eMMC
+setenv update_to_spl 'mmc dev 0 1; mmc read $loadaddr 8a 1; itest.l *12000000 -ne 56190527 && run update_spl'
+setenv update_latest 'run update_to_spl; run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3'
+# 'updt_fuse' not available in V2.5 Beta 3 and earlier, migration needed
+setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3'
+# 'mmc bootbus' not available in in V2.4 Beta 1 and earlier, migration needed
+setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1'
+
+echo 'enter "run update" to update the entire module'
diff --git a/recipes-images/images/files/library/imx6/update.sh b/recipes-images/images/files/library/imx6/update.sh
index 230e678..a7f1a1b 100755
--- a/recipes-images/images/files/library/imx6/update.sh
+++ b/recipes-images/images/files/library/imx6/update.sh
@@ -64,6 +64,9 @@ OUT_DIR=""
ROOTFSPATH=rootfs
SPLIT=0
UBOOT_RECOVERY=0
+U_BOOT_BINARY=u-boot.imx-spl
+U_BOOT_RECOVER_BINARY=u-boot.imx
+SPL_BINARY=SPL
while getopts "cdfhm:o:" Option ; do
case $Option in
@@ -138,8 +141,6 @@ case "$MODTYPE" in
imx6q-apalis-ixora.dtb imx6q-apalis_v1_0-ixora.dtb "
LOCPATH="imx_flash"
OUT_DIR="$OUT_DIR/apalis_imx6"
- U_BOOT_BINARY=u-boot.imx
- U_BOOT_BINARY_IT=u-boot.imx-it
;;
"colibri-imx6")
# assumed minimal eMMC size [in sectors of 512]
@@ -148,8 +149,6 @@ case "$MODTYPE" in
KERNEL_DEVICETREE="imx6dl-colibri-eval-v3.dtb imx6dl-colibri-cam-eval-v3.dtb"
LOCPATH="imx_flash"
OUT_DIR="$OUT_DIR/colibri_imx6"
- U_BOOT_BINARY=u-boot.imx
- U_BOOT_BINARY_IT=u-boot.imx
;;
*) echo "script internal error, unknown module type set"
exit 1
@@ -162,7 +161,7 @@ BINARIES=${MODTYPE}_bin
if [ "$UBOOT_RECOVERY" -ge 1 ] ; then
cd ${LOCPATH}
#the IT timings work for all modules, so use it during recovery
- sudo ./imx_usb ../${BINARIES}/${U_BOOT_BINARY_IT}
+ sudo ./imx_usb ../${BINARIES}/${U_BOOT_RECOVER_BINARY}
exit
fi
@@ -182,7 +181,7 @@ fi
#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}/${SPL_BINARY} ] || { echo "${BINARIES}/${SPL_BINARY} does not exist"; exit 1; }
[ -e ${BINARIES}/${KERNEL_IMAGETYPE} ] || { echo "${BINARIES}/${KERNEL_IMAGETYPE} does not exist"; exit 1; }
#Sanity check for some programs. Some distros have fs tools only in root's path
@@ -204,7 +203,7 @@ sudo touch ${BINARIES}/versions.txt
sudo chmod ugo+w ${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}/${SPL_BINARY}`" >> ${BINARIES}/versions.txt
basename "`readlink -e ${BINARIES}/${KERNEL_IMAGETYPE}`" >> ${BINARIES}/versions.txt
ROOTFSVERSION=`grep -i imx6 rootfs/etc/issue || echo "Version Unknown"`
echo "Rootfs ${ROOTFSVERSION}" >> ${BINARIES}/versions.txt
@@ -302,9 +301,8 @@ sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} ||
#copy to $OUT_DIR
-sudo cp ${BINARIES}/${U_BOOT_BINARY} ${BINARIES}/${KERNEL_IMAGETYPE} ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat \
- ${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR"
-[ "${U_BOOT_BINARY}x" != "${U_BOOT_BINARY_IT}x" ] && sudo cp ${BINARIES}/${U_BOOT_BINARY_IT} "$OUT_DIR"
+sudo cp ${BINARIES}/${U_BOOT_BINARY} ${BINARIES}/${SPL_BINARY} ${BINARIES}/${KERNEL_IMAGETYPE} ${BINARIES}/mbr.bin \
+ ${BINARIES}/boot.vfat ${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR"
sudo cp ${BINARIES}/fwd_blk.img "$OUT_DIR/../flash_blk.img"
sudo cp ${BINARIES}/fwd_eth.img "$OUT_DIR/../flash_eth.img"
sudo cp ${BINARIES}/fwd_mmc.img "$OUT_DIR/../flash_mmc.img"