Skip to contentSkip to conversation

NAND: Fix saving of redundand environment

PATCH New Alexander Holler 2 participants 2 messages Jan 20, 2011 – Jan 26, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NAND: Fix saving of redundand environment

When redundand environments are used the serial needs to get increased, otherwise the old one will still be used.

---
 common/env_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/env_nand.c +1 -1
index 2682f07..a4480cb 100644
@@ -205,7 +205,7 @@ int saveenv(void)
 		return 1;
 	}
 	env_new.crc   = crc32(0, env_new.data, ENV_SIZE);
-	env_new.flags = ACTIVE_FLAG;
+	++env_new.flags; /* increase the serial */
 
 	if(gd->env_valid == 1) {
 		puts("Erasing redundant NAND...\n");
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 NAND: Fix saving of redundand environment

Quoted 13 lines · Alexander Holler

When redundand environments are used the serial needs to get increased, otherwise the old one will still be used.

---
 common/env_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/env_nand.c +0 -0
index 2682f07..a4480cb 100644

common/env_nand.c int saveenv(void) · line 211

Quoted 8 lines
common/env_nand.c +1 -1
@@ -205,7 +205,7 @@ int saveenv(void)
 		return 1;
 	}
 	env_new.crc   = crc32(0, env_new.data, ENV_SIZE);
-	env_new.flags = ACTIVE_FLAG;
+	++env_new.flags; /* increase the serial */
 
 	if(gd->env_valid == 1) {
 		puts("Erasing redundant NAND...\n");

Applied to u-boot-nand-flash.

Looks like this got broken in ea882baf9c17cd142c99e3ff640d3ab01daa5cec (New implementation for internal handling of environment variables.)

Which made lots of style changes at the same time as functional, making it hard to see what else of substance was changed. :-(

-Scott