/* Pretend that the image is bad. */
gd->flags &= ~GD_FLG_ENV_READY;
- gd->env_valid = 0;
+ gd->env_valid = ENV_INVALID;
ret_val = env_get(name);
gd->env_valid = really_valid;
gd->flags = real_gd_flags;
set_default_env("!bad CRC");
return 0;
} else if (crc1_ok && !crc2_ok) {
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
} else if (!crc1_ok && crc2_ok) {
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
} else {
/* both ok - check serial */
if (tmp_env1->flags == 255 && tmp_env2->flags == 0)
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
else if (tmp_env2->flags == 255 && tmp_env1->flags == 0)
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
else if (tmp_env1->flags > tmp_env2->flags)
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
else if (tmp_env2->flags > tmp_env1->flags)
- gd->env_valid = 2;
+ gd->env_valid = ENV_REDUND;
else /* flags are equal - almost impossible */
- gd->env_valid = 1;
+ gd->env_valid = ENV_VALID;
}
- if (gd->env_valid == 1)
+ if (gd->env_valid == ENV_VALID)
ep = tmp_env1;
else
ep = tmp_env2;
env_reloc();
env_htab.change_ok += gd->reloc_off;
#endif
- if (gd->env_valid == 0) {
+ if (gd->env_valid == ENV_INVALID) {
#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_SPL_BUILD)
/* Environment not changable */
set_default_env(NULL);
if (!crc_ok[0] && !crc_ok[1]) {
gd->env_addr = 0;
- gd->env_valid = 0;
+ gd->env_valid = ENV_INVALID;
} else if (crc_ok[0] && !crc_ok[1]) {
gd->env_valid = ENV_VALID;
} else if (!crc_ok[0] && crc_ok[1]) {
}
if (crc == new) {
- gd->env_valid = ENV_VALID;
+ gd->env_valid = ENV_VALID;
} else {
- gd->env_valid = 0;
+ gd->env_valid = ENV_INVALID;
}
#endif /* CONFIG_ENV_OFFSET_REDUND */
gd->env_valid = ENV_VALID;
} else if (!crc1_ok && !crc2_ok) {
gd->env_addr = addr_default;
- gd->env_valid = 0;
+ gd->env_valid = ENV_INVALID;
} else if (flag1 == ACTIVE_FLAG && flag2 == OBSOLETE_FLAG) {
gd->env_addr = addr1;
gd->env_valid = ENV_VALID;
}
gd->env_addr = (ulong)&default_environment[0];
- gd->env_valid = 0;
+ gd->env_valid = ENV_INVALID;
return 0;
}
#endif