aboutsummaryrefslogtreecommitdiff
path: root/env/flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'env/flash.c')
-rw-r--r--env/flash.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/env/flash.c b/env/flash.c
index 004e884..dcf3cd2 100644
--- a/env/flash.c
+++ b/env/flash.c
@@ -75,28 +75,28 @@ int env_init(void)
if (crc1_ok && !crc2_ok) {
gd->env_addr = addr1;
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
} else if (!crc1_ok && crc2_ok) {
gd->env_addr = addr2;
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
} else if (!crc1_ok && !crc2_ok) {
gd->env_addr = addr_default;
gd->env_valid = 0;
} else if (flag1 == ACTIVE_FLAG && flag2 == OBSOLETE_FLAG) {
gd->env_addr = addr1;
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
} else if (flag1 == OBSOLETE_FLAG && flag2 == ACTIVE_FLAG) {
gd->env_addr = addr2;
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
} else if (flag1 == flag2) {
gd->env_addr = addr1;
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
} else if (flag1 == 0xFF) {
gd->env_addr = addr1;
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
} else if (flag2 == 0xFF) {
gd->env_addr = addr2;
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
}
return 0;
@@ -211,7 +211,7 @@ int env_init(void)
{
if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
gd->env_addr = (ulong)&(env_ptr->data);
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
return 0;
}
@@ -309,7 +309,7 @@ void env_relocate_spec(void)
crc32(0, flash_addr_new->data, ENV_SIZE) == flash_addr_new->crc) {
char flag = OBSOLETE_FLAG;
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
flash_sect_protect(0, (ulong)flash_addr_new, end_addr_new);
flash_write(&flag,
(ulong)&(flash_addr_new->flags),
@@ -321,7 +321,7 @@ void env_relocate_spec(void)
(flash_addr->flags & ACTIVE_FLAG) == ACTIVE_FLAG) {
char flag = ACTIVE_FLAG;
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
flash_sect_protect(0, (ulong)flash_addr, end_addr);
flash_write(&flag,
(ulong)&(flash_addr->flags),
@@ -329,7 +329,7 @@ void env_relocate_spec(void)
flash_sect_protect(1, (ulong)flash_addr, end_addr);
}
- if (gd->env_valid == 2)
+ if (gd->env_valid == ENV_REDUND)
puts("*** Warning - some problems detected "
"reading environment; recovered successfully\n\n");
#endif /* CONFIG_ENV_ADDR_REDUND */