summaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-05-01 15:42:46 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2015-05-12 10:04:36 +0200
commit43e466f7ace70169fdef4d94f23ba3264d8f07aa (patch)
tree26a8b3bbb98a0e24889bb13a741e00e4e5ea6031 /recipes
parent3a7f3cacecb6e12f5fd118ad862a23485e9a8ddb (diff)
apalis/colibri_t20/t30: integrate latest stuff
Diffstat (limited to 'recipes')
-rw-r--r--recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img (renamed from recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img)bin3514 -> 3661 bytes
-rw-r--r--recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr (renamed from recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.scr)23
-rw-r--r--recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.imgbin3434 -> 3398 bytes
-rw-r--r--recipes/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr4
l---------recipes/images/files/apalis-t30/update.sh2
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.bctbin0 -> 4080 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.img.cfg22
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.bctbin0 -> 4080 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.img.cfg22
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.bctbin0 -> 4080 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.img.cfg22
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.bctbin0 -> 4080 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.img.cfg22
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.bctbin0 -> 4080 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.img.cfg22
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.bctbin0 -> 4080 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.img.cfg22
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.imgbin0 -> 848 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr11
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.imgbin0 -> 728 bytes
-rw-r--r--recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.scr8
l---------[-rwxr-xr-x]recipes/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh6
l---------recipes/images/files/colibri-t20/tegra-uboot-flasher/genext3fs.sh (renamed from recipes/images/files/colibri-t20/t20_nvflash/genext3fs.sh)0
l---------recipes/images/files/colibri-t20/update.sh1
-rw-r--r--recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img (renamed from recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img)bin3515 -> 3662 bytes
-rw-r--r--recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr (renamed from recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.scr)23
-rw-r--r--recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.imgbin3435 -> 3399 bytes
-rw-r--r--recipes/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr4
l---------recipes/images/files/colibri-t30/update.sh2
-rwxr-xr-xrecipes/images/files/colibri-vf/update.sh2
-rwxr-xr-xrecipes/images/files/library/mk-u-boot-scripts.sh2
-rwxr-xr-xrecipes/images/files/library/t30/update.sh278
-rwxr-xr-xrecipes/images/files/library/tegra/update.sh397
-rw-r--r--recipes/images/trdx-extra.inc29
-rw-r--r--recipes/images/trdx-image-fstype.inc25
35 files changed, 614 insertions, 335 deletions
diff --git a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img
index f406b54..4cb856d 100644
--- a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.img
+++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.img
Binary files 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_blk.scr
index b33c594..2c72480 100644
--- a/recipes/images/files/apalis-t30/apalis-t30_bin/flash_mmc.scr
+++ b/recipes/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr
@@ -1,9 +1,10 @@
test -n ${drive} || setenv drive 1
+test -n ${interface} || setenv interface mmc
-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 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 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'
@@ -13,17 +14,17 @@ 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 'load mmc ${drive}:1 ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && run check_configblock; mmc write $loadaddr $conf_blk_offset ${blkcnt}'
+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 update_uboot 'fatload mmc ${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 '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_kernel 'load mmc ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
+setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
-setenv update_fdt 'load mmc ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
+setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
-setenv update_1 'load mmc ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
-setenv update_2 'load mmc ${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 mmc ${drive}:1 ${loadaddr} root.ext3 && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0xa000 ${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 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 0c4b63f..3f4c2f1 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
Binary files 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 100629e..520c05e 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,5 +1,3 @@
-test -n ${drive} || setenv drive 1
-
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'
@@ -13,7 +11,7 @@ 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 'tftpboot ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && run check_configblock; mmc write $loadaddr $conf_blk_offset ${blkcnt}'
+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 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}'
diff --git a/recipes/images/files/apalis-t30/update.sh b/recipes/images/files/apalis-t30/update.sh
index fb897ec..6ebea84 120000
--- a/recipes/images/files/apalis-t30/update.sh
+++ b/recipes/images/files/apalis-t30/update.sh
@@ -1 +1 @@
-../library/t30/update.sh \ No newline at end of file
+../library/tegra/update.sh \ No newline at end of file
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.bct b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.bct
new file mode 100644
index 0000000..bcef8b1
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.bct
Binary files differ
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.img.cfg b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.img.cfg
new file mode 100644
index 0000000..6fc664d
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.img.cfg
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Toradex, Inc.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+
+Version = 0x00020001;
+Bctcopy = 1;
+Bctfile = colibri_t20-256-hsmmc.bct;
+BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete;
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.bct b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.bct
new file mode 100644
index 0000000..7ddd5d8
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.bct
Binary files differ
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.img.cfg b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.img.cfg
new file mode 100644
index 0000000..3ce017e
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.img.cfg
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Toradex, Inc.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+
+Version = 0x00020001;
+Bctcopy = 1;
+Bctfile = colibri_t20-256-v11-nand.bct;
+BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete;
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.bct b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.bct
new file mode 100644
index 0000000..365877f
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.bct
Binary files differ
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.img.cfg b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.img.cfg
new file mode 100644
index 0000000..41ed535
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.img.cfg
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Toradex, Inc.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+
+Version = 0x00020001;
+Bctcopy = 1;
+Bctfile = colibri_t20-256-v12-nand.bct;
+BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete;
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.bct b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.bct
new file mode 100644
index 0000000..09eb434
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.bct
Binary files differ
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.img.cfg b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.img.cfg
new file mode 100644
index 0000000..60760fc
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.img.cfg
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Toradex, Inc.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+
+Version = 0x00020001;
+Bctcopy = 1;
+Bctfile = colibri_t20-512-hsmmc.bct;
+BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete;
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.bct b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.bct
new file mode 100644
index 0000000..5d68994
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.bct
Binary files differ
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.img.cfg b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.img.cfg
new file mode 100644
index 0000000..992f47a
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.img.cfg
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Toradex, Inc.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+
+Version = 0x00020001;
+Bctcopy = 1;
+Bctfile = colibri_t20-512-v11-nand.bct;
+BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete;
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.bct b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.bct
new file mode 100644
index 0000000..f9db8fc
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.bct
Binary files differ
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.img.cfg b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.img.cfg
new file mode 100644
index 0000000..cb96289
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.img.cfg
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Toradex, Inc.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+# 3. This notice may not be removed or altered from any source distribution.
+
+Version = 0x00020001;
+Bctcopy = 1;
+Bctfile = colibri_t20-512-v12-nand.bct;
+BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete;
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
new file mode 100644
index 0000000..91246e1
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.img
Binary files 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
new file mode 100644
index 0000000..6ed07dc
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr
@@ -0,0 +1,11 @@
+test -n ${drive} || setenv drive 1
+test -n ${interface} || setenv interface mmc
+
+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}'
+setenv update_uboot 'load ${interface} 0:1 ${loadaddr} colibri_t20-${ram-size}-${hw-version}-nand.img && nand erase.part u-boot && nand erase.part u-boot-env && nand write ${loadaddr} u-boot ${filesize}'
+setenv update_rootfs 'load ${interface} 0:1 ${loadaddr} ubifs_${leb-size}.img && run prepare_rootfs && ubi write ${loadaddr} rootfs ${filesize}'
+
+setenv update 'run update_uboot; run update_rootfs; reset'
+
+echo 'enter "run update" to update the entire module'
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
new file mode 100644
index 0000000..8ad27ab
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.img
Binary files differ
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.scr b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.scr
new file mode 100644
index 0000000..7c9ad4a
--- /dev/null
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/flash_eth.scr
@@ -0,0 +1,8 @@
+setenv prepare_rootfs 'ubi part ubi && ubi check rootfs || ubi create rootfs'
+setenv update_configblock 'tftpboot ${loadaddr} configblock.bin && nand erase.part cfgblock && nand write ${loadaddr} cfgblock ${filesize}'
+setenv update_uboot 'tftpboot ${loadaddr} colibri_t20-${ram-size}-${hw-version}-nand.img && nand erase.part u-boot && nand erase.part u-boot-env && nand write ${loadaddr} u-boot ${filesize}'
+setenv update_rootfs 'tftpboot ${loadaddr} ubifs_${leb-size}.img && run prepare_rootfs && ubi write ${loadaddr} rootfs ${filesize}'
+
+setenv update 'run update_uboot; run update_rootfs; reset'
+
+echo 'enter "run update" to update the entire module'
diff --git a/recipes/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh b/recipes/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh
index 2a4e898..ce71dbd 100755..120000
--- a/recipes/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh
+++ b/recipes/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh
@@ -1,5 +1 @@
-#!/bin/sh
-for f in *.scr
-do
- mkimage -T script -C none -n 'Flash Apalis iMX6' -d $f `basename $f .scr`.img
-done
+../../library/mk-u-boot-scripts.sh \ No newline at end of file
diff --git a/recipes/images/files/colibri-t20/t20_nvflash/genext3fs.sh b/recipes/images/files/colibri-t20/tegra-uboot-flasher/genext3fs.sh
index cc716db..cc716db 120000
--- a/recipes/images/files/colibri-t20/t20_nvflash/genext3fs.sh
+++ b/recipes/images/files/colibri-t20/tegra-uboot-flasher/genext3fs.sh
diff --git a/recipes/images/files/colibri-t20/update.sh b/recipes/images/files/colibri-t20/update.sh
new file mode 120000
index 0000000..6ebea84
--- /dev/null
+++ b/recipes/images/files/colibri-t20/update.sh
@@ -0,0 +1 @@
+../library/tegra/update.sh \ No newline at end of file
diff --git a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img
index 191d157..ce5f26c 100644
--- a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.img
+++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.img
Binary files 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_blk.scr
index 024a3b8..2aa843a 100644
--- a/recipes/images/files/colibri-t30/colibri-t30_bin/flash_mmc.scr
+++ b/recipes/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr
@@ -1,9 +1,10 @@
test -n ${drive} || setenv drive 1
+test -n ${interface} || setenv interface mmc
-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 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 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'
@@ -13,17 +14,17 @@ 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 'load mmc ${drive}:1 ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && run check_configblock; mmc write $loadaddr $conf_blk_offset ${blkcnt}'
+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 update_uboot 'fatload mmc ${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 '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_kernel 'load mmc ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
+setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}'
-setenv update_fdt 'load mmc ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
+setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}'
-setenv update_1 'load mmc ${drive}:1 ${loadaddr} mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
-setenv update_2 'load mmc ${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 mmc ${drive}:1 ${loadaddr} root.ext3 && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 0 && mmc write ${loadaddr} 0xa000 ${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 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 0715856..139d4d3 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
Binary files 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 df18194..05dffa4 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,5 +1,3 @@
-test -n ${drive} || setenv drive 1
-
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'
@@ -13,7 +11,7 @@ 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 'tftpboot ${loadaddr} configblock.bin && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && run check_configblock; mmc write $loadaddr $conf_blk_offset ${blkcnt}'
+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 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}'
diff --git a/recipes/images/files/colibri-t30/update.sh b/recipes/images/files/colibri-t30/update.sh
index fb897ec..6ebea84 120000
--- a/recipes/images/files/colibri-t30/update.sh
+++ b/recipes/images/files/colibri-t30/update.sh
@@ -1 +1 @@
-../library/t30/update.sh \ No newline at end of file
+../library/tegra/update.sh \ No newline at end of file
diff --git a/recipes/images/files/colibri-vf/update.sh b/recipes/images/files/colibri-vf/update.sh
index 1eea0b4..78dc852 100755
--- a/recipes/images/files/colibri-vf/update.sh
+++ b/recipes/images/files/colibri-vf/update.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Prepare files needed for flashing a Colbiri VFxx module
+# Prepare files needed for flashing a Colibri VFxx module
# and copy them into a convenient location for use from a running U-Boot
set -e
diff --git a/recipes/images/files/library/mk-u-boot-scripts.sh b/recipes/images/files/library/mk-u-boot-scripts.sh
index 2a4e898..dda47d5 100755
--- a/recipes/images/files/library/mk-u-boot-scripts.sh
+++ b/recipes/images/files/library/mk-u-boot-scripts.sh
@@ -1,5 +1,5 @@
#!/bin/sh
for f in *.scr
do
- mkimage -T script -C none -n 'Flash Apalis iMX6' -d $f `basename $f .scr`.img
+ mkimage -T script -C none -n 'Flash Apalis/Colibri module' -d $f `basename $f .scr`.img
done
diff --git a/recipes/images/files/library/t30/update.sh b/recipes/images/files/library/t30/update.sh
deleted file mode 100755
index 010c835..0000000
--- a/recipes/images/files/library/t30/update.sh
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/bin/sh
-# Prepare files needed for flashing a Apalis/Colibri T30 module
-#
-# inspired by meta-fsl-arm/classes/image_types_fsl.bbclass
-
-# sometimes we need the binary echo, not the shell builtin
-ECHO=`which echo`
-#some distros have fs tools only in root's path
-PARTED=`which parted` 2> /dev/null
-if [ -e "$PARTED" ] ; then
- MKFSVFAT=`which mkfs.vfat`
-else
- PARTED=`sudo which parted`
- MKFSVFAT=`sudo which mkfs.vfat`
-fi
-
-Flash()
-{
- echo ""
- echo "To flash the Apalis/Colibri T30 module, boot the module to the U-Boot prompt and"
- echo ""
- echo "when using a SD-card, insert the SD-card and enter:"
- echo "run setupdate"
- echo ""
- echo "when using tftp, connect Ethernet and enter:"
- echo "tftp \$loadaddr flash_eth.img ; source \$loadaddr"
- echo ""
- echo "then enter to update all:"
- echo "run update"
- echo ""
- echo "to update a single component enter one of:"
- echo "run update_uboot"
- echo "run update_kernel"
- echo ""
- echo ""
- echo "If you don't have a working U-Boot anymore, connect your PC to the module's"
- echo "USB client port, bring the module in the serial download mode and start"
- echo "the update.sh script with the -d option. This will copy U-Boot into the"
- echo "modules RAM and execute it."
-}
-
-Usage()
-{
- echo ""
- echo "Prepares and copies files for flashing the internal eMMC of a Apalis/Colibri T30"
- echo ""
- echo "Will require a running U-Boot on the target. Either one already flashed"
- echo "on the eMMC or one copied over usb into the module's RAM"
- echo ""
- echo "-d : use USB connection to copy and execute U-Boot to the module's RAM"
- echo "-h : Prints this message"
- echo "-o directory : output directory"
- echo ""
- echo "Example \"./update.sh\" copies the requiered files to /media/KERNEL/"
- echo "Example \"./update.sh -o /srv/tftp/\" copies the requiered files to /srv/tftp/"
- echo ""
- echo ""
- Flash
-}
-
-#initialise options
-UBOOT_RECOVERY=0
-OUT_DIR="/media/KERNEL"
-MIN_PARTITION_FREE_SIZE=100
-ROOTFSPATH=rootfs
-# No devicetree by default
-KERNEL_DEVICETREE=""
-KERNEL_IMAGETYPE="uImage"
-
-while getopts "dho:" Option ; do
- case $Option in
- d) UBOOT_RECOVERY=1
- ;;
- h) Usage
- # Exit if only usage (-h) was specfied.
- if [ "$#" -eq 1 ] ; then
- exit 10
- fi
- exit 0
- ;;
- o) OUT_DIR=$OPTARG
- ;;
- esac
-done
-
-if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then
- Usage
- exit 0
-fi
-
-# auto detect MODTYPE from rootfs directory
-CNT=`grep -ic "t30" rootfs/etc/issue || true`
-if [ "$CNT" -ge 1 ] ; then
- CNT=`grep -ic "apalis" rootfs/etc/issue || true`
- if [ "$CNT" -ge 1 ] ; then
- echo "Apalis T30 rootfs detected"
- MODTYPE=apalis-t30
- IMAGEFILE=root.ext3
- U_BOOT_BINARY=u-boot-dtb-tegra.bin
- KERNEL_DEVICETREE="tegra30-apalis-eval.dtb"
- LOCPATH="tegra-uboot-flasher"
- # eMMC size [in sectors of 512]
- EMMC_SIZE=$(expr 1024 \* 3500 \* 2)
- BCT=apalis_t30_12MHz_MT41K512M8RH-125_533MHz.bct
- CBOOT_IMAGE=apalis_t30.img
- else
- echo "Colibri T30 rootfs detected"
- MODTYPE=colibri-t30
- IMAGEFILE=root.ext3
- U_BOOT_BINARY=u-boot-dtb-tegra.bin
- KERNEL_DEVICETREE="tegra30-colibri-eval-v3.dtb"
- LOCPATH="tegra-uboot-flasher"
- EMMC_SIZE=$(expr 1024 \* 2000 \* 2)
- # with new kernel, boot with 400MHz, then switch between 400 & 800
- BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct
-# BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_533MHz.bct
- CBOOT_IMAGE=colibri_t30.img
- fi
-else
- echo "can not detect module type from ./rootfs/etc/issue"
- echo "exiting"
- exit 1
-fi
-BINARIES=${MODTYPE}_bin
-
-#is only U-Boot to be copied to RAM?
-if [ "$UBOOT_RECOVERY" -ge 1 ] ; then
- cd ${LOCPATH}
- sudo ./tegrarcm --bct=../${BINARIES}/${BCT} --bootloader=../${BINARIES}/${U_BOOT_BINARY} --loadaddr=0x80108000
- exit 1
-fi
-
-# is OUT_DIR an existing directory?
-if [ ! -d "$OUT_DIR" ] ; then
- echo "$OUT_DIR" "does not exist, exiting"
- exit 1
-fi
-
-#sanity check for correct untared rootfs
-DEV_OWNER=`ls -ld rootfs/dev | awk '{print $3}'`
-if [ "${DEV_OWNER}x" != "rootx" ]
-then
- $ECHO -e "rootfs/dev is not owned by root, but it should!"
- $ECHO -e "\033[1mPlease unpack the tarball with root rights.\033[0m"
- $ECHO -e "e.g. sudo tar xjvf Apalis_T30_LinuxImageV2.1_20140201.tar.bz2"
- exit 1
-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}/uImage ] || { echo "${BINARIES}/uImage does not exist"; exit 1; }
-
-#sanity check for some programs
-MCOPY=`sudo which mcopy`
-[ "${MCOPY}x" != "x" ] || { echo >&2 "Program mcopy not available. Aborting."; exit 1; }
-sudo ${PARTED} -v >/dev/null 2>&1 || { echo >&2 "Program parted not available. Aborting."; exit 1; }
-[ "${MKFSVFAT}x" != "x" ] || { echo >&2 "Program mkfs.vfat not available. Aborting."; exit 1; }
-MKFSEXT3=`sudo which mkfs.ext3`
-[ "${MKFSEXT3}x" != "x" ] || { echo >&2 "Program mkfs.ext3 not available. Aborting."; exit 1; }
-awk -V >/dev/null 2>&1 || { echo >&2 "Program awk not available. Aborting."; exit 1; }
-dd --help >/dev/null 2>&1 || { echo >&2 "Program dd not available. Aborting."; exit 1; }
-tegra-uboot-flasher/cbootimage -h >/dev/null 2>&1
-[ "$?" -lt 2 ] || { echo >&2 "Program cbootimage not available. 32bit compatibility libs? Aborting."; exit 1; }
-
-#make the directory with the outputfiles writable
-sudo chown $USER: ${BINARIES}
-
-#make a file with the used versions for U-Boot, kernel and rootfs
-rm ${BINARIES}/versions.txt
-touch ${BINARIES}/versions.txt
-echo "Component Versions" > ${BINARIES}/versions.txt
-basename "`readlink -e ${BINARIES}/${U_BOOT_BINARY}`" >> ${BINARIES}/versions.txt
-basename "`readlink -e ${BINARIES}/uImage`" >> ${BINARIES}/versions.txt
-$ECHO -n "Rootfs " >> ${BINARIES}/versions.txt
-grep -i t30 rootfs/etc/issue >> ${BINARIES}/versions.txt
-
-
-# The emmc layout used is:
-#
-# boot area partition 1 aka eMMC boot sector:
-#
-# with cbootimage containing BCT and U-Boot boot loader
-#
-# user area aka general purpose eMMC region:
-#
-# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved to bootloader (not partitioned)
-# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - kernel and other data
-# BOOT_SPACE -> SDIMG_SIZE - rootfs
-#
-# Default Free space = 1.3x
-# Use IMAGE_OVERHEAD_FACTOR to add more space
-# <--------->
-# 4MiB 16MiB SDIMG_ROOTFS 4MiB
-# <-----------------------> <----------> <----------------------> <------------------------------>
-# ------------------------ ------------ ------------------------ -------------------------------
-# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE | IMAGE_ROOTFS_ALIGNMENT |
-# ------------------------ ------------ ------------------------ -------------------------------
-# ^ ^ ^ ^ ^
-# | | | | |
-# 0 4096 4MiB + 16MiB 4MiB + 16Mib + SDIMG_ROOTFS 4MiB + 16MiB + SDIMG_ROOTFS + 4MiB
-#
-# with the U-Boot environment at 512 * 1024, the config block is at 640 * 1024
-
-
-# generate cbootimage containing BCT and U-Boot boot loader
-cd ${BINARIES}
-sudo ../${LOCPATH}/cbootimage -s tegra30 ${CBOOT_IMAGE}.cfg ${CBOOT_IMAGE}
-cd ..
-
-
-# Boot partition [in sectors of 512]
-BOOT_START=$(expr 4096 \* 2)
-# Rootfs partition [in sectors of 512]
-ROOTFS_START=$(expr 20480 \* 2)
-# Boot partition volume id
-BOOTDD_VOLUME_ID="Boot"
-
-#make the partition size size(rootfs used + MIN_PARTITION_FREE_SIZE)
-#add about 4% to the rootfs to account for fs overhead. (/1024/985 instead of /1024/1024).
-#add 512 bytes per file to account for small files
-NUMBER_OF_FILES=`sudo find ${ROOTFSPATH} | wc -l`
-EXT_SIZE=`sudo du -DsB1 ${ROOTFSPATH} | awk -v min=$MIN_PARTITION_FREE_SIZE -v f=${NUMBER_OF_FILES} \
- '{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'`
-
-echo ""
-echo "Creating MBR file and do the partitioning"
-# Initialize a sparse file
-dd if=/dev/zero of=${BINARIES}/mbr.bin bs=512 count=0 seek=${EMMC_SIZE}
-${PARTED} -s ${BINARIES}/mbr.bin mklabel msdos
-${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary fat32 ${BOOT_START} $(expr ${ROOTFS_START} - 1 )
-# the partition spans to the end of the disk, even though the fs size will be smaller
-# on the target the fs is then grown to the full size
-${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary ext2 ${ROOTFS_START} $(expr ${EMMC_SIZE} \- ${ROOTFS_START} \- 1)
-${PARTED} -s ${BINARIES}/mbr.bin unit s print
-# get the size of the VFAT partition
-BOOT_BLOCKS=$(LC_ALL=C ${PARTED} -s ${BINARIES}/mbr.bin unit b print \
- | awk '/ 1 / { print int(substr($4, 1, length($4 -1)) / 1024) }')
-# now crop the file to only the MBR size
-IMG_SIZE=512
-truncate -s $IMG_SIZE ${BINARIES}/mbr.bin
-
-
-echo ""
-echo "Creating VFAT partion image with the kernel"
-rm -f ${BINARIES}/boot.vfat
-${MKFSVFAT} -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${BINARIES}/boot.vfat $BOOT_BLOCKS
-export MTOOLS_SKIP_CHECK=1
-mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/uImage ::/uImage
-
-# Copy device tree file
-COPIED=false
-if test -n "${KERNEL_DEVICETREE}"; then
- for DTS_FILE in ${KERNEL_DEVICETREE}; do
- DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
- if [ -e "${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then
- kernel_bin="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}`"
- kernel_bin_for_dtb="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb | sed "s,$DTS_BASE_NAME,${MODTYPE},g;s,\.dtb$,.bin,g"`"
- if [ "$kernel_bin" = "$kernel_bin_for_dtb" ]; then
- mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb
- #copy also to out_dir
- sudo cp ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb "$OUT_DIR/${DTS_BASE_NAME}.dtb"
- COPIED=true
- fi
- fi
- done
-fi
-
-echo ""
-echo "Creating rootfs partion image"
-rm -f ${BINARIES}/${IMAGEFILE}
-sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || exit 1
-
-
-#copy to $OUT_DIR
-sudo cp ${BINARIES}/configblock.bin ${BINARIES}/${CBOOT_IMAGE} ${BINARIES}/uImage ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat ${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR"
-sync
-
-Flash
diff --git a/recipes/images/files/library/tegra/update.sh b/recipes/images/files/library/tegra/update.sh
new file mode 100755
index 0000000..614af1a
--- /dev/null
+++ b/recipes/images/files/library/tegra/update.sh
@@ -0,0 +1,397 @@
+#!/bin/sh
+# Prepare files needed for flashing an Apalis/Colibri T20/T30 module and
+# copy them to a convenient location for using from a running U-Boot
+
+# sometimes we need the binary echo, not the shell builtin
+ECHO=`which echo`
+#some distros have fs tools only in root's path
+PARTED=`which parted` 2> /dev/null
+if [ -e "$PARTED" ] ; then
+ MKFSVFAT=`which mkfs.vfat`
+else
+ PARTED=`sudo which parted`
+ MKFSVFAT=`sudo which mkfs.vfat`
+fi
+
+Flash()
+{
+ echo ""
+ echo "To flash the Apalis/Colibri T20/T30 module, boot the module to the U-Boot prompt"
+ echo "and"
+ echo ""
+ echo "when using a SD card, insert the SD card and enter:"
+ echo "run setupdate"
+ echo ""
+ echo "when using tftp, connect Ethernet and enter:"
+ echo "tftp \$loadaddr flash_eth.img ; source \$loadaddr"
+ echo ""
+ echo "then enter to update all:"
+ echo "run update"
+ echo ""
+ echo "to update a single component enter one of:"
+ echo "run update_uboot"
+ echo "run update_kernel"
+ echo ""
+ echo ""
+ echo "If you don't have a working U-Boot anymore, connect your PC to the module's USB"
+ echo "client port, bring the module into the recovery mode and start the update.sh"
+ echo "script with the -d option. This will copy U-Boot into the module's RAM and"
+ echo "execute it."
+}
+
+Usage()
+{
+ echo ""
+ echo "Prepares and copies files for flashing the internal eMMC/NAND of an Apalis/"
+ echo "Colibri T20/T30"
+ echo ""
+ echo "Will require a running U-Boot on the target. Either one already flashed"
+ echo "on the eMMC/NAND or one copied over USB into the module's RAM"
+ echo ""
+ echo "-b : T20: selects boot device (hsmmc/nand) (default: nand)"
+ echo "-d : use USB recovery mode to copy/execute U-Boot to the module's RAM"
+ echo "-f : flash instructions"
+ echo "-h : prints this message"
+ echo "-o directory : output directory, if this is on a SD card, it should be the first"
+ echo " partition formated with VFAT"
+ echo "-r : T20 recovery mode: select RAM size (256 | 512)"
+ echo "-s : optimise file system for V1.1 or 256MB V1.2 modules, increases"
+ echo " usable space a little, but limits 512MB V1.2 modules to 512MB"
+ echo " usable NAND space"
+ echo "-v : T20 recovery mode: select Colibri version (V1_1 | V1_2)"
+ echo ""
+ echo "Example \"./update.sh -o /run/media/user/label\" copies files to SD card"
+ echo "Example \"./update.sh -o /srv/tftp/\" copies the requiered files to /srv/tftp/"
+ echo ""
+ echo "*** For detailed recovery/update procedures, refer to the Release Notes ***"
+ echo ""
+}
+
+# initialise options
+BOOT_DEVICE=nand
+EMMC_PARTS="mbr.bin boot.vfat"
+# no devicetree by default
+KERNEL_DEVICETREE=""
+KERNEL_IMAGETYPE="uImage"
+MIN_PARTITION_FREE_SIZE=100
+
+# NAND parameters
+BLOCK="248KiB 504KiB"
+MAXLEB=4084
+PAGE="4KiB"
+
+OUT_DIR=""
+ROOTFSPATH=rootfs
+UBOOT_RECOVERY=0
+
+# don't provide working defaults which may lead to wrong HW/SW combination
+MODVERSION=Add_Version_-v
+RAM_SIZE=Add_RAMsize_-r
+
+while getopts "b:dfho:r:sv:" Option ; do
+ case $Option in
+ b) BOOT_DEVICE=$OPTARG
+ ;;
+ d) UBOOT_RECOVERY=1
+ ;;
+ f) Flash
+ exit 0
+ ;;
+ h) Usage
+ # Exit if only usage (-h) was specified.
+ if [ "$#" -eq 1 ] ; then
+ exit 10
+ fi
+ exit 0
+ ;;
+ o) OUT_DIR=$OPTARG
+ ;;
+ r) RAM_SIZE=$OPTARG
+ ;;
+ s) MAXLEB=2042
+ ;;
+ v) if [ "${OPTARG}" = "V1_1" ] ; then MODVERSION=v11; fi
+ if [ "${OPTARG}" = "V1_2" ] ; then MODVERSION=v12; fi
+ ;;
+ esac
+done
+
+if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then
+ Usage
+ exit 0
+fi
+
+# auto detect MODTYPE from rootfs directory
+CNT=`grep -ic "apalis" rootfs/etc/issue || true`
+if [ "$CNT" -ge 1 ] ; then
+ CNT=`grep -ic "t30" rootfs/etc/issue || true`
+ if [ "$CNT" -ge 1 ] ; then
+ echo "Apalis T30 rootfs detected"
+ MODTYPE=apalis-t30
+ IMAGEFILE=root.ext3
+ U_BOOT_BINARY=u-boot-dtb-tegra.bin
+ KERNEL_DEVICETREE="tegra30-apalis-eval.dtb"
+ LOCPATH="tegra-uboot-flasher"
+ # eMMC size [in sectors of 512]
+ EMMC_SIZE=$(expr 1024 \* 7450 \* 2)
+ BCT=apalis_t30_12MHz_MT41K512M8RH-125_533MHz.bct
+ CBOOT_IMAGE=apalis_t30.img
+ CBOOT_IMAGE_TARGET=tegra30
+ else
+ echo "can not detect module type from ./rootfs/etc/issue"
+ echo "exiting"
+ exit 1
+ fi
+else
+ CNT=`grep -ic "colibri" rootfs/etc/issue || true`
+ if [ "$CNT" -ge 1 ] ; then
+ CNT=`grep -ic "t20" rootfs/etc/issue || true`
+ if [ "$CNT" -ge 1 ] ; then
+ echo "Colibri T20 rootfs detected"
+ MODTYPE=colibri-t20
+ IMAGEFILE=ubifs
+ U_BOOT_BINARY=u-boot-dtb-tegra.bin
+ KERNEL_DEVICETREE="tegra20-colibri-eval-v3.dtb"
+ LOCPATH="tegra-uboot-flasher"
+ BCT=colibri_t20-${RAM_SIZE}-${MODVERSION}-${BOOT_DEVICE}.bct
+ CBOOT_IMAGE="colibri_t20-256-v11-nand.img colibri_t20-256-v12-nand.img colibri_t20-512-v11-nand.img colibri_t20-512-v12-nand.img"
+ CBOOT_IMAGE_TARGET=tegra20
+ # zImage but from rootfs/boot
+ KERNEL_IMAGETYPE=""
+ EMMC_PARTS=""
+ else
+ CNT=`grep -ic "t30" rootfs/etc/issue || true`
+ if [ "$CNT" -ge 1 ] ; then
+ echo "Colibri T30 rootfs detected"
+ MODTYPE=colibri-t30
+ IMAGEFILE=root.ext3
+ U_BOOT_BINARY=u-boot-dtb-tegra.bin
+ KERNEL_DEVICETREE="tegra30-colibri-eval-v3.dtb"
+ LOCPATH="tegra-uboot-flasher"
+ EMMC_SIZE=$(expr 1024 \* 2000 \* 2)
+ # with new kernel, boot with 400MHz, then switch between 400 & 800
+ BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct
+# BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_533MHz.bct
+ CBOOT_IMAGE=colibri_t30.img
+ CBOOT_IMAGE_TARGET=tegra30
+ else
+ echo "can not detect module type from ./rootfs/etc/issue"
+ echo "exiting"
+ exit 1
+ fi
+ fi
+ else
+ echo "can not detect module type from ./rootfs/etc/issue"
+ echo "exiting"
+ exit 1
+ fi
+fi
+BINARIES=${MODTYPE}_bin
+
+#is only U-Boot to be copied to RAM?
+if [ "$UBOOT_RECOVERY" -eq 1 ] ; then
+ if [ "${MODTYPE}" = "colibri-t20" ] ; then
+ #some sanity test, we really need RAM_SIZE and MODVERSION set
+ echo ""
+ echo "256, 512" | grep -q ${RAM_SIZE}
+ if [ $? -eq 1 ] ; then
+ $ECHO -e "\033[1mplease specify your RAM size with the -r parameter\033[0m"
+ fi
+
+ echo "v11, v12" | grep -q ${MODVERSION}
+ if [ $? -eq 1 ] ; then
+ $ECHO -e "\033[1mplease specify your module version with the -v parameter\033[0m"
+ Usage
+ exit 0
+ fi
+
+ echo "256, 512" | grep -q ${RAM_SIZE}
+ if [ $? -eq 1 ] ; then
+ Usage
+ exit 0
+ fi
+ fi
+
+ cd ${LOCPATH}
+ sudo ./tegrarcm --bct=../${BINARIES}/${BCT} --bootloader=../${BINARIES}/${U_BOOT_BINARY} --loadaddr=0x80108000
+ exit 1
+fi
+
+# is OUT_DIR an existing directory?
+if [ ! -d "$OUT_DIR" ] ; then
+ echo "$OUT_DIR" "does not exist, exiting"
+ exit 1
+fi
+
+#sanity check for correct untared rootfs
+DEV_OWNER=`ls -ld rootfs/dev | awk '{print $3}'`
+if [ "${DEV_OWNER}x" != "rootx" ]
+then
+ $ECHO -e "rootfs/dev is not owned by root, but it should!"
+ $ECHO -e "\033[1mPlease unpack the tarball with root rights.\033[0m"
+ $ECHO -e "e.g. sudo tar xjvf Apalis_T30_LinuxImageV2.3Beta5_20141219.tar.bz2"
+ exit 1
+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}/${KERNEL_IMAGETYPE} ] || { echo "${BINARIES}/${KERNEL_IMAGETYPE} does not exist"; exit 1; }
+
+#sanity check for some programs
+MCOPY=`sudo which mcopy`
+[ "${MCOPY}x" != "x" ] || { echo >&2 "Program mcopy not available. Aborting."; exit 1; }
+sudo ${PARTED} -v >/dev/null 2>&1 || { echo >&2 "Program parted not available. Aborting."; exit 1; }
+[ "${MKFSVFAT}x" != "x" ] || { echo >&2 "Program mkfs.vfat not available. Aborting."; exit 1; }
+MKFSEXT3=`sudo which mkfs.ext3`
+[ "${MKFSEXT3}x" != "x" ] || { echo >&2 "Program mkfs.ext3 not available. Aborting."; exit 1; }
+awk -V >/dev/null 2>&1 || { echo >&2 "Program awk not available. Aborting."; exit 1; }
+dd --help >/dev/null 2>&1 || { echo >&2 "Program dd not available. Aborting."; exit 1; }
+tegra-uboot-flasher/cbootimage -h >/dev/null 2>&1
+[ "$?" -lt 2 ] || { echo >&2 "Program cbootimage not available. 32bit compatibility libs? Aborting."; exit 1; }
+
+if [ "${MODTYPE}" = "colibri-t20" ] ; then
+ #sanity check, can we execute mkfs.ubifs, e.g. see the help text?
+ CNT=`sudo $LOCPATH/mkfs.ubifs -h | grep -c space-fixup`
+ if [ "$CNT" -eq 0 ] ; then
+ echo "The program mkfs.ubifs can not be executed or does not provide --space-fixup"
+ echo "option."
+ echo "Are you on a 64-bit Linux host without installed 32-bit execution environment?"
+ $ECHO -e "\033[1mPlease install e.g. ia32-libs on 64-bit Ubuntu\033[0m"
+ $ECHO -e "\033[1mMaybe others are needed e.g. liblzo2:i386 on 64-bit Ubuntu\033[0m"
+ exit 1
+ fi
+fi
+
+#make the directory with the outputfiles writable
+sudo chown $USER: ${BINARIES}
+
+#make a file with the used versions for U-Boot, kernel and rootfs
+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
+if [ "${MODTYPE}" = "colibri-t20" ] ; then
+ basename "`readlink -m rootfs/boot/zImage`" >> ${BINARIES}/versions.txt
+else
+ basename "`readlink -e ${BINARIES}/${KERNEL_IMAGETYPE}`" >> ${BINARIES}/versions.txt
+fi
+$ECHO -n "Rootfs " >> ${BINARIES}/versions.txt
+grep -i t[2-3]0 rootfs/etc/issue >> ${BINARIES}/versions.txt
+
+# The emmc layout used is:
+#
+# boot area partition 1 aka eMMC boot sector:
+#
+# with cbootimage containing BCT and U-Boot boot loader
+#
+# user area aka general purpose eMMC region:
+#
+# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved to bootloader (not partitioned)
+# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - kernel and other data
+# BOOT_SPACE -> SDIMG_SIZE - rootfs
+#
+# Default Free space = 1.3x
+# Use IMAGE_OVERHEAD_FACTOR to add more space
+# <--------->
+# 4MiB 16MiB SDIMG_ROOTFS 4MiB
+# <-----------------------> <----------> <----------------------> <------------------------------>
+# ------------------------ ------------ ------------------------ -------------------------------
+# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE | IMAGE_ROOTFS_ALIGNMENT |
+# ------------------------ ------------ ------------------------ -------------------------------
+# ^ ^ ^ ^ ^
+# | | | | |
+# 0 4096 4MiB + 16MiB 4MiB + 16Mib + SDIMG_ROOTFS 4MiB + 16MiB + SDIMG_ROOTFS + 4MiB
+#
+# with the U-Boot environment at 512 * 1024, the config block is at 640 * 1024
+
+# generate cbootimage(s) containing BCT(s) and U-Boot boot loader
+cd ${BINARIES}
+for cbootimage in ${CBOOT_IMAGE}; do
+ sudo ../${LOCPATH}/cbootimage -s ${CBOOT_IMAGE_TARGET} ${cbootimage}.cfg ${cbootimage}
+done
+cd ..
+
+if [ "${MODTYPE}" = "colibri-t20" ] ; then
+ # Prepare full flashing
+ #build ${IMAGEFILE} if it does not exist
+ for blocksize in ${BLOCK}; do
+ sudo $LOCPATH/mkfs.ubifs -c ${MAXLEB} -e ${blocksize} -m ${PAGE} -o ${BINARIES}/${IMAGEFILE}_${blocksize}.img -r rootfs/ -v
+ done
+
+ echo ""
+ echo "UBI image of root file system generated, coping data to target folder..."
+else
+ if [ "${MODTYPE}" = "apalis-t30" ] || [ "${MODTYPE}" = "colibri-t30" ] ; then
+ # Boot partition [in sectors of 512]
+ BOOT_START=$(expr 4096 \* 2)
+ # Rootfs partition [in sectors of 512]
+ ROOTFS_START=$(expr 20480 \* 2)
+ # Boot partition volume id
+ BOOTDD_VOLUME_ID="Boot"
+
+ #make the partition size size(rootfs used + MIN_PARTITION_FREE_SIZE)
+ #add about 4% to the rootfs to account for fs overhead. (/1024/985 instead of /1024/1024).
+ #add 512 bytes per file to account for small files
+ NUMBER_OF_FILES=`sudo find ${ROOTFSPATH} | wc -l`
+ EXT_SIZE=`sudo du -DsB1 ${ROOTFSPATH} | awk -v min=$MIN_PARTITION_FREE_SIZE -v f=${NUMBER_OF_FILES} \
+ '{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'`
+
+ echo ""
+ echo "Creating MBR file and do the partitioning"
+ # Initialize a sparse file
+ dd if=/dev/zero of=${BINARIES}/mbr.bin bs=512 count=0 seek=${EMMC_SIZE}
+ ${PARTED} -s ${BINARIES}/mbr.bin mklabel msdos
+ ${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary fat32 ${BOOT_START} $(expr ${ROOTFS_START} - 1 )
+ # the partition spans to the end of the disk, even though the fs size will be smaller
+ # on the target the fs is then grown to the full size
+ ${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary ext2 ${ROOTFS_START} $(expr ${EMMC_SIZE} \- ${ROOTFS_START} \- 1)
+ ${PARTED} -s ${BINARIES}/mbr.bin unit s print
+ # get the size of the VFAT partition
+ BOOT_BLOCKS=$(LC_ALL=C ${PARTED} -s ${BINARIES}/mbr.bin unit b print \
+ | awk '/ 1 / { print int(substr($4, 1, length($4 -1)) / 1024) }')
+ # now crop the file to only the MBR size
+ IMG_SIZE=512
+ truncate -s $IMG_SIZE ${BINARIES}/mbr.bin
+
+
+ echo ""
+ echo "Creating VFAT partion image with the kernel"
+ rm -f ${BINARIES}/boot.vfat
+ ${MKFSVFAT} -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${BINARIES}/boot.vfat $BOOT_BLOCKS
+ export MTOOLS_SKIP_CHECK=1
+ mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/${KERNEL_IMAGETYPE} ::/${KERNEL_IMAGETYPE}
+
+ # Copy device tree file
+ COPIED=false
+ if test -n "${KERNEL_DEVICETREE}"; then
+ for DTS_FILE in ${KERNEL_DEVICETREE}; do
+ DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
+ if [ -e "${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then
+ kernel_bin="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}`"
+ kernel_bin_for_dtb="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb | sed "s,$DTS_BASE_NAME,${MODTYPE},g;s,\.dtb$,.bin,g"`"
+ if [ "$kernel_bin" = "$kernel_bin_for_dtb" ]; then
+ mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb
+ #copy also to out_dir
+ sudo cp ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb "$OUT_DIR/${DTS_BASE_NAME}.dtb"
+ COPIED=true
+ fi
+ fi
+ done
+ fi
+
+ echo ""
+ echo "Creating rootfs partion image"
+ rm -f ${BINARIES}/${IMAGEFILE}
+ sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || exit 1
+ fi
+fi
+
+#copy to $OUT_DIR
+cd ${BINARIES}
+sudo cp ${CBOOT_IMAGE} ${KERNEL_IMAGETYPE} ${EMMC_PARTS} ${IMAGEFILE}* flash*.img versions.txt "$OUT_DIR"
+cd ..
+sync
+echo "Successfully copied data to target folder."
+echo ""
+
+Flash
diff --git a/recipes/images/trdx-extra.inc b/recipes/images/trdx-extra.inc
index f9a74f0..175c154 100644
--- a/recipes/images/trdx-extra.inc
+++ b/recipes/images/trdx-extra.inc
@@ -30,20 +30,6 @@ IMAGE_INSTALL_T20_T30 = " \
eglinfo-x11 \
"
-IMAGE_INSTALL_MACHINE_colibri-t20 = " \
- ${IMAGE_INSTALL_T20_T30} \
- kernel-module-fusion-f0710a \
-"
-
-IMAGE_INSTALL_MACHINE_colibri-t30 = " \
- ${IMAGE_INSTALL_T20_T30} \
- fs-init \
- e2fsprogs \
- e2fsprogs-mke2fs \
- e2fsprogs-tune2fs \
- kernel-module-fusion-f0710a \
-"
-
IMAGE_INSTALL_MACHINE_apalis-t30 = " \
${IMAGE_INSTALL_T20_T30} \
pciutils \
@@ -66,6 +52,21 @@ IMAGE_INSTALL_MACHINE_apalis-t30 = " \
kernel-module-fusion-f0710a \
"
+IMAGE_INSTALL_MACHINE_colibri-t20 = " \
+ ${IMAGE_INSTALL_T20_T30} \
+ mtd-utils-ubifs \
+ kernel-module-fusion-f0710a \
+"
+
+IMAGE_INSTALL_MACHINE_colibri-t30 = " \
+ ${IMAGE_INSTALL_T20_T30} \
+ fs-init \
+ e2fsprogs \
+ e2fsprogs-mke2fs \
+ e2fsprogs-tune2fs \
+ kernel-module-fusion-f0710a \
+"
+
#note that the kernel-modules meta package gets installed from
#meta-fsl-arm/conf/machine/include/imx-base.inc
IMAGE_INSTALL_MACHINE_apalis-imx6 = " \
diff --git a/recipes/images/trdx-image-fstype.inc b/recipes/images/trdx-image-fstype.inc
index 2868bbb..51575f9 100644
--- a/recipes/images/trdx-image-fstype.inc
+++ b/recipes/images/trdx-image-fstype.inc
@@ -4,16 +4,18 @@ BURNFLASH := "${THISDIR}/files/${MACHINE}"
IMAGE_ROOTFS = "${WORKDIR}/${IMAGE_NAME}${PV}/rootfs"
U_BOOT_EXT = "bin"
-U_BOOT_EXT_vf = "imx"
U_BOOT_EXT_mx6 = "imx"
+U_BOOT_EXT_vf = "imx"
U_BOOT_SYMLINK = "u-boot-${MACHINE}.${U_BOOT_EXT}"
-U_BOOT_SYMLINK_tegra3 = "u-boot-dtb-tegra-${MACHINE}.${U_BOOT_EXT}"
+U_BOOT_SYMLINK_tegra = "u-boot-dtb-tegra-${MACHINE}.${U_BOOT_EXT}"
U_BOOT_BINARY = "u-boot.${U_BOOT_EXT}"
-U_BOOT_BINARY_tegra3 = "u-boot-dtb-tegra.${U_BOOT_EXT}"
+U_BOOT_BINARY_tegra = "u-boot-dtb-tegra.${U_BOOT_EXT}"
#we need some native tools for deployment
DEPENDS_append_mx6 = " imx-loader-native"
-DEPENDS_append_tegra3 = " cbootimage-native tegrarcm-native"
+#FIXME: 32-bit tegrarcm built on F20 does not run on 64-bit F20 even with properly installed 32-bit libs!
+DEPENDS_append_tegra = " cbootimage-native tegrarcm-native"
+DEPENDS_append_tegra2 = " mtd-utils-native"
DEPENDS_append_vf = " mtd-utils-native imx-loader-native"
imagedeploytools() {
@@ -33,7 +35,7 @@ imagedeploytools_append_mx6() {
cp ${STAGING_ETCDIR_NATIVE}/imx-loader.d/mx6_usb_work.conf ${IMAGE_ROOT}/
}
-imagedeploytools_append_tegra3() {
+imagedeploytools_append_tegra() {
IMAGE_ROOT="${IMAGE_ROOTFS}/../tegra-uboot-flasher/"
mkdir -p ${IMAGE_ROOT}
@@ -44,6 +46,12 @@ imagedeploytools_append_tegra3() {
${BUILD_STRIP} ${IMAGE_ROOT}/tegrarcm
}
+imagedeploytools_append_tegra2() {
+ # add the mkfs.ubifs binary
+ cp ${STAGING_DIR_NATIVE}/usr/sbin/mkfs.ubifs ${IMAGE_ROOT}/
+ ${BUILD_STRIP} ${IMAGE_ROOT}/mkfs.ubifs
+}
+
imagedeploytools_append_vf() {
IMAGE_ROOT="${IMAGE_ROOTFS}/../vf_flash/"
rm -f ${IMAGE_ROOT}/mkfs.ubifs ${IMAGE_ROOT}/imx_uart
@@ -60,13 +68,18 @@ imagedeploytools_append_vf() {
}
imagedeploy_kernel() {
- # put u-boot, kernel into the bin directories, remove the kernel/dtb from the rootfs/boot
+ # put kernel, device-tree into the bin directories, remove the kernel/dtb from the rootfs/boot
rm -f ${IMAGE_ROOTFS}/boot/uImage* ${IMAGE_ROOTFS}/boot/*.dtb
cp -pP ${DEPLOY_DIR_IMAGE}/uImage* ${IMAGE_ROOTFS}/../${MACHINE}_bin/
ls ${DEPLOY_DIR_IMAGE}/*.dtb 2> /dev/null && cp -pP ${DEPLOY_DIR_IMAGE}/*.dtb ${IMAGE_ROOTFS}/../${MACHINE}_bin/
mv ${IMAGE_ROOTFS}/../${MACHINE}_bin/uImage-${MACHINE}.bin ${IMAGE_ROOTFS}/../${MACHINE}_bin/uImage
}
+imagedeploy_kernel_tegra2() {
+ # Do nothing, we use the kernel from /boot inside root fs
+ :
+}
+
imagedeploy_kernel_vf() {
# Do nothing, we use the kernel from /boot inside root fs
: