Skip to content

Commit

Permalink
mtd: nand: Fix timing setup for NANDs that do not support SET FEATURES
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: d8e725d ("mtd: nand: automate NAND timings selection")
Reported-by: Alexander Dahl <[email protected]>
Cc: <[email protected]>
Tested-by: Alexander Dahl <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
  • Loading branch information
Boris Brezillon committed Aug 2, 2017
1 parent cb25fae commit a11bf5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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] = {
chip->onfi_timing_mode_default,
};
Expand Down

0 comments on commit a11bf5e

Please sign in to comment.