summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-04-26 00:06:51 +0200
committerWolfgang Denk <wd@denx.de>2008-04-26 00:06:51 +0200
commitfe06d43b504af9ebc6c9bfe511853de6e42f257e (patch)
tree695953b85fda5b28f42f3c70e6cad05a08bb43d6
parent1d907e66fdd5d2f192a9f4fad6812ff0d0e9683a (diff)
parentc63ad6325a8ac0097a54b418a3288926b0484b18 (diff)
downloadu-boot-imx-fe06d43b504af9ebc6c9bfe511853de6e42f257e.zip
u-boot-imx-fe06d43b504af9ebc6c9bfe511853de6e42f257e.tar.gz
u-boot-imx-fe06d43b504af9ebc6c9bfe511853de6e42f257e.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flash
-rw-r--r--drivers/mtd/cfi_flash.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index e3cfb8a..68ab55f 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1873,6 +1873,12 @@ unsigned long flash_init (void)
{
unsigned long size = 0;
int i;
+#if defined(CFG_FLASH_AUTOPROTECT_LIST)
+ struct apl_s {
+ ulong start;
+ ulong size;
+ } apl[] = CFG_FLASH_AUTOPROTECT_LIST;
+#endif
#ifdef CFG_FLASH_PROTECTION
char *s = getenv("unlock");
@@ -1966,6 +1972,17 @@ unsigned long flash_init (void)
CFG_ENV_ADDR_REDUND + CFG_ENV_SIZE_REDUND - 1,
flash_get_info(CFG_ENV_ADDR_REDUND));
#endif
+
+#if defined(CFG_FLASH_AUTOPROTECT_LIST)
+ for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) {
+ debug("autoprotecting from %08x to %08x\n",
+ apl[i].start, apl[i].start + apl[i].size - 1);
+ flash_protect (FLAG_PROTECT_SET,
+ apl[i].start,
+ apl[i].start + apl[i].size - 1,
+ flash_get_info(apl[i].start));
+ }
+#endif
return (size);
}