All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Wei <wei.zhang@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug.
Date: Fri, 22 Dec 2006 19:02:53 +0800	[thread overview]
Message-ID: <458BBB5D.1030005@freescale.com> (raw)
In-Reply-To: <20061222100020.D06E2352664@atlas.denx.de>

Hi, Wolfgang,

This cfi-flash issue was found in u-boot 1.1.6 top git tree. On our 
board (MPC8641HPCn), sometimes the u-boot will get the wrong 
'num_erase_regions' (0xff) when it boots up. It causes the u-boot can 
not find and access the flash. If I remove the patch -- '[PATCH] CFI 
driver AMD Command Set Top boot geometry reversal, etc.' from Stefan 
Roese <sr@denx.de> in Nov. 13, 2006. All of the flash in u-boot are OK.

That patch adds support for reading JEDEC Manufacturer ID and Device ID 
causes. -- function flash_read_jedec_ids(). In our board, we have 
'Spinsion S29GL064M90TFIR6' flash with 16bit width port connection. 
After perform flash_read_jedec_ids(), the cfi query read will get an 
'0xff'. From this flash's specification, the read for flash commands in 
16bit port connection should perform 16bit read and ignore the high 8bit 
data. Although this issue maybe occurs in the special chip, perform the 
fully 16bit read is a safety operation.

The modification refers to the cfi flash drivers in Linux kernel (The 
cfi_read_query() function in include/linux/mtd/cfi.h file). It's more 
easy and clear than making the different type date read for different 
portwidth (such as ushort_read() for x16, ulong_read() for x32).

Thanks!

Best Regards,
Zhang Wei

Wolfgang Denk wrote:
> In message <1166772458178-git-send-email-> you wrote:
>   
>> 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.
>>     
>
> Please explain under which circumstances you think this is necessary.
>
>   
>> 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);
>>     
>
> This most probably does NOT perform any ushort reads at all, but does
> a simple byte by byte copy, so your patch does not make much sense to
> me.
>
> Please explain in which sort of problems you see that are supposed to
> be fixed by this modification.
>
> Best regards,
>
> Wolfgang Denk
>
>   

  reply	other threads:[~2006-12-22 11:02 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-22  7:27 [U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug wei.zhang at freescale.com
2006-12-22 10:00 ` Wolfgang Denk
2006-12-22 11:02   ` Zhang Wei [this message]
2006-12-22 14:11     ` Wolfgang Denk
2006-12-22 16:34       ` [U-Boot-Users] 答复: " Zhang Wei-r63237
2006-12-22 17:17         ` Wolfgang Denk
2006-12-25  7:03           ` Zhang Wei
2006-12-25 23:24             ` Wolfgang Denk
2006-12-26  6:04               ` Zhang Wei
2007-01-04  2:07                 ` Zhang Wei-r63237
2007-01-04  8:17                   ` Wolfgang Denk
2007-01-04  8:36               ` Zhang Wei-r63237
2007-01-04  9:23                 ` Wolfgang Denk
2007-01-04 11:19                   ` Stefan Roese
2007-01-05 13:27                   ` Stefan Roese
2007-01-07 10:12                     ` Tolunay Orkun
2007-01-07 10:40                       ` Wolfgang Denk
2007-01-13  7:11                         ` Tolunay Orkun
2007-01-13 17:53                           ` Håvard Skinnemoen
2007-01-16  6:52                             ` Stefan Roese
2007-01-25  4:38                           ` Zhang Wei-r63237
2007-01-25 16:10                             ` Timur Tabi
2007-01-25 20:33                               ` Wolfgang Denk
2007-01-26  2:13                                 ` Zhang Wei-r63237
2007-01-29 11:29                                   ` Tolunay Orkun
2007-01-30  3:36                                     ` Wang Haiying-r54964
2007-01-31  9:01                                       ` Tolunay Orkun
2007-01-31 19:25                                         ` Haiying Wang
2007-02-01  5:26                                           ` Tolunay Orkun
2007-02-01 22:06                                             ` Haiying Wang
2007-02-01 22:52                                               ` Chris Fester
2007-02-09 17:47                                             ` [U-Boot-Users] [PATCH0/2] Re-do the patch for adding DO_SYNC in flash_write_cmd Haiying Wang
2007-02-09 19:42                                               ` Wolfgang Denk
2007-02-09 19:48                                                 ` Haiying Wang
2007-02-10  1:04                                                   ` Wolfgang Denk
2007-02-10  7:23                                                     ` Tolunay Orkun
2007-02-10  7:40                                                       ` Stefan Roese
2007-02-10  7:57                                                         ` Tolunay Orkun
2007-02-10  8:07                                                           ` Stefan Roese
2007-02-10 21:55                                                             ` Wolfgang Denk
2007-02-10 21:54                                                         ` Wolfgang Denk
2007-02-11  2:34                                                         ` Timur Tabi
2007-02-11 10:23                                                           ` Wolfgang Denk
2007-02-09 19:59                                                 ` Haavard Skinnemoen
2007-02-10  1:02                                                   ` Wolfgang Denk
2007-02-09 17:47                                             ` [U-Boot-Users] [PATCH 1/2] Add DO_SYNC at the end of flash_write_cmd Haiying Wang
2007-02-09 19:45                                               ` Wolfgang Denk
2007-02-09 17:47                                             ` [U-Boot-Users] [PATCH 2/2] Define DO_SYNC in each CPU's header file Haiying Wang
2007-02-09 19:46                                               ` Wolfgang Denk
2007-02-10  7:17                                                 ` Tolunay Orkun
2007-01-08  2:41                     ` [U-Boot-Users] [PATCH] Fixed cfi flash read uchar bug Zhang Wei-r63237
2006-12-22 17:07       ` Chris Fester
2006-12-22 17:24         ` Wolfgang Denk
2006-12-22 17:42           ` Chris Fester
2006-12-22 21:33             ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=458BBB5D.1030005@freescale.com \
    --to=wei.zhang@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.