aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJoe Schultz <jschultz@xes-inc.com>2014-04-07 12:58:18 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-05-20 20:36:34 -0400
commit2170480487e3dee8a74204ce346b1b1096a13fd0 (patch)
tree12075dbaf7acb4a16d76c84c771c43eccdaaecef /drivers/mtd
parent4454406e378722d09431aca194103aa3075c6468 (diff)
mtd: fsl_ifc_nand: Workaround bogus WP on 16-bit NAND
A workaround was already in place that set the WP bit in the IFC_CSPR0 register after a STATUS command, however it used an 8-bit write method. As a result, the WP bit was never set on 16-bit devices, and these devices would eventually be incorrectly marked as write-protected. This patch checks the chip options for a 16-bit device and uses the appropriate write method to set the WP bit after a STATUS command. Signed-off-by: Joe Schultz <jschultz@xes-inc.com> Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/fsl_ifc_nand.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 8ed0ee1cfee1..2338124dd05f 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -591,7 +591,10 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
591 * The chip always seems to report that it is 591 * The chip always seems to report that it is
592 * write-protected, even when it is not. 592 * write-protected, even when it is not.
593 */ 593 */
594 setbits8(ifc_nand_ctrl->addr, NAND_STATUS_WP); 594 if (chip->options & NAND_BUSWIDTH_16)
595 setbits16(ifc_nand_ctrl->addr, NAND_STATUS_WP);
596 else
597 setbits8(ifc_nand_ctrl->addr, NAND_STATUS_WP);
595 return; 598 return;
596 599
597 case NAND_CMD_RESET: 600 case NAND_CMD_RESET: