Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21704804 authored by Joe Schultz's avatar Joe Schultz Committed by Brian Norris
Browse files

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: default avatarJoe Schultz <jschultz@xes-inc.com>
Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 4454406e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -591,6 +591,9 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
		 * The chip always seems to report that it is
		 * write-protected, even when it is not.
		 */
		if (chip->options & NAND_BUSWIDTH_16)
			setbits16(ifc_nand_ctrl->addr, NAND_STATUS_WP);
		else
			setbits8(ifc_nand_ctrl->addr, NAND_STATUS_WP);
		return;