From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 26 Jun 2020 16:54:47 -0400 Subject: [PATCH v3 08/14] cmd: env: add env select command In-Reply-To: <20200625075958.9868-9-patrick.delaunay@st.com> References: <20200625075958.9868-1-patrick.delaunay@st.com> <20200625075958.9868-9-patrick.delaunay@st.com> Message-ID: <20200626205447.GE8432@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 [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: