From mboxrd@z Thu Jan 1 00:00:00 1970 From: B, Ravi Date: Tue, 27 Sep 2016 06:20:44 +0000 Subject: [U-Boot] [PATCH] spl: saveenv: adding saveenv support in SPL In-Reply-To: References: <1474894616-7777-1-git-send-email-ravibabu@ti.com> Message-ID: <6C6B28D4DC342643927BEAFCE8707BF67633E2CC@DBDE04.ent.ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon >On 26 September 2016 at 06:56, Ravi Babu wrote: >> By default saveenv option is not supported for SPL. This patch enable >> the support for save environment variable for SPL build. >> >> Enable save environment support in SPL after setenv. By default the >> saveenv option is not provided in SPL, but some boards need this >> support in 'Falcon' boot, where SPL need to boot from different images >> based on environment variable set by OS. For example OS may set >> "reboot_image" environment variable to "recovery" inorder to boot >> recovery image by SPL. The SPL read "reboot_image" and act accordingly >> and change the reboot_image to default mode using setenv and save the >> environemnt. >> >> Signed-off-by: Ravi Babu >> --- >> common/spl/Kconfig | 13 +++++++++++++ >> drivers/mmc/Makefile | 1 + >> drivers/mmc/mmc_private.h | 3 +-- >> lib/Makefile | 1 + >> lib/hashtable.c | 2 +- >> 5 files changed, 17 insertions(+), 3 deletions(-) >> >> diff --git a/common/spl/Kconfig b/common/spl/Kconfig index >> 2a8ddbc..0daa835 100644 >> --- a/common/spl/Kconfig >> +++ b/common/spl/Kconfig >> @@ -163,6 +163,19 @@ config SPL_ENV_SUPPORT >> starting U-Boot first. Enabling this option will make getenv() >> and setenv() available in SPL. >> >> +config SPL_SAVEENV_SUPPORT >> + bool "Support save environment" >> + depends on SPL && SPL_ENV_SUPPORT >> + help >> + Enable save environment support in SPL after setenv. By default >> + the saveenv option is not provided in SPL, but some boards need >> + this support in 'Falcon' boot, where SPL need to boot from >> + different images based on environment variable set by OS. For >> + example OS may set "reboot_image" environment variable to >> + "recovery" inorder to boot recovery image by SPL. The SPL read >> + "reboot_image" and act accordingly and change the reboot_image >> + to default mode using setenv and save the environemnt. >> + >Reviewed-by: Simon Glass >But I wonder if we could use SPL_SAVEENV, and drop the SUPPORT? Ok, will drop SUPPORT and use SPL_SAVEENV. > For U-Boot proper we use CONFIG_CMD_SAVEENV which is inconsistent - I think we should really have a CONFIG_SAVEENV separate from the command. I agree. Thanks. Regards Ravi