[U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug.

wei.zhang at freescale.com
2006-12-22T07:27:38Z

From: Zhang Wei <wei.zhang@freescale.com>

For the flash of port width more than 8bit, a completetly read must be performed. For example, 16bit port width flash must perform a ushort read. Otherwise, some flashes will get error data.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
---
drivers/cfi_flash.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c
index 9b10220..f02b047 100644
--- a/drivers/cfi_flash.c
+++ b/drivers/cfi_flash.c
@@ -250,9 +250,9 @@ #endif
*/
inline uchar flash_read_uchar (flash_info_t * info, uint offset)
{
- uchar *cp;
+ uchar cp[FLASH_CFI_64BIT];

- cp = flash_make_addr (info, 0, offset);
+ memcpy(cp, flash_make_addr (info, 0, offset), info->portwidth);
#if defined(__LITTLE_ENDIAN)
return (cp[0]);
#else
--
1.4.0