summaryrefslogtreecommitdiff
path: root/recipes-bsp/u-boot
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2019-05-21 17:01:27 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2019-05-21 17:55:11 +0200
commitddd9b23247c0634d3f1148550419264e595613b8 (patch)
treead3e549e86ff4be494e14574da1ee72dbde39509 /recipes-bsp/u-boot
parent5ec8b6f918adcbd43a1d464bc1d44f5bbb830817 (diff)
u-boot-toradex-fw-utils_2018.03: intial recipe
Copied and adapted from: openembedded-core/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.07.bb Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-bsp/u-boot')
-rw-r--r--recipes-bsp/u-boot/files/apalis-imx8/fw_env.config15
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex-fw-utils_2018.03.bb49
2 files changed, 64 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/files/apalis-imx8/fw_env.config b/recipes-bsp/u-boot/files/apalis-imx8/fw_env.config
new file mode 100644
index 0000000..00f21bf
--- /dev/null
+++ b/recipes-bsp/u-boot/files/apalis-imx8/fw_env.config
@@ -0,0 +1,15 @@
+# Configuration file for fw_(printenv/setenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+# Device offset must be prefixed with 0x to be parsed as a hexadecimal value.
+# On a block device a negative offset is treated as a backwards offset from the
+# end of the device/partition, rather than a forwards offset from the start.
+
+# Colibri iMX7 Dual 1GB (eMMC)
+# U-Boot environment is stored at the end of the first eMMC boot partition
+# hence use a negative value. The environment is just in front of the config
+# block which occupies the last sector (hence -0x200)
+
+# Block device name Device offset Env. size
+/dev/mmcblk0boot0 -0x2200 0x2000
+
diff --git a/recipes-bsp/u-boot/u-boot-toradex-fw-utils_2018.03.bb b/recipes-bsp/u-boot/u-boot-toradex-fw-utils_2018.03.bb
new file mode 100644
index 0000000..45eaaa4
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-toradex-fw-utils_2018.03.bb
@@ -0,0 +1,49 @@
+require u-boot-toradex-common_${PV}.inc
+
+SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
+DEPENDS += "mtd-utils"
+
+SRC_URI += " \
+ file://fw_env.config \
+ file://fw_unlock_mmc.sh \
+"
+
+INSANE_SKIP_${PN} = "already-stripped"
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
+EXTRA_OEMAKE_class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+
+inherit uboot-config
+
+do_compile () {
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake envtools
+}
+
+install_unlock_emmc() {
+ install -d ${D}${sysconfdir}/profile.d/
+ install -m 0644 ${WORKDIR}/fw_unlock_mmc.sh ${D}${sysconfdir}/profile.d/fw_unlock_mmc.sh
+}
+
+do_install_append_mx8() {
+ install_unlock_emmc
+}
+
+do_install () {
+ install -d ${D}${base_sbindir}
+ install -d ${D}${sysconfdir}
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
+ install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
+
+do_install_class-cross () {
+ install -d ${D}${bindir_cross}
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
+}
+
+SYSROOT_DIRS_append_class-cross = " ${bindir_cross}"
+
+COMPATIBLE_MACHINE = "(mx8)"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+BBCLASSEXTEND = "cross"