But as described in Linux - Booting | Toradex Developer Center this copies the Toradex factory configuration block too. How can I restrict this copy to U-Boot imx and U-Boot vars?
The config block is stored in the last block of mmcblk0boot0. The size of mmcblk0boot0 depends on the stuffed eMMC and might change in future revisions.
So one could:
root@colibri-imx6:~# cat /sys/class/block/mmcblk0boot0/size
4096
root@colibri-imx6:~# dd if=/dev/mmcblk0boot0 of=/boot.img count=4095
4095+0 records in
4095+0 records out
root@colibri-imx6:~# ls -l /boot.img
-rw-r--r-- 1 root root 2096640 Dec 1 09:29 boot.img
...
root@colibri-imx6:~# echo 0 > /sys/block/mmcblk0boot0/force_ro
root@colibri-imx6:~# dd if=/boot.img of=/dev/mmcblk0boot0
4095+0 records in
4095+0 records out
P.S. Probably a better solution would be to copy only the U-Boot environment from the module and use your original u-boot.imx binary for U-Boot.
root@colibri-imx6:~# dd if=/dev/mmcblk0boot0 of=/env.img count=16 skip=4079
16+0 records in
16+0 records out
...
root@colibri-imx6:~# echo 0 > /sys/block/mmcblk0boot0/force_ro
root@colibri-imx6:~# dd if=/u-boot.imx of=/dev/mmcblk0boot0 seek=2
614+0 records in
614+0 records out
root@colibri-imx6:~# dd if=/env.img of=/dev/mmcblk0boot0 seek=4079
16+0 records in
16+0 records out
P.P.S: We are currently working on using U-Boot with SPL.
The SPL binary would then start at 0x400 while u-boot.img would then start at 0x11400.