[U-Boot] [PATCH] spl: saveenv: adding saveenv support in SPL

Simon Glass sjg at chromium.org
Tue Sep 27 02:32:25 CEST 2016


Hi Ravi,

On 26 September 2016 at 06:56, Ravi Babu <ravibabu at ti.com> 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 <ravibabu at ti.com>
> ---
>  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 <sjg at chromium.org>

But I wonder if we could use SPL_SAVEENV, and drop the SUPPORT? 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.

Regards,
Simon


More information about the U-Boot mailing list