summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorRajesh Bhagat <rajesh.bhagat@nxp.com>2018-11-05 18:01:15 +0000
committerYork Sun <york.sun@nxp.com>2018-12-04 13:07:36 -0800
commit119c01c2a571bb901dd0170b85924f74e362b75c (patch)
tree5a1923c704f44bb7bbabb6315393657738214f8c /env
parentb6cba297affba968a8d8465655c71cb3ec8a9bde (diff)
downloadu-boot-119c01c2a571bb901dd0170b85924f74e362b75c.tar.gz
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 <rajesh.bhagat@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'env')
-rw-r--r--env/sf.c9
1 files changed, 8 insertions, 1 deletions
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);