Commit f0bc0c77 authored by Chuanxiao Dong's avatar Chuanxiao Dong Committed by David Woodhouse

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: default avatarChuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent b292c341
...@@ -169,13 +169,11 @@ static void read_status(struct denali_nand_info *denali) ...@@ -169,13 +169,11 @@ static void read_status(struct denali_nand_info *denali)
/* initialize the data buffer to store status */ /* initialize the data buffer to store status */
reset_buf(denali); reset_buf(denali);
/* initiate a device status read */ cmd = ioread32(denali->flash_reg + WRITE_PROTECT);
cmd = MODE_11 | BANK(denali->flash_bank); if (cmd)
index_addr(denali, cmd | COMMAND_CYCLE, 0x70); write_byte_to_buf(denali, NAND_STATUS_WP);
iowrite32(cmd | STATUS_CYCLE, denali->flash_mem); else
write_byte_to_buf(denali, 0);
/* update buffer with status value */
write_byte_to_buf(denali, ioread32(denali->flash_mem + 0x10));
} }
/* resets a specific device connected to the core */ /* resets a specific device connected to the core */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment