summaryrefslogtreecommitdiff
path: root/recipes-bsp/u-boot
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2014-07-22 17:34:52 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2014-08-04 11:12:27 +0200
commite8c6775411487e9daca498e1167c4ad518ef15e5 (patch)
treee27598deb1042aeab9edde9fdbe6ba74b595f73d /recipes-bsp/u-boot
parent8635136e8251f4c2f241ce7372cf8037d955e012 (diff)
colibri-t20: add configuration to u-boot-fw-utils
u-boot-fw-utils allows for U-Boot environmenmt access from Linux. Add the needed configuration file for colibri_t20 with a postinst script which choses the right NAND flash sector sizes from /proc/mtd While at it, fix some whitespace issues.
Diffstat (limited to 'recipes-bsp/u-boot')
-rw-r--r--recipes-bsp/u-boot/files/mx6/fw_env.config2
-rw-r--r--recipes-bsp/u-boot/files/tegra2/fw_env.config11
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb20
3 files changed, 27 insertions, 6 deletions
diff --git a/recipes-bsp/u-boot/files/mx6/fw_env.config b/recipes-bsp/u-boot/files/mx6/fw_env.config
index 0da5083..efd358b 100644
--- a/recipes-bsp/u-boot/files/mx6/fw_env.config
+++ b/recipes-bsp/u-boot/files/mx6/fw_env.config
@@ -20,4 +20,4 @@
# Block device example
# Apalis iMX6
-/dev/mmcblk2 0x80000 0x2000
+/dev/mmcblk0 0x80000 0x2000
diff --git a/recipes-bsp/u-boot/files/tegra2/fw_env.config b/recipes-bsp/u-boot/files/tegra2/fw_env.config
new file mode 100644
index 0000000..9d00835
--- /dev/null
+++ b/recipes-bsp/u-boot/files/tegra2/fw_env.config
@@ -0,0 +1,11 @@
+# Configuration file for fw_(printenv/setenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash.
+# Futhermore, if the Flash sector size is ommitted, this value is assumed to
+# be the same as the Environment size, which is valid for NOR and SPI-dataflash
+
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+#Colibri T20: flash sector size depends on module type and version
+#/dev/mtd3 0x00000000 0x00001000 0x00040000 1
+
diff --git a/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb b/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb
index 8063da3..5a15a58 100644
--- a/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb
+++ b/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb
@@ -16,6 +16,7 @@ FILESPATHPKG =. "git:"
S="${WORKDIR}/git"
SRC_URI_COLIBRI = "git://git.toradex.com/u-boot-toradex.git;protocol=git;branch=colibri"
SRC_URI_COLIBRI += "file://u-boot-dont-build-standalone.patch"
+SRC_URI_COLIBRI += "file://fw_env.config"
# This revision is based on upstream "v2011.06"
SRCREV_COLIBRI = "9d41458a8095fc58e355e3ecca6f96aa7d98d725"
@@ -38,14 +39,23 @@ EXTRA_OEMAKE = 'HOSTCC="${CC}" HOSTSTRIP="true"'
inherit uboot-config
do_compile () {
- oe_runmake ${UBOOT_MACHINE}
- oe_runmake env
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake env
}
do_install () {
- install -d ${D}${base_sbindir}
- 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 -d ${D}${base_sbindir} ${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 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/
+}
+
+pkg_postinst_${PN}_tegra2 () {
+ # can't do this offline
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+ grep ENV /proc/mtd | awk '{print "/dev/" substr($1,0,4) " 0x00000000 0x00001000 0x" $3 " 1" >> "/etc/fw_env.config" }'
}
PACKAGE_ARCH = "${MACHINE_ARCH}"