diff options
author | Rajesh Bhagat <rajesh.bhagat@nxp.com> | 2018-11-05 21:01:15 +0300 |
---|---|---|
committer | York Sun <york.sun@nxp.com> | 2018-12-05 00:07:36 +0300 |
commit | 119c01c2a571bb901dd0170b85924f74e362b75c (patch) | |
tree | 5a1923c704f44bb7bbabb6315393657738214f8c | |
parent | b6cba297affba968a8d8465655c71cb3ec8a9bde (diff) | |
download | u-boot-119c01c2a571bb901dd0170b85924f74e362b75c.tar.xz |
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>
-rw-r--r-- | env/sf.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); |