On Thu, Jun 25, 2020 at 09:59:52AM +0200, Patrick Delaunay wrote:

> Add the new command 'env select' to force the persistent storage
> of environment, saved in gd->env_load_prio.
> 
> Signed-off-by: Patrick Delaunay <patrick.delau...@st.com>
[snip]
> +     /* search priority by driver */
> +     for (prio = 0; (drv = env_driver_lookup(ENVOP_INIT, prio)); prio++) {
> +             if (entry->location == env_get_location(ENVOP_LOAD, prio)) {
> +                     /* when priority change, reset the ENV flags */
> +                     if (gd->env_load_prio != prio) {
> +                             gd->env_load_prio = prio;
> +                             gd->env_valid = ENV_INVALID;
> +                             gd->flags &= ~GD_FLG_ENV_DEFAULT;
> +                     }
> +                     printf("OK\n");
> +                     return 0;
> +             }
> +     }

So, after we do this, is some follow up env command required to
initialize the environment to now exist somewhere else?  Or will we have
initialized all configured locations during boot, and don't have to?
But what will happen if we select say "nand" but it's not present so
didn't init.  Will things fail gracefully (not panic) ?  Thanks!

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to