From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Mon, 3 Dec 2018 18:16:30 +0000 Subject: [U-Boot] [PATCH v6 03/27] env: sf: define API to override sf environment address References: <20181105181931.7348-1-rajesh.bhagat@nxp.com> <20181105181931.7348-4-rajesh.bhagat@nxp.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Maintainers, Please review this patch as it slightly changes common code for ENV. Rajesh, If you run get_maintainers, or use patman, you would have expanded the CC list. York On 11/5/18 10:01 AM, Rajesh Bhagat wrote: > Defines env_sf_get_env_addr API to override sf environment address, > required to support multiple environment. > > Signed-off-by: Rajesh Bhagat > --- > Change in v6: None > Change in v5: None > Change in v4: None > Change in v3: None > Change in v2: None > > env/sf.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/env/sf.c b/env/sf.c > index 2e3c600483..23cbad5d88 100644 > --- a/env/sf.c > +++ b/env/sf.c > @@ -298,10 +298,17 @@ out: > } > #endif > > +#ifdef CONFIG_ENV_ADDR > +__weak void *env_sf_get_env_addr(void) > +{ > + return (void *)CONFIG_ENV_ADDR; > +} > +#endif > + > #if defined(INITENV) && defined(CONFIG_ENV_ADDR) > static int env_sf_init(void) > { > - env_t *env_ptr = (env_t *)(CONFIG_ENV_ADDR); > + env_t *env_ptr = (env_t *)env_sf_get_env_addr(); > > if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) { > gd->env_addr = (ulong)&(env_ptr->data); >