From patchwork Fri Sep 29 14:12:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 114521 Delivered-To: patch@linaro.org Received: by 10.140.104.133 with SMTP id a5csp844646qgf; Fri, 29 Sep 2017 07:14:08 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBuLvWjgKGAPxpKrZH1U00U5LPH2X3tRShmAKKaKl9LUNmNJvQ6VNz4hO4tDplu0nOqI3hc X-Received: by 10.84.238.201 with SMTP id l9mr6956944pln.159.1506694448267; Fri, 29 Sep 2017 07:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506694448; cv=none; d=google.com; s=arc-20160816; b=uaGBln/giSzbSwxaGo3hetuPxiN4FQW/Ha3lBqQcJlJClFAtJTD3dSWQfqJOui94F/ h6zSnTwg68Sk//kBbqZIlZobxIc+kjsZ87Ki/CsRHWLWn2PAt4tw20Zu9E4wvkJJ57+W lnpEJMT1Mwe1drTOv3LubTCxxXEt5lwxBuLbsHEQYRcvzrzhApsUYqVXVyI8eHLDNAQk 4h398m+TUlUzE3/gUidgV6zahmtbGolzS+7OOy5xnHPuxmk3kN6DalnV/WfZGTLx6sSi k3nGMEiKu66ssWOAqV+MX4ta5DrCFty7wRrlgJDlgycOPXboLYEm7Q5nYglDS2hdh7Cv JUug== 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:message-id:date:subject:to:from:dkim-signature :dkim-filter:dkim-signature:arc-authentication-results; bh=W5s+XqUVd4f7p49Ff3aCgao7vpRKPHnYtyJ0Cao3Yyw=; b=QhGqcEoakG6+/xvZEfAE+4Msn89bZ+TdpYd9lKAAek5ayan0QExs4LuOJVSQKOmXXz R32f351r6n7t3ISX6l2qIROjLEBRXU/M2L1yPGJ21CcZhSECE7IfE4sxVvI3/OjkESch efrGKbzCkuJ1V3wo9szu0oCo2HKkt6E+eZ232Ws5PHHb7gdcyM17Lzy8QrwztGvFhyob wvRdKRMKdh0MLOBNzi3fgmLE7Wr6dZwtt4AGk+EeuqdS0+0+QDoo5WonpuuyQNBd46+p 1s1/qWba/UEC2FvRi1Jmyiqk+tK85GdkKZKLz3QHopZvok9bItwoy9azid+QFoLv4lBe UoNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=e9/JnjWu; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=lXjONqrd; 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 e127si3479552pfc.168.2017.09.29.07.14.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 07:14:08 -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=e9/JnjWu; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=lXjONqrd; 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: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:In-Reply-To: References:List-Owner; bh=W5s+XqUVd4f7p49Ff3aCgao7vpRKPHnYtyJ0Cao3Yyw=; b=e9/ JnjWuS/f/3loZ4CEvs0SiUT7k931ww5QHmdd1CC3bvJXYgStKnMXi0oJoLndRoCyys35zG1Gia9Cs owsX+ZJ+xOgFqYZc0Brp9d+KZPt2dKDAY6gpD03xwcVMTetTk+ZK+05Tf2l6bIv5eInZlJ+QK7bSD 6VEp4vX2pXnRNjoI22dCcHrMLf8NbxsMNp/r/Av0v0ava0ph/KKWF83FAb3uFSKw62409KACt5xVi Bpdmp+54b7GCKhtjSRS216WRgKsiM7pF5I2xHfgmavIssI1G0Lh7YfcwXYUjBj0CpM1g0v0UZevHi YlwcpauN9XQ8TlCflt+xwd6WEgnidjA==; 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 1dxw3E-0006Lc-CD; Fri, 29 Sep 2017 14:14:00 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxw36-0006Jw-NV for linux-mtd@lists.infradead.org; Fri, 29 Sep 2017 14:13:58 +0000 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8TED5Xj024360; Fri, 29 Sep 2017 23:13:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8TED5Xj024360 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1506694386; bh=vLtrEyE/3ZbScLFlM+9LxAmSsJF7yT1Eom6OtcKUsqc=; h=From:To:Cc:Subject:Date:From; b=lXjONqrd5FlZAY0Fb8kaZ8sgc8VKGkP537rlAzTK6Y3E+Go848dlIqEoncRyR9K2y kObWjJ1X8naGVY02a89At1S0QNI22OCaQxEWJaw6IqruWir3VEKoc+zYWBaQ6WCCEi iUyQ7zqh//paIT1Qj07Jp1NlOhE62aJnqxKDmjxtOTpchktsTrGJDcLpJwbFVmjiGs XtGiGU4K30H5AgLFDgDLszYUkgglOKspTiJ5bwR+PoSgHR+trxxW/bs5jXFbytxyvx 7cKidjgfR6d6VENdqEmbhzzIxRTnJ2O3chGPSXPxwSqMmB8IrlI0agBZxR1pR+RfS+ MzMW8+n2TWfYg== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH v3] mtd: nand: denali: fix setup_data_interface to meet tCCS delay Date: Fri, 29 Sep 2017 23:12:57 +0900 Message-Id: <1506694377-8531-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_071353_027284_23D3E8BE X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. 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 for max(tCSS, tWHR) to meet the spec. With setup_data_interface() properly programmed, the Denali NAND controller can observe the timing, so NAND_WAIT_TCCS flag is unneeded. Clarify this in the comment block. Signed-off-by: Masahiro Yamada --- Changes in v3: - Remove comment abount NAND_WAIT_TWHR because 1/2 seems NACK 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..5124f8a 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 the delay; the driver need not set NAND_WAIT_TCCS. + */ + 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);