diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-05 14:28:36 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-06 14:42:06 +0200 |
commit | 6e72ee196f8859a99f40de6993f577adacb1e9fb (patch) | |
tree | 40e4cac16688e719511b712c2004775369721db9 /drivers | |
parent | 665a276f479b525802498d462a7bb7e45a72d5d1 (diff) | |
download | barebox-6e72ee196f8859a99f40de6993f577adacb1e9fb.tar.gz barebox-6e72ee196f8859a99f40de6993f577adacb1e9fb.tar.xz |
mtd: nand: nand_mxs: Don't call get/set features on chips which do not support it
Older versions of the ONFI spec do not support get/set features, so
do not call these commands when they are not available.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/nand_mxs.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c index b5890858a6..337748af48 100644 --- a/drivers/mtd/nand/nand_mxs.c +++ b/drivers/mtd/nand/nand_mxs.c @@ -2030,19 +2030,23 @@ static int mxs_nand_enable_edo_mode(struct mxs_nand_info *info) nand->select_chip(mtd, 0); - /* [1] send SET FEATURE commond to NAND */ - feature[0] = mode; + if (le16_to_cpu(nand->onfi_params.opt_cmd) + & ONFI_OPT_CMD_SET_GET_FEATURES) { - ret = nand->onfi_set_features(mtd, nand, + /* [1] send SET FEATURE commond to NAND */ + feature[0] = mode; + + ret = nand->onfi_set_features(mtd, nand, ONFI_FEATURE_ADDR_TIMING_MODE, feature); - if (ret) - goto err_out; + if (ret) + goto err_out; - /* [2] send GET FEATURE command to double-check the timing mode */ - ret = nand->onfi_get_features(mtd, nand, + /* [2] send GET FEATURE command to double-check the timing mode */ + ret = nand->onfi_get_features(mtd, nand, ONFI_FEATURE_ADDR_TIMING_MODE, feature); - if (ret || feature[0] != mode) - goto err_out; + if (ret || feature[0] != mode) + goto err_out; + } nand->select_chip(mtd, -1); |