Re[2]: [PATCH 1/3] cfi_flash: add shift option for some cfi memory chips
Alexander Shiyan
shc_work at mail.ru
Mon Apr 22 12:18:31 EDT 2013
> 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?
Do not treat my opinion as solution but I think better if we
make this option as integer as make it available always.
In this case we can avoid using #ifdef.
---
More information about the barebox
mailing list