[RESEND PATCH 05/10] sandbox: support the change of env location

Simon Glass sjg at chromium.org
Sun Feb 16 20:02:46 CET 2020


Hi Patrick,

On Wed, 12 Feb 2020 at 11:45, Patrick Delaunay <patrick.delaunay at st.com> wrote:
>
> Add support of environment location with a new sandbox command
> 'env_loc'.
>
> When the user change the environment location with the command
> 'env_loc <location>' the env is reinitialized and saved;
> the GD_FLG_ENV_DEFAULT flag is also updated.
>
> When the user set the same env location, the environment is
> re-loaded.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> ---
>
>  board/sandbox/sandbox.c | 40 +++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 39 insertions(+), 1 deletion(-)
>
> diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
> index 01f356be31..023a71d5f0 100644
> --- a/board/sandbox/sandbox.c
> +++ b/board/sandbox/sandbox.c
> @@ -21,6 +21,9 @@
>   */
>  gd_t *gd;
>
> +/* env location: current location used during test */
> +static enum env_location sandbox_env_location = ENVL_NOWHERE;
> +
>  /* Add a simple GPIO device */
>  U_BOOT_DEVICE(gpio_sandbox) = {
>         .name = "gpio_sandbox",
> @@ -53,9 +56,44 @@ enum env_location env_get_location(enum env_operation op, int prio)
>
>         gd->env_load_prio = 0;
>
> -       return ENVL_NOWHERE;
> +       return sandbox_env_location;
>  }
>
> +static int do_env_loc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

This should be a sub-command of 'env' I think.

Regards,
Simon


More information about the U-Boot mailing list