aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2017-07-31 04:29:56 -0400
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-08-02 04:26:41 -0400
commita11bf5ed951f8900d244d09eb03a888b59c7fc82 (patch)
tree61568a8c8ddd9a22a48435a3ab81a1c4fcac296b
parentcb25fae18207330caac848d850e11f9cdb500dbf (diff)
mtd: nand: Fix timing setup for NANDs that do not support SET FEATURES
Some ONFI NANDs do not support the SET/GET FEATURES commands, which, according to the spec, is perfectly valid. On these NANDs we can't set a specific timing mode using the "timing mode" feature, and we should assume the NAND does not require any setup to enter a specific timing mode. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Fixes: d8e725dd8311 ("mtd: nand: automate NAND timings selection") Reported-by: Alexander Dahl <ada@thorsis.com> Cc: <stable@vger.kernel.org> Tested-by: Alexander Dahl <ada@thorsis.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
-rw-r--r--drivers/mtd/nand/nand_base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5b7c8d05360f..c6c18b82f8f4 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1131,7 +1131,9 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)
1131 * Ensure the timing mode has been changed on the chip side 1131 * Ensure the timing mode has been changed on the chip side
1132 * before changing timings on the controller side. 1132 * before changing timings on the controller side.
1133 */ 1133 */
1134 if (chip->onfi_version) { 1134 if (chip->onfi_version &&
1135 (le16_to_cpu(chip->onfi_params.opt_cmd) &
1136 ONFI_OPT_CMD_SET_GET_FEATURES)) {
1135 u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = { 1137 u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = {
1136 chip->onfi_timing_mode_default, 1138 chip->onfi_timing_mode_default,
1137 }; 1139 };