Fix OneNAND read
PATCH 1/1 Fix OneNAND read
It should access with 16-bit instead of 8-bit
Now it uses the generic memcpy with 8-bit access. It means it reads wrong data from OneNAND.
Signed-off-by Kyungmin Park <[email protected]>
---
drivers/mtd/onenand/onenand_base.c +13 -0
@@ -20,6 +20,19 @@#include <asm/io.h> #include <asm/errno.h> +/* It should access 16-bit instead of 8-bit */ +static inline void *memcpy (void *dst,const void *src,unsigned int len) +{ +void *ret = dst; +short *d = dst; +const short *s = src; + + len >>=1 ; +while (len-- >0 ) + *d++ = *s++; +return ret; +} +static const unsigned char ffchars[] = {0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,/* 16 */
Wolfgang Denk
AppliedPATCH 1/1 Fix OneNAND read
drivers/mtd/onenand/onenand_base.c
Quoted 7 lines · In message <20080331014036.GA30866@party> you wrote:
It should access with 16-bit instead of 8-bit
Now it uses the generic memcpy with 8-bit access. It means it reads wrong data from OneNAND.
Signed-off-by Kyungmin Park <[email protected]>---
drivers/mtd/onenand/onenand_base.c +0
-0
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de It is easier to write an incorrect program than understand a correct one.