From: Rajesh Bhagat Date: Mon, 5 Nov 2018 18:01:15 +0000 (+0000) Subject: env: sf: define API to override sf environment address X-Git-Tag: v2019.01-rc2~11^2~42 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=119c01c2a571bb901dd0170b85924f74e362b75c;p=oweals%2Fu-boot.git env: sf: define API to override sf environment address Defines env_sf_get_env_addr API to override sf environment address, required to support multiple environment. Signed-off-by: Rajesh Bhagat Reviewed-by: York Sun --- 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);