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);