Commit a11bf5ed authored by Boris Brezillon's avatar Boris Brezillon

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: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Fixes: d8e725dd ("mtd: nand: automate NAND timings selection")
Reported-by: default avatarAlexander Dahl <ada@thorsis.com>
Cc: <stable@vger.kernel.org>
Tested-by: default avatarAlexander Dahl <ada@thorsis.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent cb25fae1
...@@ -1131,7 +1131,9 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr) ...@@ -1131,7 +1131,9 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)
* Ensure the timing mode has been changed on the chip side * Ensure the timing mode has been changed on the chip side
* before changing timings on the controller side. * before changing timings on the controller side.
*/ */
if (chip->onfi_version) { if (chip->onfi_version &&
(le16_to_cpu(chip->onfi_params.opt_cmd) &
ONFI_OPT_CMD_SET_GET_FEATURES)) {
u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = { u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = {
chip->onfi_timing_mode_default, chip->onfi_timing_mode_default,
}; };
......
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