public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] Add sync at the end of flash_write_cmd for MPC86xx
@ 2007-02-05 20:19 Haiying Wang
  2007-02-05 21:01 ` Andrew Dyer
  2007-02-06  9:10 ` Tolunay Orkun
  0 siblings, 2 replies; 8+ messages in thread
From: Haiying Wang @ 2007-02-05 20:19 UTC (permalink / raw)
  To: u-boot

Add sync at the end of flash_write_cmd for MPC86xx
to ensure write command are really finished before reading data

Signed-off-by: Haiying Wang <haiying.wang@freescale.com>
---
According to Tolunay's first suggestion, this patch for cfi_flash
driver fixed the flash operation error on MPC8641HPCN board. Since there
is not such flash error reported on 85xx, 83xx platform and as Tolunay
said, there is not a PowerPC macro to define, I just use CONFIG_MPC86xx
for now. I also tested his second suggestion(adding udelay directly
after reset command), but flash still failed to work. 

Based on my tests before (I added udelay after the flash_write_cmd()
which switched flash to CFI read mode, and it worked as well) and the
test with this patch, I think that most possible fix of this issue should
be that we should make sure command has been fully executed before
return to data read mode(as in his first suggestion). So please review
this patch below:

 drivers/cfi_flash.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c
index 696f9a4..a93e94d 100644
--- a/drivers/cfi_flash.c
+++ b/drivers/cfi_flash.c
@@ -971,6 +971,9 @@ static void flash_write_cmd (flash_info_t * info, flash_sect_t sect, uint offset
 #endif
 		break;
 	}
+#ifdef CONFIG_MPC86xx
+	asm("sync;");
+#endif
 }
 
 static void flash_unlock_seq (flash_info_t * info, flash_sect_t sect)

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

end of thread, other threads:[~2007-02-06 11:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-05 20:19 [U-Boot-Users] [PATCH] Add sync at the end of flash_write_cmd for MPC86xx Haiying Wang
2007-02-05 21:01 ` Andrew Dyer
2007-02-05 21:11   ` Haavard Skinnemoen
2007-02-06  7:06     ` Stefan Roese
2007-02-06  8:50       ` Tolunay Orkun
2007-02-06 11:31         ` Haavard Skinnemoen
2007-02-05 21:11   ` Haiying Wang
2007-02-06  9:10 ` Tolunay Orkun

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