aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@qt.io>2016-07-14 15:16:31 +0200
committerRisto Avila <risto.avila@qt.io>2016-07-14 13:29:39 +0000
commitc822b244c007d4c82199b3f8aad155b8e6965647 (patch)
treee41270c7e02e139f8910c2ab1750116edfb802e2
parent4649da6f2a9d39f6cddc639c5c529c0ea4ee4204 (diff)
Add u-boot script for iMX7
Change-Id: I346827d2efd4416e625470fff9f13cda2eb93078 Reviewed-by: Risto Avila <risto.avila@qt.io>
-rw-r--r--conf/distro/include/colibri-imx7.conf7
-rw-r--r--meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb2
-rw-r--r--meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_blk.scr6
-rw-r--r--meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_mmc.scr6
4 files changed, 19 insertions, 2 deletions
diff --git a/conf/distro/include/colibri-imx7.conf b/conf/distro/include/colibri-imx7.conf
index 310a6a03..722da17b 100644
--- a/conf/distro/include/colibri-imx7.conf
+++ b/conf/distro/include/colibri-imx7.conf
@@ -32,6 +32,11 @@ BOOTFS_CONTENT = "\
${KERNEL_IMAGETYPE}-imx7s-colibri-eval-v3.dtb:imx7s-colibri-eval-v3.dtb \
u-boot-${MACHINE}.imx:u-boot.imx \
"
-BOOTFS_DEPENDS = "u-boot:do_deploy virtual/kernel:do_deploy"
+BOOTFS_DEPENDS = "u-boot:do_deploy u-boot-script-toradex:do_deploy virtual/kernel:do_deploy"
+BOOT_SCRIPTS += " \
+ u-boot-${MACHINE}.imx:u-boot.imx \
+ flash_mmc-${MACHINE}.img:flash_mmc.img \
+ flash_blk-${MACHINE}.img:flash_blk.img \
+ "
DISTRO_FEATURES_remove = "webengine"
diff --git a/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb
index 420cfe0c..bb209ad7 100644
--- a/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb
+++ b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb
@@ -73,4 +73,4 @@ do_install[noexec] = "1"
do_populate_sysroot[noexec] = "1"
PACKAGE_ARCH = "${MACHINE_ARCH}"
-COMPATIBLE_MACHINE = "(apalis-imx6|colibri-vf|colibri-imx6)"
+COMPATIBLE_MACHINE = "(apalis-imx6|colibri-vf|colibri-imx6|colibri-imx7)"
diff --git a/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_blk.scr b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_blk.scr
new file mode 100644
index 00000000..ee87e854
--- /dev/null
+++ b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_blk.scr
@@ -0,0 +1,6 @@
+test -n ${interface} || setenv interface mmc
+test -n ${drive} || setenv drive 1
+
+setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
+setenv update_uboot 'fatload ${interface} ${drive}:1 ${loadaddr} u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}'
+echo 'enter "run update_uboot" to update the uboot'
diff --git a/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_mmc.scr b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_mmc.scr
new file mode 100644
index 00000000..152982c2
--- /dev/null
+++ b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/mx7/flash_mmc.scr
@@ -0,0 +1,6 @@
+#flash_mmc has been renamed to flash_blk, ensure compatibility when updating from older versions
+test -n ${interface} || setenv interface mmc
+test -n ${drive} || setenv drive 1
+
+fatload ${interface} ${drive}:1 ${loadaddr} flash_blk.img
+source ${loadaddr}