[U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug.
wd at denx.de
Thu Jan 25 21:33:51 CET 2007
In message <45B8D66A.6080209 at freescale.com> you wrote:
> > Can the instruction '
> > retval = (addr << 16) | (addr[(info->portwidth)] << 24) |
> > (addr[(2 * info->portwidth)]) | (addr[(3 *
> > info->portwidth)] << 8);'
> > In flash_read_long() be replaced by memcpy() function?
INHO: no, it cannot.
> If you want to read 32 bits at one time, then just do a 32-bit read!
> retval = * (ulong *) addr;
You assume that we want to read four contiguous bytes, which may, or
may not, be the case.
> Looking at the code, I don't understand why it's so complicated. If
> portwidth is 2, then retval above will be a conglomeration of addr,
> addr, addr, and addr. Why isn't it just reading from
Because the data we are interested in is only available in every
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The Gates in my computer are AND, OR and NOT; they are not Bill.
More information about the U-Boot