public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] CFI: Fix AMD Legacy sector protect
@ 2008-08-19 16:53 Tsi-Chung Liew
  2008-08-20 12:31 ` Stefan Roese
  0 siblings, 1 reply; 2+ messages in thread
From: Tsi-Chung Liew @ 2008-08-19 16:53 UTC (permalink / raw)
  To: u-boot

From: TsiChung Liew <Tsi-Chung.Liew@freescale.com>

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>
---
 drivers/mtd/cfi_flash.c |   12 +++++++++---
 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 =
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] CFI: Fix AMD Legacy sector protect
  2008-08-19 16:53 [U-Boot] [PATCH] CFI: Fix AMD Legacy sector protect Tsi-Chung Liew
@ 2008-08-20 12:31 ` Stefan Roese
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2008-08-20 12:31 UTC (permalink / raw)
  To: u-boot

On Tuesday 19 August 2008, Tsi-Chung Liew wrote:
> From: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
>
> 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)

Applied to u-boot-cfi-flash. Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-20 12:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 16:53 [U-Boot] [PATCH] CFI: Fix AMD Legacy sector protect Tsi-Chung Liew
2008-08-20 12:31 ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox