summaryrefslogtreecommitdiff
path: root/recipes-bsp/tezi-metadata
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-10-18 17:46:43 -0700
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-01-11 13:34:03 +0100
commite2b8f3d69ab62cf84c87be0a3da8e7b0388c15ab (patch)
tree690c2047ffbcc2ad011de0bbf1d83c0e5dec3a5f /recipes-bsp/tezi-metadata
parent0c4b53c065735e3c4e9ced352bcfc4cfdb6945df (diff)
tezi-metadata: initial commit of Tezi specific image metadata
This adds metadata files required by Toradex Easy Installer. Most notable is the Linux specific migration script which is executed before flashing an image. The script makes sure that hardware specific upgrades such as fuses/eMMC reconfiguration get executed, as our U-Boot based scripts do when using "run update". Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'recipes-bsp/tezi-metadata')
-rw-r--r--recipes-bsp/tezi-metadata/files/apalis-imx6/prepare.sh67
-rw-r--r--recipes-bsp/tezi-metadata/files/apalis-imx6/wrapup.sh3
-rw-r--r--recipes-bsp/tezi-metadata/files/marketing.tarbin0 -> 97792 bytes
-rw-r--r--recipes-bsp/tezi-metadata/files/prepare.sh18
-rw-r--r--recipes-bsp/tezi-metadata/files/toradexlinux.pngbin0 -> 2434 bytes
-rw-r--r--recipes-bsp/tezi-metadata/files/wrapup.sh3
-rw-r--r--recipes-bsp/tezi-metadata/tezi-metadata_0.3.bb21
7 files changed, 112 insertions, 0 deletions
diff --git a/recipes-bsp/tezi-metadata/files/apalis-imx6/prepare.sh b/recipes-bsp/tezi-metadata/files/apalis-imx6/prepare.sh
new file mode 100644
index 0000000..858faab
--- /dev/null
+++ b/recipes-bsp/tezi-metadata/files/apalis-imx6/prepare.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# (c) Toradex AG 2016
+#
+# Apalis iMX6 in-field hardware update script
+#
+# One-time configurations (non-reversible!):
+# - Fuse SoC to use eMMC Fast Boot mode
+# - Enable eMMC H/W reset capabilities
+# Required configurations
+# - Configure Boot Bus mode (due to eMMC Fast Boot mode above)
+#
+# Other configurations
+# - Boot from eMMC boot partition
+#
+
+PRODUCT_ID=$1
+BOARD_REV=$2
+SERIAL=$3
+IMAGE_FOLDER=$4
+
+error_exit () {
+ echo "$1" 1>&2
+ exit 1
+}
+
+# Do a basic validation that we do this on one of our modules
+case $PRODUCT_ID in
+0027|0028|0029|0035) ;;
+*) error_exit "This script is meant to be run on a Apalis iMX6. Aborting...";
+esac
+
+# Fuse SoC's BOOT_CFG to enable eMMC Fast Boot mode, if necsary
+# WARNING: Fusing is a one-time operation, do not change values
+# here unless you are absolutely sure what your are doing.
+if [ ! -f /sys/fsl_otp/HW_OCOTP_CFG4 ]; then
+ echo "Fusing not supported."
+elif grep -q 0x5072 /sys/fsl_otp/HW_OCOTP_CFG4; then
+ echo "No new value for BOOT_CFG required."
+else
+ echo 0x5072 > /sys/fsl_otp/HW_OCOTP_CFG4
+ if [ "$?" != "0" ]; then
+ error_exit "Writing fuse BOOT_CFG failed! Aborting..."
+ fi
+fi
+
+# eMMC configurations
+MMCDEV=/dev/mmcblk0
+
+# Set boot bus mode
+if ! mmc bootbus set single_hs x1 x8 ${MMCDEV}; then
+ error_exit "Setting boot bus mode failed"
+fi
+
+# Enable eMMC boot partition 1 (mmcblkXboot0) and boot ack
+if ! mmc bootpart enable 1 1 ${MMCDEV}; then
+ error_exit "Setting bootpart failed"
+fi
+
+# Enable eMMC H/W Reset feature
+# Since this is a one-time operation, it will fail the second time. Ignore
+# errors and redirect stderr to stdout.
+mmc hwreset enable ${MMCDEV} 2>&1
+
+echo "Apalis iMX6 in-field hardware update script ended successfully."
+
+exit 0
diff --git a/recipes-bsp/tezi-metadata/files/apalis-imx6/wrapup.sh b/recipes-bsp/tezi-metadata/files/apalis-imx6/wrapup.sh
new file mode 100644
index 0000000..c52d3c2
--- /dev/null
+++ b/recipes-bsp/tezi-metadata/files/apalis-imx6/wrapup.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exit 0
diff --git a/recipes-bsp/tezi-metadata/files/marketing.tar b/recipes-bsp/tezi-metadata/files/marketing.tar
new file mode 100644
index 0000000..b28aa89
--- /dev/null
+++ b/recipes-bsp/tezi-metadata/files/marketing.tar
Binary files differ
diff --git a/recipes-bsp/tezi-metadata/files/prepare.sh b/recipes-bsp/tezi-metadata/files/prepare.sh
new file mode 100644
index 0000000..221bbab
--- /dev/null
+++ b/recipes-bsp/tezi-metadata/files/prepare.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# (c) Toradex AG 2016
+#
+# Empty in-field hardware update script
+#
+
+PRODUCT_ID=$1
+BOARD_REV=$2
+SERIAL=$3
+IMAGE_FOLDER=$4
+
+error_exit () {
+ echo "$1" 1>&2
+ exit 1
+}
+
+exit 0
diff --git a/recipes-bsp/tezi-metadata/files/toradexlinux.png b/recipes-bsp/tezi-metadata/files/toradexlinux.png
new file mode 100644
index 0000000..b9a9ea6
--- /dev/null
+++ b/recipes-bsp/tezi-metadata/files/toradexlinux.png
Binary files differ
diff --git a/recipes-bsp/tezi-metadata/files/wrapup.sh b/recipes-bsp/tezi-metadata/files/wrapup.sh
new file mode 100644
index 0000000..c52d3c2
--- /dev/null
+++ b/recipes-bsp/tezi-metadata/files/wrapup.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exit 0
diff --git a/recipes-bsp/tezi-metadata/tezi-metadata_0.3.bb b/recipes-bsp/tezi-metadata/tezi-metadata_0.3.bb
new file mode 100644
index 0000000..d6b8b9f
--- /dev/null
+++ b/recipes-bsp/tezi-metadata/tezi-metadata_0.3.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "Toradex Easy Installer Metadata"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+SRC_URI = "file://prepare.sh \
+ file://wrapup.sh \
+ file://toradexlinux.png \
+ file://marketing.tar;unpack=false"
+
+inherit deploy
+
+do_deploy () {
+ install -m 644 ${WORKDIR}/prepare.sh ${DEPLOYDIR}
+ install -m 644 ${WORKDIR}/wrapup.sh ${DEPLOYDIR}
+ install -m 644 ${WORKDIR}/toradexlinux.png ${DEPLOYDIR}
+ install -m 644 ${WORKDIR}/marketing.tar ${DEPLOYDIR}
+}
+
+addtask deploy before do_package after do_install
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"