[U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug.

Wolfgang Denk
2006-12-22T10:00:20Z

In message <1166772458178-git-send-email-> you wrote:
>
> For the flash of port width more than 8bit, a completetly read must
> be performed. For example, 16bit port width flash must perform a
> ushort read. Otherwise, some flashes will get error data.

Please explain under which circumstances you think this is necessary.

> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> ---
> drivers/cfi_flash.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c
> index 9b10220..f02b047 100644
> --- a/drivers/cfi_flash.c
> +++ b/drivers/cfi_flash.c
> @@ -250,9 +250,9 @@ #endif
> */
> inline uchar flash_read_uchar (flash_info_t * info, uint offset)
> {
> - uchar *cp;
> + uchar cp[FLASH_CFI_64BIT];
>
> - cp = flash_make_addr (info, 0, offset);
> + memcpy(cp, flash_make_addr (info, 0, offset), info->portwidth);

This most probably does NOT perform any ushort reads at all, but does
a simple byte by byte copy, so your patch does not make much sense to
me.

Please explain in which sort of problems you see that are supposed to
be fixed by this modification.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The last thing one knows in constructing a work is what to put first.
- Blaise Pascal