@@ -400,8 +400,15 @@ config BR2_TARGET_UBOOT_ENVIMAGE_SOURCE
config BR2_TARGET_UBOOT_ENVIMAGE_SIZE
string "Size of environment"
help
- Size of envronment, can be prefixed with 0x for hexadecimal
- values.
+ Size of environment in bytes, can be prefixed with 0x for hexadecimal
+ values. Needs to match exactly for correct CRC checksum calculation.
+
+config BR2_TARGET_UBOOT_ENVIMAGE_PADDING_BYTE
+ hex "Padding byte"
+ default 0x00
+ help
+ The byte used for padding at the end of the environment image.
+ Needs to be correct for correct CRC checksum calculation.
config BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT
bool "Environment has two copies"
@@ -251,10 +251,12 @@ define UBOOT_INSTALL_IMAGES_CMDS
)
$(if $(BR2_TARGET_UBOOT_ENVIMAGE),
cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) | \
- $(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
- $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
- $(if $(filter BIG,$(BR2_ENDIAN)),-b) \
- -o $(BINARIES_DIR)/uboot-env.bin -)
+ $(HOST_DIR)/bin/mkenvimage \
+ $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
+ $(if $(filter BIG,$(BR2_ENDIAN)),-b) \
+ -p $(BR2_TARGET_UBOOT_ENVIMAGE_PADDING_BYTE) \
+ -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
+ -o $(BINARIES_DIR)/uboot-env.bin -)
$(if $(BR2_TARGET_UBOOT_BOOT_SCRIPT),
$(HOST_DIR)/bin/mkimage -C none -A $(MKIMAGE_ARCH) -T script \
-d $(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)) \
The size of the uboot environment (which is provided in bytes -> help text updated) as well as the padding bytes have to be exactly correct in order to generate an image with the correct CRC checksum that can be read by the target during boot. Hence we add the option to specify the padding byte which is used by mkenvimage and updated the help texts to inform the user about the importance of these parameters. Also cleaned up and reindented all mkenvimage parameters. Signed-off-by: Johannes Schmitz <johannes.schmitz1@gmail.com> --- boot/uboot/Config.in | 11 +++++++++-- boot/uboot/uboot.mk | 10 ++++++---- 2 files changed, 15 insertions(+), 6 deletions(-)