From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Tue, 06 Feb 2007 03:10:35 -0600 Subject: [U-Boot-Users] [PATCH] Add sync at the end of flash_write_cmd for MPC86xx In-Reply-To: <1170706772.3901.14.camel@udp097531uds.am.freescale.net> References: <1170706772.3901.14.camel@udp097531uds.am.freescale.net> Message-ID: <45C8460B.1060004@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Haiying Wang wrote: > 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) I think for consistency of the code, you should either relocate blackfin sync instruction to the end or add MPC86xx sync instructions to each case just like blackfin does. Having addressed that, I think this patch would be OK for me except that as you have probably seen the discussion in the list, it will be better to define SYNC macros in cpu architecture files and call SYNC; instead fo asm("sync;"); So, please create an independent patch that adds SYNC to all CPU architectures (dummy stub if architecture does not have such feature) and submit that patch first. Refer to other email for details. Right now all PowerPC variants and Blackfin needs this but more might come. Having submitted that patch, please modify this patch about to use SYNC; and submit as well. I know it is probably a bit more work than you wished for but we should do this the right way. Tolunay