diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cfi_flash.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c index fcf213c..c46ac24 100644 --- a/drivers/cfi_flash.c +++ b/drivers/cfi_flash.c @@ -338,6 +338,21 @@ unsigned long flash_init (void) &flash_info[0]); #endif + /* Environment protection ON by default */ +#ifdef CFG_ENV_IS_IN_FLASH + flash_protect (FLAG_PROTECT_SET, + CFG_ENV_ADDR, + CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1, + &flash_info[0]); +#endif + + /* Redundant environment protection ON by default */ +#ifdef CFG_ENV_ADDR_REDUND + flash_protect (FLAG_PROTECT_SET, + CFG_ENV_ADDR_REDUND, + CFG_ENV_ADDR_REDUND + CFG_ENV_SIZE_REDUND - 1, + &flash_info[0]); +#endif return (size); } |