is there a bug in cfi_flash.c
Hi,
There might be a bug in the code for reading status register in cfi_flash driver. In the function "flash_isset" it's directly read as reading from memory. But in intel's data sheet (for 28F640C3T) reading status register is described as below.
Read Status Register
The status register indicates the status of device operations, and the
success/failure of that
operation. The Read Status Register (0x70) command causes subsequent
reads to output data from
the status register until another command is issued. To return to
reading from the array, issue a
Read Array (0xFF) command.
So before reading for SR, "Read Status Register" (0x70) command must be written to the flash.
But I think this driver is beeing used by several boards. So if this driver is tested and it's working, I should be missing something?
What am I missing?
Thank you.
Yusuf
Software Eng. - Aselsan Inc.
######################################################################
Dikkat:
Bu elektronik posta mesaji kisisel ve ozeldir. Eger size gonderilmediyse lutfen gondericiyi bilgilendirip mesaji siliniz. Firmamiza gelen ve giden mesajlar virus taramasindan gecirilmekte, guvenlik nedeni ile kontrol edilerek saklanmaktadir. Mesajdaki gorusler ve bakis acisi gondericiye ait olup Aselsan A.S. resmi gorusu olmak zorunda degildir.
######################################################################
Attention:
This e-mail message is privileged and confidential. If you are not the intended recipient please delete the message and notify the sender. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices. Any views or opinions presented are solely those of the author and do not necessarily represent the views of the company.
######################################################################
Yusuf> There might be a bug in the code for reading status register Yusuf> in cfi_flash driver. In the function "flash_isset" it's Yusuf> directly read as reading from memory. But in intel's data Yusuf> sheet (for 28F640C3T) reading status register is described as Yusuf> below.
Yusuf> Read Status Register
Yusuf> The status register indicates the status of device
Yusuf> operations, and the
Yusuf> success/failure of that
Yusuf> operation. The Read Status Register (0x70) command causes
Yusuf> subsequent
Yusuf> reads to output data from
Yusuf> the status register until another command is issued. To
Yusuf> return to
Yusuf> reading from the array, issue a
Yusuf> Read Array (0xFF) command.
Yusuf> So before reading for SR, "Read Status Register" (0x70) Yusuf> command must be written to the flash.
After write/erase/protect operations, flash is already in "read status" mode so no additional command is necessary.
Yusuf> But I think this driver is beeing used by several boards. So Yusuf> if this driver is tested and it's working, I should be Yusuf> missing something?
On Intel flashes, it's very simple to issue commands and see results by using md/mw U-Boot commands. You are trying to unprotect sector at 0xFF000000. So try:
md ff000000
mw.l ff000000 60606060
mw.l ff000000 d0d0d0d0
md ff000000
First md should show the flash contents, second md should show status on one half of the bus (80808080 if there were no errors) and the flash contents on another half. If this does not work, you either have got flash write access problem (check the WE# line) or the flash must be accessed by single 64-bit write. In the latter case, CFI driver won't work.
Signature · 4 lines
======================================================================== Yuli Barcohen | Phone +972-9-765-1788 | Software Project Leader yuli at arabellasw.com | Fax +972-9-765-7494 | Arabella Software, Israel ========================================================================