From patchwork Sat Mar 29 13:36:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Sittig X-Patchwork-Id: 334967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0393114007F for ; Sun, 30 Mar 2014 00:37:48 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTtRt-0003Gf-IU; Sat, 29 Mar 2014 13:37:25 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTtRn-0007cP-Mi; Sat, 29 Mar 2014 13:37:19 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTtRi-0007ZX-5b for linux-mtd@lists.infradead.org; Sat, 29 Mar 2014 13:37:15 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3fx1Dg551lz4KK47; Sat, 29 Mar 2014 14:36:35 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3fx1Dg4v6Tzbbcr; Sat, 29 Mar 2014 14:36:35 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id XMDULC5I-nDh; Sat, 29 Mar 2014 14:36:34 +0100 (CET) X-Auth-Info: 1dBHwlMzcoEAq+eIOvyZFNHN6MrT71nL6veyua1U320= Received: from localhost (kons-4d03fcb4.pool.mediaWays.net [77.3.252.180]) by mail.mnet-online.de (Postfix) with ESMTPA; Sat, 29 Mar 2014 14:36:34 +0100 (CET) From: Gerhard Sittig To: linux-mtd@lists.infradead.org Subject: [PATCH v1 2/3] mtd: nand: re-introduce command bits masking Date: Sat, 29 Mar 2014 14:36:23 +0100 Message-Id: <1396100184-7110-3-git-send-email-gsi@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396100184-7110-1-git-send-email-gsi@denx.de> References: <1396100184-7110-1-git-send-email-gsi@denx.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140329_093714_417992_09A97EE1 X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.18.0.9 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Gerhard Sittig , Brian Norris , David Woodhouse , Pekon Gupta , Alexander Shiyan X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org re-introduce the mask operation which was removed in fb066adadd22 "mtd: nand_base: Removed unnecessary command masking" after the DEPLETE1 command has gone and the masking no longer was strictly required keeping the operation here is cheap and does not influence behaviour as long as all passed in command opcodes are within a byte's range pending introduction of on-die-ECC support needs a "READMODE" command, which shares a lot of the READ0 code path, yet would require duplication or open coding if "READMODE" aka "READ0 exclusively" cannot be told from "READPAGE" aka "the READ0 and READSTART sequence" (the "READPAGE" and "READMODE" terms are coined in Micron datasheets) Signed-off-by: Gerhard Sittig --- drivers/mtd/nand/nand_base.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 567620e81ce2..9ae99c1ba772 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -671,8 +671,14 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, command = NAND_CMD_READ0; } - /* Command latch cycle */ - chip->cmd_ctrl(mtd, command, NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE); + /* + * Command latch cycle, send the command's lower bits to the chip, + * followed by optional address specs and subsequent commands, + * while the command's higher bits might modify the below + * post-processing and delay logic + */ + chip->cmd_ctrl(mtd, command & 0xff, + NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE); if (column != -1 || page_addr != -1) { int ctrl = NAND_CTRL_CHANGE | NAND_NCE | NAND_ALE;