Some minor fixes to environment in NAND code.
authorMarkus Klotzbuecher <mk@denx.de>
Tue, 7 Mar 2006 23:04:04 +0000 (00:04 +0100)
committerMarkus Klotzbücher <mk@pollux.denx.de>
Tue, 7 Mar 2006 23:04:04 +0000 (00:04 +0100)
common/cmd_nvedit.c
common/env_nand.c

index 1babffec2e0a8fc322b2ac462635e41bef4eb57a..ecf1db489a478799be5bcb08b6099d33ed58b974 100644 (file)
@@ -532,7 +532,9 @@ int getenv_r (char *name, char *buf, unsigned len)
 
 #if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
     ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
-      (CFG_CMD_ENV|CFG_CMD_FLASH))
+      (CFG_CMD_ENV|CFG_CMD_FLASH)) || \
+    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \
+      (CFG_CMD_ENV|CFG_CMD_NAND))
 int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        extern char * env_name_spec;
@@ -588,7 +590,9 @@ U_BOOT_CMD(
 
 #if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
     ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
-      (CFG_CMD_ENV|CFG_CMD_FLASH))
+      (CFG_CMD_ENV|CFG_CMD_FLASH)) || \
+    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \
+      (CFG_CMD_ENV|CFG_CMD_NAND))
 U_BOOT_CMD(
        saveenv, 1, 0,  do_saveenv,
        "saveenv - save environment variables to persistent storage\n",
index 4896853530194ca0292ea83bf2bf139297b51275..4ae68c5a23e84892ed1580bffd06d1bafafb0038 100644 (file)
@@ -115,7 +115,7 @@ int saveenv(void)
        int     total, ret = 0;
 
        puts ("Erasing Nand...");
-       if (nand_erase(&nand_info[0], CFG_NEW_OFFSET, CFG_ENV_SIZE))
+       if (nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_SIZE))
                return 1;
 
        puts ("Writing to Nand... ");