mtd: nand: mxs invalidate dcache before DMA read
[oweals/u-boot.git] / common / env_nand.c
index 9c9bb82c0faf81f3d6d6295f99ecfcfd3a1cea2b..92e0e053dfe6b57abe49156bc246e780089a4af0 100644 (file)
@@ -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)