diff mbox

[v4] uboot: support -r option for mkenvimage

Message ID 1386611473-8368-1-git-send-email-spdawson@gmail.com
State Accepted
Headers show

Commit Message

Simon Dawson Dec. 9, 2013, 5:51 p.m. UTC
From: Simon Dawson <spdawson@gmail.com>

Some boards are configured in u-boot to store multiple redundant copies of
the environment image in flash. For these boards, it is required to pass the -r
flag, when generating a boot environment image using mkenvimage.

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 v4: Rebase on current master
 v3: Further improvement of help text, as suggested by Thomas Petazzoni
 v2: Change configuration menu text and help text, in response to feedback
     from Arnout Vandecappelle and Thomas Petazzoni

 boot/uboot/Config.in | 14 ++++++++++++++
 boot/uboot/uboot.mk  |  1 +
 2 files changed, 15 insertions(+)

Comments

Peter Korsgaard Dec. 12, 2013, 10:20 p.m. UTC | #1
>>>>> "spdawson" == spdawson  <spdawson@gmail.com> writes:

 > From: Simon Dawson <spdawson@gmail.com>
 > Some boards are configured in u-boot to store multiple redundant copies of
 > the environment image in flash. For these boards, it is required to
 > pass the -r flag, when generating a boot environment image using
 > mkenvimage.

 > Signed-off-by: Simon Dawson <spdawson@gmail.com>
 > ---
 >  v4: Rebase on current master
 >  v3: Further improvement of help text, as suggested by Thomas Petazzoni
 >  v2: Change configuration menu text and help text, in response to feedback
 >      from Arnout Vandecappelle and Thomas Petazzoni

Committed, thanks.
diff mbox

Patch

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 77553c1..d693bcf 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -251,6 +251,20 @@  config BR2_TARGET_UBOOT_ENVIMAGE_SIZE
 	  Size of envronment, can be prefixed with 0x for hexadecimal
 	  values.
 
+config BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT
+	bool "Environment has two copies"
+	help
+	  Some platforms define in their U-Boot configuration that the
+	  U-Boot environment should be duplicated in two locations (for
+	  extra safety). Check your U-Boot configuration for the
+	  CONFIG_ENV_ADDR_REDUND and CONFIG_ENV_SIZE_REDUND settings to
+	  see if this is the case for your platform.
+
+	  If it is the case, then you should enable this option to
+	  ensure that the U-Boot environment image generated by
+	  Buildroot is compatible with the "redundant environment"
+	  mechanism of U-Boot.
+
 endif # BR2_TARGET_UBOOT_ENVIMAGE
 
 endif # BR2_TARGET_UBOOT
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 06b75ed..ba7087e 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -120,6 +120,7 @@  define UBOOT_INSTALL_IMAGES_CMDS
 		cp -dpf $(@D)/$(BR2_TARGET_UBOOT_SPL_NAME) $(BINARIES_DIR)/)
 	$(if $(BR2_TARGET_UBOOT_ENVIMAGE),
 		$(HOST_DIR)/usr/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
+		$(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
 		-o $(BINARIES_DIR)/uboot-env.bin $(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE))
 endef