aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/env_nand.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/env_nand.c b/common/env_nand.c
index 9c9bb82c0fa..92e0e053dfe 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -233,6 +233,12 @@ int saveenv(void)
}
#endif /* CMD_SAVEENV */
+#if defined(CONFIG_SPL_BUILD)
+static int readenv(size_t offset, u_char *buf)
+{
+ return nand_spl_load_image(offset, CONFIG_ENV_SIZE, buf);
+}
+#else
static int readenv(size_t offset, u_char *buf)
{
size_t end = offset + CONFIG_ENV_RANGE;
@@ -266,6 +272,7 @@ static int readenv(size_t offset, u_char *buf)
return 0;
}
+#endif /* #if defined(CONFIG_SPL_BUILD) */
#ifdef CONFIG_ENV_OFFSET_OOB
int get_nand_env_oob(nand_info_t *nand, unsigned long *result)