From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dpCyU-0002LN-5Z for barebox@lists.infradead.org; Tue, 05 Sep 2017 12:29:04 +0000 From: Sascha Hauer Date: Tue, 5 Sep 2017 14:28:36 +0200 Message-Id: <20170905122836.14670-2-s.hauer@pengutronix.de> In-Reply-To: <20170905122836.14670-1-s.hauer@pengutronix.de> References: <20170905122836.14670-1-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/2] mtd: nand: nand_mxs: Don't call get/set features on chips which do not support it To: Barebox List 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 --- drivers/mtd/nand/nand_mxs.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c index cba0beedbb..110334d256 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); -- 2.11.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox