Fix OneNAND read
authorKyungmin Park <kmpark@infradead.org>
Mon, 31 Mar 2008 01:40:36 +0000 (10:40 +0900)
committerWolfgang Denk <wd@denx.de>
Mon, 14 Apr 2008 06:11:16 +0000 (23:11 -0700)
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 <kyungmin.park@samsung.com>
drivers/mtd/onenand/onenand_base.c

index 3b828fb62729034c8f6f5de06ed146dc1f487224..174384eab98d03131d150ce027e481189736b0ee 100644 (file)
 #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 */