The env image is currently always padded with the default bytes 0xFF.
New configuration U_BOOT_ENV_IMAGE_CUSTOM_PADDING_BYTES is added
to allow specification for custom env images.

Signed-off-by: Sebastian Muxel <sebastian.mu...@entner-electronics.com>
---
 platforms/u-boot.in | 9 +++++++++
 rules/u-boot.make   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 769237081..bcabc8b27 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -131,6 +131,15 @@ config U_BOOT_ENV_IMAGE_CUSTOM_SOURCE
          The file should have lines in the form var=value, one per line.
          Blank lines and lines starting with a # are ignored.
 
+config U_BOOT_ENV_IMAGE_CUSTOM_PADDING_BYTES
+       prompt "Bytes used to pad environment image"
+       hex
+       default "0xFF"
+       depends on U_BOOT_ENV_IMAGE_CUSTOM
+       help
+               Enter the byte used for padding the image to the specified 
+               U-Boot environment size.
+
 if !U_BOOT_ENV_IMAGE_NONE
 
 config U_BOOT_ENV_IMAGE_SIZE
diff --git a/rules/u-boot.make b/rules/u-boot.make
index 4bc7f3f78..6ef657529 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -123,6 +123,7 @@ ifdef PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM
                $(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
                -s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
                -o $(U_BOOT_BUILD_DIR)/u-boot-env.img \
+               -p $(PTXCONF_U_BOOT_ENV_IMAGE_CUSTOM_PADDING_BYTES) \
                $(U_BOOT_ENV_IMAGE_CUSTOM_SRC)
 endif
        @$(call touch)
-- 
2.43.0


Reply via email to