[PATCH v3 08/14] cmd: env: add env select command

Tom Rini trini at konsulko.com
Fri Jun 26 22:54:47 CEST 2020


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.delaunay at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200626/1e282377/attachment.sig>


More information about the U-Boot mailing list