From 00fb2b714e07e8b8c6cb2045f8a2331ae0a94ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Fri, 30 Jul 2010 20:29:27 +0000 Subject: [PATCH] issue CFI_INTEL_CMD_WRITE_TO_BUFFER when polling SR_READY in buffered write (Michael Walle) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1815 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/flash/intel.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 9635bf6d..258725d5 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,8 @@ +2010-07-30 Arnim Laeuger + + * src/flash/intel.c: issue CFI_INTEL_CMD_WRITE_TO_BUFFER when polling + SR_READY in buffered write (Michael Walle) + 2010-07-30 Mike Frysinger * include/urjtag/cable.h (URJ_CABLE_PARAM_KEY): Add new cable params for tdi, diff --git a/urjtag/src/flash/intel.c b/urjtag/src/flash/intel.c index 2bd9f4ae..d5811dd8 100644 --- a/urjtag/src/flash/intel.c +++ b/urjtag/src/flash/intel.c @@ -341,9 +341,10 @@ intel_flash_program_buffer (urj_flash_cfi_array_t *cfi_array, /* issue command WRITE_TO_BUFFER */ URJ_BUS_WRITE (bus, cfi_array->address, CFI_INTEL_CMD_CLEAR_STATUS_REGISTER); - URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_WRITE_TO_BUFFER); /* poll XSR7 == 1 */ - while (!((sr = URJ_BUS_READ (bus, cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ + do { + URJ_BUS_WRITE (bus, adr, CFI_INTEL_CMD_WRITE_TO_BUFFER); + } while (!((sr = URJ_BUS_READ (bus, cfi_array->address) & 0xFE) & CFI_INTEL_SR_READY)); /* TODO: add timeout */ /* write count value (number of upcoming writes - 1) */ URJ_BUS_WRITE (bus, adr, wcount - 1);