public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cfi: fix the incomplete erased status check in buffer write
@ 2012-02-19 11:48 htbegin
  2012-03-06 14:51 ` Stefan Roese
  0 siblings, 1 reply; 3+ messages in thread
From: htbegin @ 2012-02-19 11:48 UTC (permalink / raw)
  To: u-boot

Without the fix, flash_write_cfibuffer will return timeout error
instead of not-erased error when all bytes in the first word of
a sector are 0xFF and other words are not.

Signed-off-by: htbegin <hotforest@gmail.com>
Cc: Stefan Roese <sr@denx.de>
---
 drivers/mtd/cfi_flash.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 722c3fc..35294bc 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -873,7 +873,7 @@ static int flash_write_cfibuffer (flash_info_t * info, ulong dest, uchar * cp,
 	void *src = cp;
 	void *dst = (void *)dest;
 	void *dst2 = dst;
-	int flag = 0;
+	int flag = 1;
 	uint offset = 0;
 	unsigned int shift;
 	uchar write_cmd;
@@ -898,7 +898,7 @@ static int flash_write_cfibuffer (flash_info_t * info, ulong dest, uchar * cp,
 
 	cnt = len >> shift;
 
-	while ((cnt-- > 0) && (flag == 0)) {
+	while ((cnt-- > 0) && (flag == 1)) {
 		switch (info->portwidth) {
 		case FLASH_CFI_8BIT:
 			flag = ((flash_read8(dst2) & flash_read8(src)) ==
-- 
1.7.4.1

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

end of thread, other threads:[~2012-03-15 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19 11:48 [U-Boot] [PATCH] cfi: fix the incomplete erased status check in buffer write htbegin
2012-03-06 14:51 ` Stefan Roese
2012-03-15 15:33   ` [U-Boot] [PATCH v2] " htbegin

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