From mboxrd@z Thu Jan 1 00:00:00 1970 From: Haiying Wang Date: Fri, 09 Feb 2007 12:47:37 -0500 Subject: [U-Boot-Users] [PATCH 1/2] Add DO_SYNC at the end of flash_write_cmd In-Reply-To: <45C179F0.6050206@orkun.us> References: <45C05AF8.70709@orkun.us> <1170271527.3925.20.camel@udp097531uds.am.freescale.net> <45C179F0.6050206@orkun.us> Message-ID: <1171043258.3932.21.camel@udp097531uds.am.freescale.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Make sure the flash write command is fully finished and remove the unnecessary ssync operation which should be moved to it CPU header file Signed-off-by: Haiying Wang --- drivers/cfi_flash.c | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c index 696f9a4..c686e53 100644 --- a/drivers/cfi_flash.c +++ b/drivers/cfi_flash.c @@ -931,27 +931,18 @@ static void flash_write_cmd (flash_info_t * info, flash_sect_t sect, uint offset debug ("fwc addr %p cmd %x %x 8bit x %d bit\n", addr.cp, cmd, cword.c, info->chipwidth << CFI_FLASH_SHIFT_WIDTH); *addr.cp = cword.c; -#ifdef CONFIG_BLACKFIN - asm("ssync;"); -#endif break; case FLASH_CFI_16BIT: debug ("fwc addr %p cmd %x %4.4x 16bit x %d bit\n", addr.wp, cmd, cword.w, info->chipwidth << CFI_FLASH_SHIFT_WIDTH); *addr.wp = cword.w; -#ifdef CONFIG_BLACKFIN - asm("ssync;"); -#endif break; case FLASH_CFI_32BIT: debug ("fwc addr %p cmd %x %8.8lx 32bit x %d bit\n", addr.lp, cmd, cword.l, info->chipwidth << CFI_FLASH_SHIFT_WIDTH); *addr.lp = cword.l; -#ifdef CONFIG_BLACKFIN - asm("ssync;"); -#endif break; case FLASH_CFI_64BIT: #ifdef DEBUG @@ -966,11 +957,11 @@ static void flash_write_cmd (flash_info_t * info, flash_sect_t sect, uint offset } #endif *addr.llp = cword.ll; -#ifdef CONFIG_BLACKFIN - asm("ssync;"); -#endif break; } + + /* Ensure all the instruction are finished */ + DO_SYNC; } static void flash_unlock_seq (flash_info_t * info, flash_sect_t sect) -- 1.4.4.4