Skip to contentSkip to conversation

Add sync at the end of flash_write_cmd for [...]

PATCH New OTRS Notification Master 1 participant 1 message Feb 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add sync at the end of flash_write_cmd for [...]

Hello list,

inside the automatic U-Boot patch tracking system a new ticket [DNX#2007020542000021] was created:

<snip>

Quoted 30 lines

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

---
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(-)
drivers/cfi_flash.c +0 -0
index 696f9a4..a93e94d 100644
@@ -971,6 +971,9 @@ static void flash_write_cmd (flash_info_t * info,

flash_sect_t sect, uint offset
#endif

drivers/cfi_flash.c

Quoted 8 lines
drivers/cfi_flash.c +3 -0
 		break;
 	}
+#ifdef CONFIG_MPC86xx
+	asm("sync;");
+#endif
 }
 
 static void flash_unlock_seq (flash_info_t * info, flash_sect_t sect)

</snip>

Your U-Boot support team