env: Rename the redundancy flags
Add an ENV prefix to these two flags so that it is clear what they relate
to. Also move them to env.h since they are part of the public API. Use an
enum rather than a #define to tie them together.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/env/eeprom.c b/env/eeprom.c
index 8d82cf8..91ee3f3 100644
--- a/env/eeprom.c
+++ b/env/eeprom.c
@@ -132,9 +132,11 @@
gd->env_valid = ENV_REDUND;
} else {
/* both ok - check serial */
- if (flags[0] == ACTIVE_FLAG && flags[1] == OBSOLETE_FLAG)
+ if (flags[0] == ENV_REDUND_ACTIVE &&
+ flags[1] == ENV_REDUND_OBSOLETE)
gd->env_valid = ENV_VALID;
- else if (flags[0] == OBSOLETE_FLAG && flags[1] == ACTIVE_FLAG)
+ else if (flags[0] == ENV_REDUND_OBSOLETE &&
+ flags[1] == ENV_REDUND_ACTIVE)
gd->env_valid = ENV_REDUND;
else if (flags[0] == 0xFF && flags[1] == 0)
gd->env_valid = ENV_REDUND;
@@ -194,7 +196,7 @@
unsigned int off = CONFIG_ENV_OFFSET;
#ifdef CONFIG_ENV_OFFSET_REDUND
unsigned int off_red = CONFIG_ENV_OFFSET_REDUND;
- char flag_obsolete = OBSOLETE_FLAG;
+ char flag_obsolete = ENV_REDUND_OBSOLETE;
#endif
rc = env_export(&env_new);
@@ -207,7 +209,7 @@
off_red = CONFIG_ENV_OFFSET;
}
- env_new.flags = ACTIVE_FLAG;
+ env_new.flags = ENV_REDUND_ACTIVE;
#endif
rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,