summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Remmet <j.remmet@phytec.de>2019-07-17 09:58:00 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2019-07-17 15:21:27 +0200
commitff5471a73c0da3b9cc25aaef0228cc291a288661 (patch)
tree019763adae40cac6baeacb175a07f392c8b73a8d
parentac6f162f1f0152e7ad1b82e9504a3cb96a0e0997 (diff)
downloadmeta-phytec-ff5471a73c0da3b9cc25aaef0228cc291a288661.tar.bz2
meta-phytec-ff5471a73c0da3b9cc25aaef0228cc291a288661.zip
BACKPORT: bbu: add suppport for imx cpus via imx-kobs
install the barebox images on i.MX6 via imx-kobs. There is only a simple check for "arm barebox images" and no verification on nand by now. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Changed machine override for RDEPENDS to mx6 as the imx machine override was first introduced in sumo. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--recipes-devtools/bbu/bbu.bb3
-rw-r--r--recipes-devtools/bbu/bbu/mx6/bbu.sh34
-rw-r--r--recipes-devtools/bbu/bbu/ti33x/bbu.sh (renamed from recipes-devtools/bbu/bbu/bbu.sh)0
3 files changed, 36 insertions, 1 deletions
diff --git a/recipes-devtools/bbu/bbu.bb b/recipes-devtools/bbu/bbu.bb
index 92c3196..d7233f6 100644
--- a/recipes-devtools/bbu/bbu.bb
+++ b/recipes-devtools/bbu/bbu.bb
@@ -13,6 +13,7 @@ S = "${WORKDIR}"
# Depends on tools like hexdump, tr, grep, awk which are part of our
# busybox configuration
RDEPENDS_${PN} = "busybox mtd-utils"
+RDEPENDS_${PN}_append_mx6 = " imx-kobs"
do_install() {
install -d ${D}${bindir}
@@ -21,4 +22,4 @@ do_install() {
FILES_${PN} = "${bindir}"
-COMPATIBLE_MACHINE = "ti33x"
+COMPATIBLE_MACHINE = "(ti33x|imx)"
diff --git a/recipes-devtools/bbu/bbu/mx6/bbu.sh b/recipes-devtools/bbu/bbu/mx6/bbu.sh
new file mode 100644
index 0000000..8ff53c9
--- /dev/null
+++ b/recipes-devtools/bbu/bbu/mx6/bbu.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Copyright 2018 PHYTEC Messtechnik GmbH
+
+usage() {
+ echo "$0 <BOOTLOADER>"
+ echo "BOOTLOADER - barebox image format"
+}
+
+if [ "$#" -ne 1 ]; then
+ echo "Illegal number of parameters"
+ usage
+ exit 1
+fi
+
+# Verify barebox image format
+if ! hexdump -C $1 -s 0x20 -n 8 | grep -q "barebox"; then
+ echo "$1 is not a barebox Image format"
+ usage
+ exit 1
+fi
+
+mdtype=`mtdinfo /dev/mtd0 | grep Type | awk '{print $2}'`
+mdname=`mtdinfo /dev/mtd0 | grep Name | awk '{print $2}'`
+if [ "$mdname" != "barebox" -o "$mdtype" != "nand" ]; then
+ echo "/dev/mtd0 is not a barenbox partion on nand"
+ exit 1
+fi
+
+# Update barebox
+echo "Flashing $1"
+if ! kobs-ng init --search_exponent=1 -s $1 ; then
+ echo "kobs-ng failed"
+ exit 1
+fi
diff --git a/recipes-devtools/bbu/bbu/bbu.sh b/recipes-devtools/bbu/bbu/ti33x/bbu.sh
index a48bf59..a48bf59 100644
--- a/recipes-devtools/bbu/bbu/bbu.sh
+++ b/recipes-devtools/bbu/bbu/ti33x/bbu.sh