diff options
author | Kyungmin Park <kmpark@infradead.org> | 2008-03-31 10:40:36 +0900 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-04-13 23:11:16 -0700 |
commit | 77e475cc0ed1832160017d364be32a0be9ff02a9 (patch) | |
tree | 215da4c93ca7cac28eabd4e70fe1e70fc8e176f2 /drivers/mtd/onenand/onenand_base.c | |
parent | a9da2b41079d230db3a5641625311983f85ce1fb (diff) | |
download | u-boot-imx-77e475cc0ed1832160017d364be32a0be9ff02a9.zip u-boot-imx-77e475cc0ed1832160017d364be32a0be9ff02a9.tar.gz u-boot-imx-77e475cc0ed1832160017d364be32a0be9ff02a9.tar.bz2 |
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 <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/mtd/onenand/onenand_base.c')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 */ |