From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Fri, 22 Dec 2006 11:00:20 +0100 Subject: [U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug. In-Reply-To: Your message of "Fri, 22 Dec 2006 15:27:38 +0800." <1166772458178-git-send-email-> Message-ID: <20061222100020.D06E2352664@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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