[PATCH 1/3] cfi_flash: add shift option for some cfi memory chips

Sascha Hauer s.hauer at pengutronix.de
Mon Apr 22 12:10:22 EDT 2013


On Mon, Apr 22, 2013 at 10:53:50AM +0200, Oleksij Rempel wrote:
> From: Oleksij Rempel <bug-track at fisher-privat.net>
> 
> diff --git a/drivers/nor/cfi_flash.h b/drivers/nor/cfi_flash.h
> index 8f818ba..6c7cac4 100644
> --- a/drivers/nor/cfi_flash.h
> +++ b/drivers/nor/cfi_flash.h
> @@ -295,7 +295,11 @@ static inline u64 flash_read64(void *addr)
>   */
>  static inline uchar *flash_make_addr (struct flash_info *info, flash_sect_t sect, uint offset)
>  {
> +#ifdef CONFIG_DRIVER_CFI_BANK_SHIFT_1
> +	return ((uchar *) (info->start[sect] + (offset * info->portwidth << 1)));
> +#else
>  	return ((uchar *) (info->start[sect] + (offset * info->portwidth)));
> +#endif
>  }

Please make this a runtime option configurable via platform data. Making
this a compile time option is not so nice.
Or could this be automatically detected?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list