aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.com>2010-08-11 05:14:59 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-08-12 06:10:37 -0400
commitf0bc0c778fe12e43658193fae975fc5762e98773 (patch)
tree9d387a0de47c05cfef548cdaa149317aeb8ab51c
parentb292c341e2304b1d937843711c63d1e141d7b589 (diff)
nand/denali: change read_status function method
In mtd->write, Denali controller will use MODE_11 mode to read NAND flash status, then return back to MODE_1O mode to do page write. Here comes a bug for this kind of using, sometimes controller will not write data to NAND and just return a good interrupt to tell driver writing work is done. The data in this page is all 0xff and this page can not be written again. The reason is unknow. So read Denali controller register WRITE_PROTECT to get NAND status instead. Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--drivers/mtd/nand/denali.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 3ba89525cf07..975a89351f97 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -169,13 +169,11 @@ static void read_status(struct denali_nand_info *denali)
169 /* initialize the data buffer to store status */ 169 /* initialize the data buffer to store status */
170 reset_buf(denali); 170 reset_buf(denali);
171 171
172 /* initiate a device status read */ 172 cmd = ioread32(denali->flash_reg + WRITE_PROTECT);
173 cmd = MODE_11 | BANK(denali->flash_bank); 173 if (cmd)
174 index_addr(denali, cmd | COMMAND_CYCLE, 0x70); 174 write_byte_to_buf(denali, NAND_STATUS_WP);
175 iowrite32(cmd | STATUS_CYCLE, denali->flash_mem); 175 else
176 176 write_byte_to_buf(denali, 0);
177 /* update buffer with status value */
178 write_byte_to_buf(denali, ioread32(denali->flash_mem + 0x10));
179} 177}
180 178
181/* resets a specific device connected to the core */ 179/* resets a specific device connected to the core */