From: Markus Klotzbuecher Date: Tue, 7 Mar 2006 23:04:04 +0000 (+0100) Subject: Some minor fixes to environment in NAND code. X-Git-Tag: LABEL_2006_03_12_0025~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3c4eb0880b5ea7c928e9abed943b3b0e0abf2de6;p=u-boot Some minor fixes to environment in NAND code. --- diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 1babffec2e..ecf1db489a 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -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", diff --git a/common/env_nand.c b/common/env_nand.c index 4896853530..4ae68c5a23 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -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... ");