summaryrefslogtreecommitdiff
path: root/drivers/mtd/cfi_flash.c
diff options
context:
space:
mode:
authorTsiChung Liew <Tsi-Chung.Liew@freescale.com>2008-08-19 16:53:39 (GMT)
committerStefan Roese <sr@denx.de>2008-08-20 12:21:46 (GMT)
commit4e00acded2e6a8d663e12690a0f0f08f5bec5a58 (patch)
treecfdfca31c7c5178367198241220678d906df97e5 /drivers/mtd/cfi_flash.c
parentfcd69a1a57fb2af4d26201422095a4be9f36963e (diff)
downloadu-boot-fsl-qoriq-4e00acded2e6a8d663e12690a0f0f08f5bec5a58.tar.xz
CFI: Fix AMD Legacy sector protect
New implement sector lock and unlock or softlock commands do not exist in AMD legacy flash. Thus, causing issue when erasing AMD legacy flash (such as lv040) Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/mtd/cfi_flash.c')
-rw-r--r--drivers/mtd/cfi_flash.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 58295fe..a412938 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1369,9 +1369,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 +1389,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 =