<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.28">
<TITLE>´ð¸´: [U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug. </TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi, Wolfgang,<BR>
<BR>
Yes, the memcpy() is just a byte copy. But a x16 read can be emulated by two x8 read. And in fact, the flash_read_ushort(), flash_read_long() in cfi_flash.c are using the same implementation.<BR>
<BR>
In addition, the original code only reads 8bit, not the full 16bit. My patch ensures the full 16bit data are read completely.<BR>
<BR>
Thanks!<BR>
<BR>
Best Regards,<BR>
Zhang Wei<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Wolfgang Denk [<A HREF="mailto:wd@denx.de">mailto:wd@denx.de</A>]<BR>
Sent: 2006-12-22 (ÐÇÆÚÎå) 22:11<BR>
To: Zhang Wei-r63237<BR>
Cc: u-boot-users@lists.sourceforge.net<BR>
Subject: Re: [U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug.<BR>
<BR>
In message <458BBB5D.1030005@freescale.com> you wrote:<BR>
><BR>
> After perform flash_read_jedec_ids(), the cfi query read will get an<BR>
> '0xff'. From this flash's specification, the read for flash commands in<BR>
> 16bit port connection should perform 16bit read and ignore the high 8bit<BR>
> data. Although this issue maybe occurs in the special chip, perform the<BR>
> fully 16bit read is a safety operation.<BR>
<BR>
But your patch does NOT perform a 16 bit read. It calls memcpy(); the<BR>
default implementation of memcpy [see lib_generic/string.c] does this:<BR>
<BR>
char *tmp = (char *) dest, *s = (char *) src;<BR>
<BR>
while (count--)<BR>
*tmp++ = *s++;<BR>
<BR>
i. e. it performs a character copy, too, so it makes no difference<BR>
compared to the original code.<BR>
<BR>
> The modification refers to the cfi flash drivers in Linux kernel (The<BR>
> cfi_read_query() function in include/linux/mtd/cfi.h file). It's more<BR>
> easy and clear than making the different type date read for different<BR>
> portwidth (such as ushort_read() for x16, ulong_read() for x32).<BR>
<BR>
I understand your intentions, but your patch does not do what you<BR>
think it does, so if it really fixes the problem on your system there<BR>
must be another cause or effect.<BR>
<BR>
Best regards,<BR>
<BR>
Wolfgang Denk<BR>
<BR>
--<BR>
Software Engineering: Embedded and Realtime Systems, Embedded Linux<BR>
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de<BR>
Emotions are alien to me. I'm a scientist.<BR>
-- Spock, "This Side of Paradise", stardate 3417.3<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>