[U-Boot-Users] [PATCH] Add sync at the end of flash_write_cmd for MPC86xx

Tolunay Orkun listmember at orkun.us
Tue Feb 6 10:10:35 CET 2007


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





More information about the U-Boot mailing list