index 35a1955e63..63aced9317 100644
--- a/env/fat.c
+++ b/env/fat.c
-@@ -29,6 +29,36 @@
- # endif
+@@ -29,6 +29,34 @@
+ # define LOADENV
#endif
-+#if defined(CMD_SAVEENV) || defined(CMD_LOADENV)
+__weak int mmc_get_env_dev(void)
+{
+#ifdef CONFIG_SYS_MMC_ENV_DEV
+ return CONFIG_ENV_FAT_DEVICE_AND_PART;
+#endif
+}
-+#endif
+
- #ifdef CMD_SAVEENV
static int env_fat_save(void)
{
+ env_t __aligned(ARCH_DMA_MINALIGN) env_new;
@@ -43,7 +71,7 @@ static int env_fat_save(void)
return err;