Skip to contentSkip to conversation

Fix OneNAND read

PATCH New Kyungmin Park 2 participants 2 messages Mar 31, 2008 – Apr 14, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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.

---

drivers/mtd/onenand/onenand_base.c +13 -0
index 3b828fb..174384e 100644
@@ -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 */
#1 lore raw

PATCH 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.

---

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.