diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2014-07-22 17:34:52 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2014-08-04 11:12:27 +0200 |
commit | 4578c3ef8d218065fdd5d114b828d4f68292ca18 (patch) | |
tree | bfe47d1891ec65686a1835b0f4cd6fc2b6b84fe3 /recipes-bsp/u-boot | |
parent | f005a374db13891c824806f07ff0a85034fd2dc9 (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/tegra2/fw_env.config | 11 | ||||
-rw-r--r-- | recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb | 20 |
2 files changed, 26 insertions, 5 deletions
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}" |