mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-16 23:07:00 +00:00
Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flash
This commit is contained in:
commit
fe06d43b50
1 changed files with 17 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue