From 77e475cc0ed1832160017d364be32a0be9ff02a9 Mon Sep 17 00:00:00 2001 From: Kyungmin Park Date: Mon, 31 Mar 2008 10:40:36 +0900 Subject: [PATCH] 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 --- drivers/mtd/onenand/onenand_base.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 3b828fb627..174384eab9 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -20,6 +20,19 @@ #include #include +/* 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 */ -- 2.25.1