summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-08-21 00:46:12 +0200
committerWolfgang Denk <wd@denx.de>2008-08-21 00:46:12 +0200
commit2141ece5c1acf45d78daa580d56d47d1594c28bc (patch)
tree7167db4425f53f799f630f00631c83f7dec8dd8d /drivers
parent9ba404dd59c14149f7a5338af1b5fe52558415da (diff)
parent9e8e63cce69556aef10b58bcbc56d324f570ec3a (diff)
downloadu-boot-imx-2141ece5c1acf45d78daa580d56d47d1594c28bc.zip
u-boot-imx-2141ece5c1acf45d78daa580d56d47d1594c28bc.tar.gz
u-boot-imx-2141ece5c1acf45d78daa580d56d47d1594c28bc.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/cfi_flash.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 58295fe..03ea2d0 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1357,6 +1357,7 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
switch (info->vendor) {
case CFI_CMDSET_INTEL_PROG_REGIONS:
case CFI_CMDSET_INTEL_STANDARD:
+ case CFI_CMDSET_INTEL_EXTENDED:
flash_write_cmd (info, sector, 0,
FLASH_CMD_CLEAR_STATUS);
flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT);
@@ -1369,9 +1370,6 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
break;
case CFI_CMDSET_AMD_EXTENDED:
case CFI_CMDSET_AMD_STANDARD:
-#ifdef CONFIG_FLASH_CFI_LEGACY
- case CFI_CMDSET_AMD_LEGACY:
-#endif
/* U-Boot only checks the first byte */
if (info->manufacturer_id == (uchar)ATM_MANUFACT) {
if (prot) {
@@ -1392,6 +1390,15 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
}
}
break;
+#ifdef CONFIG_FLASH_CFI_LEGACY
+ case CFI_CMDSET_AMD_LEGACY:
+ flash_write_cmd (info, sector, 0, FLASH_CMD_CLEAR_STATUS);
+ flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT);
+ if (prot)
+ flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT_SET);
+ else
+ flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
+#endif
};
if ((retcode =