public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] Fix OneNAND read
@ 2008-03-31  1:40 Kyungmin Park
  2008-04-14  6:33 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Kyungmin Park @ 2008-03-31  1:40 UTC (permalink / raw)
  To: u-boot

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>
---
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 3b828fb..174384e 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -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 */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-14  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-31  1:40 [U-Boot-Users] [PATCH] Fix OneNAND read Kyungmin Park
2008-04-14  6:33 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox