diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-07-21 18:40:17 -0700 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2016-08-17 14:08:52 +0200 |
commit | 0616216a235b00673fd3b943cc12181ebfbdfc67 (patch) | |
tree | 144431db28a58011f225ef16e7146b28c08337d0 /recipes-bsp | |
parent | 990b6c4188cf35a8861402e755c8c43160ec5482 (diff) |
u-boot-fw-utils: use negative offset for environment
Rely on newly implemented configuration functionality to locate the
environment at the end of the boot partition.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-bsp')
-rw-r--r-- | recipes-bsp/u-boot/files/mx6/fw_env.config | 15 | ||||
-rw-r--r-- | recipes-bsp/u-boot/files/tegra124/fw_env.config | 15 | ||||
-rw-r--r-- | recipes-bsp/u-boot/files/tegra3/fw_env.config | 15 | ||||
-rw-r--r-- | recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb | 17 | ||||
-rw-r--r-- | recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb | 30 |
5 files changed, 49 insertions, 43 deletions
diff --git a/recipes-bsp/u-boot/files/mx6/fw_env.config b/recipes-bsp/u-boot/files/mx6/fw_env.config new file mode 100644 index 0000000..731d874 --- /dev/null +++ b/recipes-bsp/u-boot/files/mx6/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 iMX6/Apalis iMX6 +# 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/files/tegra124/fw_env.config b/recipes-bsp/u-boot/files/tegra124/fw_env.config new file mode 100644 index 0000000..5941da2 --- /dev/null +++ b/recipes-bsp/u-boot/files/tegra124/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. + +# Apalis TK1 +# 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/files/tegra3/fw_env.config b/recipes-bsp/u-boot/files/tegra3/fw_env.config new file mode 100644 index 0000000..d2be4ee --- /dev/null +++ b/recipes-bsp/u-boot/files/tegra3/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 T30/Apalis T30 +# 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-fsl-fw-utils_git.bb b/recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb index 7055dbb..acc0903 100644 --- a/recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb +++ b/recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb @@ -13,8 +13,8 @@ DEFAULT_PREFERENCE_colibri-vf = "1" FILESPATHPKG =. "git:" S="${WORKDIR}/git" -SRCREV = "10bc451b6948e842e24799fe7fb037d335714b36" -SRCBRANCH = "2015.04-toradex" +SRCREV = "476fa4400d2cc32279c7ae7e73e7c4ab1bff4327" +SRCBRANCH = "2015.04-toradex-next" SRC_URI = "git://git.toradex.com/u-boot-toradex.git;protocol=git;branch=${SRCBRANCH} \ file://fw_env.config \ " @@ -49,17 +49,4 @@ do_install_append_mx6() { install -m 0644 ${WORKDIR}/fw_unlock_mmc.sh ${D}${sysconfdir}/profile.d/fw_unlock_mmc.sh } -pkg_postinst_${PN}_mx6 () { - # can't do this offline - if [ "x$D" != "x" ]; then - exit 1 - fi - # Environment in eMMC, before the configblock at the end of 1st "boot sector" - DISK="mmcblk0boot0" - DISK_SIZE=`cat /sys/block/$DISK/size` - CONFIG_ENV_SIZE=8192 # 0x2000 - CONFIG_ENV_OFFSET=`expr $DISK_SIZE \* 512 - $CONFIG_ENV_SIZE - 512` - printf "/dev/%s\t0x%X\t0x%X\n" $DISK $CONFIG_ENV_OFFSET $CONFIG_ENV_SIZE >> "/etc/fw_env.config" -} - PACKAGE_ARCH = "${MACHINE_ARCH}" 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 f9b9f3d..649f4fc 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 @@ -15,8 +15,8 @@ DEFAULT_PREFERENCE_colibri-t30 = "1" FILESPATHPKG =. "git:" S="${WORKDIR}/git" # This revision is based on upstream "v2015.04" -SRCREV = "10bc451b6948e842e24799fe7fb037d335714b36" -SRCBRANCH = "2015.04-toradex" +SRCREV = "476fa4400d2cc32279c7ae7e73e7c4ab1bff4327" +SRCBRANCH = "2015.04-toradex-next" SRC_URI = "git://git.toradex.com/u-boot-toradex.git;protocol=git;branch=${SRCBRANCH} \ file://fw_env.config \ " @@ -70,30 +70,4 @@ pkg_postinst_${PN}_colibri-t20 () { grep u-boot-env /proc/mtd | awk '{print "/dev/" substr($1,0,4) " 0x00000000 0x00010000 0x" $3 " 1" >> "/etc/fw_env.config" }' } -pkg_postinst_${PN}_tegra3 () { - # can't do this offline - if [ "x$D" != "x" ]; then - exit 1 - fi - # Environment in eMMC, before the configblock at the end of 1st "boot sector" - DISK="mmcblk0boot0" - DISK_SIZE=`cat /sys/block/$DISK/size` - CONFIG_ENV_SIZE=8192 # 0x2000 - CONFIG_ENV_OFFSET=`expr $DISK_SIZE \* 512 - $CONFIG_ENV_SIZE - 512` - printf "/dev/%s\t0x%X\t0x%X\n" $DISK $CONFIG_ENV_OFFSET $CONFIG_ENV_SIZE >> "/etc/fw_env.config" -} - -pkg_postinst_${PN}_tegra124 () { - # can't do this offline - if [ "x$D" != "x" ]; then - exit 1 - fi - # Environment in eMMC, before the configblock at the end of 1st "boot sector" - DISK="mmcblk0boot0" - DISK_SIZE=`cat /sys/block/$DISK/size` - CONFIG_ENV_SIZE=8192 # 0x2000 - CONFIG_ENV_OFFSET=`expr $DISK_SIZE \* 512 - $CONFIG_ENV_SIZE - 512` - printf "/dev/%s\t0x%X\t0x%X\n" $DISK $CONFIG_ENV_OFFSET $CONFIG_ENV_SIZE >> "/etc/fw_env.config" -} - PACKAGE_ARCH = "${MACHINE_ARCH}" |