From patchwork Fri Sep 29 10:38:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 114508 Delivered-To: patch@linaro.org Received: by 10.140.104.133 with SMTP id a5csp636540qgf; Fri, 29 Sep 2017 03:40:58 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDANBldzyIG0OZIsbecRfwjYdCobev50RIh0nu5eGUz3g6K8fcd80/p91Qoqjhrjp857sN1 X-Received: by 10.99.99.197 with SMTP id x188mr6881165pgb.38.1506681658916; Fri, 29 Sep 2017 03:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506681658; cv=none; d=google.com; s=arc-20160816; b=dglrbC4Mpt3f2MCS9tn6WSED+H1LX5ffvCiZ7qo1Dcdh6+kqDDZhAfGiL1mWCq3hEg NUks9HdArkSUccSt0VCmjNchemkS26htRKomjd2WGyEua5IkoX4u51h7UGTTbeC9P/n4 7BKo8YP0qJupUmyJnidFiigvp5ZVl9NXgpLcRTIlXzUryylzvK+7KL5zT3zZSC4pFKGA oWLkRiIDsUb5Hk4/x/q9qm7cx9lbTqaXJRwkP8cZ0LPySDz9A1+TCJh07qMCHt/spQf9 mR7m5hSj9yhhatUEB2pt/e29E3MqWbVWiDKviZgnHbH0QYck9mrCK/pmVPEKRd40I/as OxqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter:dkim-signature :arc-authentication-results; bh=vjybKI5BOE4AvHWmBQsJhh6CEcxJDVW25Ft/g3KO7Ik=; b=NKTu8NgcT1B5uN8sdL1cWpHUqwKrsqXGmRFJDgLNfA+i3g/hUK2/G6qbvDnrOw6cer EBs6BH1GtlaUmFG+Z05URVdQJ/tDtvjCyessmcJnlava5u9Tm6LnYd5CzjYxN+QofwnY YMDHIMKlGpjTbLR7GaB2oG1NX8Iz/aWPGVqjGQKCrlPpmlbdzpSfPTqK+PwdgF4NxGzv oGxBvsyWNYuZdMQbUUgDwEBwlvlwl0OYfhjW8I7mWs/UHA3b71OXpefklxRtDQdyv4uT 6/1PXn8jGfEhJS8iL15AKxNNP5iFk4rsAfj/A9C1MFOlrj6WVpZUvQzsKMJsWSa4HGeC 2djg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=ksUcbjmh; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=qpHjiCJF; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id f185si3208676pfa.471.2017.09.29.03.40.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 03:40:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=ksUcbjmh; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=qpHjiCJF; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vjybKI5BOE4AvHWmBQsJhh6CEcxJDVW25Ft/g3KO7Ik=; b=ksUcbjmhdXDbyLouwh5EfDapj6 6dbTAY7yVCLZmJBnOeSpxt4ApVlR7SoqTmnsDSTO+E/sMNzF6a1o32CdVw3HmPgyOkepMMbmBt8dR cWQ81cVjq19G5D45JxnIWwsY8VmB0EKA4wUAn66sT0hE37Qb1hawwr2vydnhDT+baU1b2rfJH9Mx5 Q3SyT26Oa1GL5fvwQe6n6sfX3Ra463KFh8/FJNkHAgZ9epX/gHFrKeo4JQAonCNudyl8sDS+G2ln6 gqZPcozpcGSukOlKKY/6B/db1TRy3QKwGlAicpxP5Pw5JgwKPHr04qfsDOvlv24F2ht+I83cru2sg Ztj6Obvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dxsiu-0000eJ-MA; Fri, 29 Sep 2017 10:40:48 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxshj-00074M-As for linux-mtd@lists.infradead.org; Fri, 29 Sep 2017 10:39:39 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v8TAcmAD012917; Fri, 29 Sep 2017 19:38:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v8TAcmAD012917 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1506681531; bh=tL4/ntMt/VMAHS0F4rQBe8JE+TBR4whS8LbNnR/jxuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qpHjiCJFxUYsRHGsayDoiyltuc1W0Q4ocNf153wTkcuQUxH7rJ+hE7gu8niBLcMhs tz6KXGMsmbuFEMIZ9wVciPmqcj73/hWi/DYec68rNEk5rafm7HHR2yiW3h0uyC6fEh d7RuIcA0MTexx5KDXEiTZSXk4Nchm+DzMNi54Iipfh+CALvgclqqFfFt9RtCa8ioo4 9EazMAlyEVnvHzHlrOUKMmWHU1OxgxBxt0zB02RlkYJL2ZXQzqu8xN0K4LiT5hDxmv pz5daOWP/O2BgIMS5JvGamMcls1pJHcLuPk7lDkDwO8i8f4FdHGPL7+oTZPN1mUtKK Jk8KVYqOqyauw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH v2 1/2] mtd: nand: wait for tWHR after NAND_CMD_STATUS / NAND_CMD_READID Date: Fri, 29 Sep 2017 19:38:39 +0900 Message-Id: <1506681520-13897-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506681520-13897-1-git-send-email-yamada.masahiro@socionext.com> References: <1506681520-13897-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_033935_763196_7E6EA0E7 X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Cyrille Pitchen , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org For commands such as Read Status, Read ID, etc. the controller needs to wait for tWHR before it reads out the first data. If the controller does not take care of it, the driver has to wait explicitly to make sure to meet the spec. Introduce NAND_WAIT_TWHR, which works like NAND_WAIT_TCCS. The driver can set this flag to let the core to handle the tWHR delay. Signed-off-by: Masahiro Yamada --- Changes in v2: - Add nand_whr_delay() helper Wait for tWHR only for drivers that explicitly set NAND_WAIT_TWHR flag drivers/mtd/nand/nand_base.c | 21 +++++++++++++++++++-- include/linux/mtd/rawnand.h | 13 ++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index b1cf32c..455085d 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -676,6 +676,17 @@ static void nand_wait_status_ready(struct mtd_info *mtd, unsigned long timeo) } while (time_before(jiffies, timeo)); }; +static void nand_whr_delay(struct nand_chip *chip) +{ + if (!(chip->options & NAND_WAIT_TWHR)) + return; + + if (chip->data_interface && chip->data_interface->timings.sdr.tWHR_min) + ndelay(chip->data_interface->timings.sdr.tWHR_min / 1000); + else + ndelay(200); +} + /** * nand_command - [DEFAULT] Send command to NAND device * @mtd: MTD device structure @@ -742,9 +753,12 @@ static void nand_command(struct mtd_info *mtd, unsigned int command, case NAND_CMD_ERASE1: case NAND_CMD_ERASE2: case NAND_CMD_SEQIN: + case NAND_CMD_SET_FEATURES: + return; + case NAND_CMD_STATUS: case NAND_CMD_READID: - case NAND_CMD_SET_FEATURES: + nand_whr_delay(chip); return; case NAND_CMD_RESET: @@ -871,9 +885,12 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, case NAND_CMD_ERASE1: case NAND_CMD_ERASE2: case NAND_CMD_SEQIN: + case NAND_CMD_SET_FEATURES: + return; + case NAND_CMD_STATUS: case NAND_CMD_READID: - case NAND_CMD_SET_FEATURES: + nand_whr_delay(chip); return; case NAND_CMD_RNDIN: diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 749bb08..bb0165b 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -213,13 +213,16 @@ enum nand_ecc_algo { /* * In case your controller is implementing ->cmd_ctrl() and is relying on the - * default ->cmdfunc() implementation, you may want to let the core handle the - * tCCS delay which is required when a column change (RNDIN or RNDOUT) is - * requested. - * If your controller already takes care of this delay, you don't need to set - * this flag. + * default ->cmdfunc() implementation, you may want to let the core handle + * some delays to meet the timing specification. + * If your controller already takes care of these delays, you don't need to set + * the following flags. */ + +/* tCCS for a column change (RNDIN or RNDOUT) */ #define NAND_WAIT_TCCS 0x00200000 +/* tWHR for STATUS, READID, etc. */ +#define NAND_WAIT_TWHR 0x00400000 /* Options set by nand scan */ /* Nand scan has allocated controller struct */ From patchwork Fri Sep 29 10:38:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 114507 Delivered-To: patch@linaro.org Received: by 10.140.104.133 with SMTP id a5csp635998qgf; Fri, 29 Sep 2017 03:40:20 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDeeLOp/idbV8kwJQ3xZZr+5k894MmVN8RTpnW+elvqGLUszx0DnSw3WSkMj24HAJyjjY1W X-Received: by 10.99.126.23 with SMTP id z23mr6874190pgc.148.1506681620558; Fri, 29 Sep 2017 03:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506681620; cv=none; d=google.com; s=arc-20160816; b=N4FX08N+kiyjw+4vKVny2nx9CDwhLiP6xUGoF1dz89YNZixsUvB35y++tYhKkERXDH zVgOctuyAJ1oejZXBOBe8KudRhKT2IBRNBLP657+D5d2pO4ROtojXAoUS4rSZ8YAWbm7 V0m0usSypmOxVC5Ha1Jc/Sxx4VyUZa01Qm7Ffmwg6QMW9/otE3Knf8zflQDBMo7qMvfT w5CS3XKYwB9p6D0G6oXApppvvqvlrgyH5Yyc2lk2wcEx+Pgl1vIKSf59fEKm0GA/bGk7 q1yToWEqjjZndW6BUuE1PHZgUFQuK0b5DbQcpPnVGZUWJYkLcT3M92GXKgst8BM+1Flz hXRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter:dkim-signature :arc-authentication-results; bh=18RWRyA24m1SXk7++Aw9Zm6uiwuFu3fFOpLbupGZNPA=; b=EMkPpVcGUXTiTNh6d2CVAGsAO4LEvW6zPfl2WuoVE+7cF0PxbrSssWtDHfPDyRMf6f d9CYtRnTGuDAS7UpMAhoi6xDLkD8xUN8PoOnFLVtglQ/gY0W9I52h9dG9glOf5AqlLNg BuUlA0dIOOS2V5d7wZjwJR9S3VbCwXu6RNLb09ILWePrvPicej2Goh0qR2E5hFIv9Q4d mpt3AUyYL8Fx8W86Osps7U0FdW3rqm24bzFKqLnDZ9l63obc5hXhNY27C2yfTDml11tW ArNKLlalZFz259C+FXRQQ269VNVCjR5+7Rd+B0JAx8z+aENDDqsib0welbnHG9bMV3CM SP/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=MTz0jz3H; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=a73tbuZd; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id h12si3273016pgn.674.2017.09.29.03.40.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 03:40:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=MTz0jz3H; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=a73tbuZd; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=18RWRyA24m1SXk7++Aw9Zm6uiwuFu3fFOpLbupGZNPA=; b=MTz0jz3HpoO4+vyoGTngimk6BK uu9BCt+EXvN9a/ZMl+55Om4WLQwfMAoT8TUHaTw7Eop5gmZ14MSJFwsWtKQ/E+tVtOCbqe5KZ5etk Lol8Gu0xGhsrtSjbU5afNMYWw0yKiCkYgwUgUKGtsJVDugLDiwYufM+Iq8VHpgDNh6s/SoIHFaUzS pY8W8EFK/+V4xMkwJBrGaj7wZfdiM5uWXatTkzbnYRYhOzzE3kFQSXBhvzlr+C+o5BBQKpDNTqTt7 vc5on7Nv/iI+CJIbbqdlGZE9r6o/qoc21h4xZ5nInUiBvFsLwZTRczCBCB4pXpkXnmxbAj97upgM4 EMLZtqrA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dxsiL-0007ut-67; Fri, 29 Sep 2017 10:40:13 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxshj-00074L-At for linux-mtd@lists.infradead.org; Fri, 29 Sep 2017 10:39:38 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v8TAcmAE012917; Fri, 29 Sep 2017 19:38:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v8TAcmAE012917 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1506681532; bh=zlxOzCkD3gpdN2Qo0dot9t3jZv4BCOTETbWnwUt/p3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a73tbuZdHdJEPxwOztdivmGfrEfrZ1zF/+QdUyo0eBn9mAXx0ZCWq9OPz2uuRYUem lN+LoWpFxpghb+1JZjthX+o7/EJU7kgWIS1iuie3fjNbwnTpoeAtuOARNmc5OrK59A 55QNsM3Sq1R0CrjGJ0a/yNYFPRitEoYCOtgoitoiRGM7kyP0xOfXs0Bp2Xbx9RR92u HE7YBwdKQbWghWNhl9WhnanvGo9XkPtMnOEAkNsJSb4TgrND8nXVlytWW5yI4PTZuO TrnFV+JS+j80d8spAF4YnersrKmvCz71mRqfmgo8Va/+vnXcW+Ygi8NEnaQev3pPK+ iOOxcTH/fO0Vw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH v2 2/2] mtd: nand: denali: fix setup_data_interface to meet tCCS delay Date: Fri, 29 Sep 2017 19:38:40 +0900 Message-Id: <1506681520-13897-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506681520-13897-1-git-send-email-yamada.masahiro@socionext.com> References: <1506681520-13897-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_033935_797716_41C8F864 X-CRM114-Status: GOOD ( 10.04 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Cyrille Pitchen , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The WE_2_RE register specifies the number of clock cycles inserted between the rising edge of #WE and the falling edge of #RE. The current setup_data_interface implementation takes care of tWHR, but tCCS is missing. Wait max(tCSS, tWHR) to meet the spec. With setup_data_interface() is properly programmed, the Denali NAND controller can observe the timing, so NAND_WAIT_{TCCS,TWHR} flag is unneeded. Say this in the comment block. Signed-off-by: Masahiro Yamada --- Changes in v2: - newly added drivers/mtd/nand/denali.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 0b268ec..332c022 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1004,8 +1004,14 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr, tmp |= FIELD_PREP(RE_2_RE__VALUE, re_2_re); iowrite32(tmp, denali->reg + RE_2_RE); - /* tWHR -> WE_2_RE */ - we_2_re = DIV_ROUND_UP(timings->tWHR_min, t_clk); + /* + * tCCS, tWHR -> WE_2_RE + * + * With WE_2_RE properly set, the Denali controller automatically takes + * care of tCCS, tWHR; the driver need not set NAND_WAIT_{TCCS,TWHR}. + */ + we_2_re = DIV_ROUND_UP(max(timings->tCCS_min, timings->tWHR_min), + t_clk); we_2_re = min_t(int, we_2_re, TWHR2_AND_WE_2_RE__WE_2_RE); tmp = ioread32(denali->reg + TWHR2_AND_WE_2_RE);