From patchwork Fri Jun 22 16:06:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 139720 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1052896lji; Fri, 22 Jun 2018 09:08:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIpVEtqFrqg5AOuIAQq4Ct7/AGGRTGKXMoOfUIXTzPMJC+Pzjwguwt6PWRtZCF5OqOoulqA X-Received: by 2002:a17:902:9344:: with SMTP id g4-v6mr2360074plp.10.1529683710387; Fri, 22 Jun 2018 09:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529683710; cv=none; d=google.com; s=arc-20160816; b=u8GhTLeZZAjVFCyTLbspuK5OsUNPDs/Gsy6eFi0xoqdaiwu36Sz2glhSi5IxHGCfks 2UdKShNjHcHXVolqZw9AcoTcb2Jz+0c2l9EZAZ38mD037fLueaG5OgyoP39krwpVG8/5 XWQBxj/5CKqJJ4WBollS1TSBi702z7r4V6bNbRrGWHlMakDKmkRCpXi5Kky/Pl/5yZvA JDzyaGJVez7z+Lt9AEOTvR6Mk2I5QT5+A9r29uEiOv2lIHNJrnnkGth7qDHLePiJPLV0 vs3gYzAnj9n8KdmoHskR/Gpf25G28ThYylipOE8qeNMCgYLWUyTBazFOnFa5RDyfKtr7 4irg== 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=iMjIWWeV2XpZEmXv3JBbwGvSNCZo1ZIBE7/jBbGPAaU=; b=hfr1PUldZSgVcwpP1omVIInyV034rM3GBMVrJ0ZASsgvh4IpzRyu/8HGxq6z9nfljr DeEP3XDdkuZdQY1DUb3io7hMTF0fxcijOXi1zOD+PFIfmkCd2c4roRzZX1GUILnS0XpW Nm0iBMLyQjbEz6ST74gQ02w6C8gnK0Ja9XKuV5nhQtCg2f3m33dUrwh2fv4N9rsJJuVH ziW2suuzh98ltoXApDUyqGwVKfGhzvnCUhwB1DmRFwZHLYWAUU0tRlz/My7VlW3V7/t4 pv2+OMT+I08eyGhcfjakwwMx0lxI0f1UDKOU/j6zK8kzpBpnW9TmQNPA8lrk2+clfVDZ 6D/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=PpO26CF1; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=bCryuHPB; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::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. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id v190-v6si7538166pfv.48.2018.06.22.09.08.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Jun 2018 09:08:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=PpO26CF1; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=bCryuHPB; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::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=iMjIWWeV2XpZEmXv3JBbwGvSNCZo1ZIBE7/jBbGPAaU=; b=PpO26CF1S3TD1p/HszYlCH/Bn4 e2K0byu14c2Z98QIkiievv1+6uCYjh1a26dWDe1ootvfhw6Fu9uigydBAJu/lRtGyADJgoUCGPi9R Dezri90YyruOO2juNRH3ei0WetH+18q9CBB9AwrflEoz8egS8WFsq0kYQHHTdIXPn29xR/uBxp5S0 tnpbn2Nwol2sy+2GjdwLHmSJxX9tLS4ObAV7N06ot62BqBE7TDo8DpEMHYtCNzEr4IVZJmXs1A55s qlBDjDBDsoSxTyDtWclsSfW046vcmabJdAXLwZkyIUzU6t4S8EMqwsrPdH5XYEK1TK/kwU1XOUJtk 3524aBDg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fWObg-0006L5-2K; Fri, 22 Jun 2018 16:08:16 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fWOak-0005q3-TV for linux-mtd@lists.infradead.org; Fri, 22 Jun 2018 16:07:23 +0000 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-12.nifty.com with ESMTP id w5MG6m5b022587; Sat, 23 Jun 2018 01:06:49 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w5MG6m5b022587 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1529683610; bh=pdf/O8QHUqt1xQlmY1D7Yg8YTRJXS1L0AwRzgL1wC9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCryuHPBgmvG8KxL/cqaGRl4BiQyssZDN+L8N6z6U1z39WHatKlJl7hpPKXvI0Lz1 jwPsLnWmW3THSiyNfqf+1rN2iw0sF5Ksqdlf7oRn30I12B8rJKQle6XD6NySU4FAfZ fQmmKDCjS52N8nkqWU1iKMQbwtz35+4ImX8nWh87OmhHi8r46lqzNBlKR8zdFZypGv 7cV7p+CiakuEmPG1cz8D9jNrOsSfB5HdWqODeNSyL80CoGePqBWJiEq7v/Y2gU4S/1 lqQmQufTFndeQkTGBBLxa6q1e5Z1yYwirI+3a2DWMOGqW/wPCIbCkB0/5lfozYlkVY A08KBZn3+OsRA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon Subject: [PATCH v4 1/5] mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally Date: Sat, 23 Jun 2018 01:06:34 +0900 Message-Id: <1529683598-25783-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529683598-25783-1-git-send-email-yamada.masahiro@socionext.com> References: <1529683598-25783-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180622_090719_346684_82AE4982 X-CRM114-Status: GOOD ( 11.31 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [210.131.2.79 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, "linux-stable #4 . 14+" , Masahiro Yamada , Rob Herring , Miquel Raynal , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Since commit 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()"), denali_dt.c gets the clock rate from the clock driver. The driver expects the frequency of the bus interface clock, whereas the clock driver of SOCFPGA provides the core clock. Thus, the setup_data_interface() hook calculates timing parameters based on a wrong frequency. To make it work without relying on the clock driver, hard-code the clock frequency, 200MHz. This is fine for existing DT of UniPhier, and also fixes the issue of SOCFPGA because both platforms use 200 MHz for the bus interface clock. Fixes: 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()") Cc: linux-stable #4.14+ Reported-by: Philipp Rosenberger Suggested-by: Boris Brezillon Signed-off-by: Masahiro Yamada Tested-by: Richard Weinberger --- Changes in v4: - split into a very simple patch for backport candiate drivers/mtd/nand/raw/denali_dt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c index cfd33e6..5869e90 100644 --- a/drivers/mtd/nand/raw/denali_dt.c +++ b/drivers/mtd/nand/raw/denali_dt.c @@ -123,7 +123,11 @@ static int denali_dt_probe(struct platform_device *pdev) if (ret) return ret; - denali->clk_x_rate = clk_get_rate(dt->clk); + /* + * Hardcode the clock rate for the backward compatibility. + * This works for both SOCFPGA and UniPhier. + */ + denali->clk_x_rate = 200000000; ret = denali_init(denali); if (ret)