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) From patchwork Fri Jun 22 16:06:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 139718 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1052282lji; Fri, 22 Jun 2018 09:07:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJw5czic4caTCaUz3D1AWmGu4CRuQEqwfFJWd4PPEbcbCJsi9R0H5+ALRCQdiCxm2up7Jyp X-Received: by 2002:a65:520c:: with SMTP id o12-v6mr1974986pgp.15.1529683677475; Fri, 22 Jun 2018 09:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529683677; cv=none; d=google.com; s=arc-20160816; b=XwT3afNVbwLSs4+8QV1TmcbWsF04WLUCIpv1HRLWmNPQtz1fRnfOlYI9MoDNbkoISn 29B0zxOvfyIn8jUnWkXLJUbn0BNs+RySEMzH4f6GxQqejftlLCRhaleekN0xkMhyYrnf JXhqmQ7iMr272G529+xPXrtRW4FinfZBKOc/qJlaM+SVaFOJPDV55LHbZx359mknyhmY 0XC8BksIxrDWf/wedY9JLMqrkKwf+nYcr6sNJBZE/oo6nb3YP+t7oYyJXbXN2Z1UiJT1 ykcDu5I6OQ6abymff0lEqzNMYV99ONJrrFDGAGrIGpx8ksc4+pIa1Nnm7j8C91BY2uTp t1kg== 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=xQQAknxwOCLmWJUJ6Dyg3IAX8lHyiLN9Auivr74xet8=; b=p+qeoq8/7mZ8kZMoZp55vsGWv7qDZaQhRusBhkqqhejECECp0fTc310C+8cuJe9h4w TJZSr0UTB/4V5uTDx0pzKIGGFMfZiaifWMn0g2B/r/aH21f/2Z15cAJzgGWGPk3mcQs5 T3jt5p+ef7t6tHIniUCZtkclLeI88R56dz15it1bxtw5mBpHwKVRyIElBCUZ7ZmKck+V OFcywVGqmOTQYiLNrNg+A6Xff9JudBMqwiAaAG53r7ud0nMnvOEcV8+B9S7qVAY6kvJr WLrYXDCEdFWgnFQp42MxIakOBeq8w/mXVaSOrcjgMAOhZOocp4YdEJkVojdVjCDXnzbb 0yXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=goAz8kDF; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=AQczH5FQ; 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 187-v6si6412875pgi.254.2018.06.22.09.07.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Jun 2018 09:07:57 -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=goAz8kDF; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=AQczH5FQ; 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=xQQAknxwOCLmWJUJ6Dyg3IAX8lHyiLN9Auivr74xet8=; b=goAz8kDFii7OWcMGvUxv0ccHNj RhYeFH168o4OJD3e9JVOT6LG5PW+rxC6W/QGbL+JywvqcFt1Pcvs7a2k9XcHP8u8hAb+kefRMvmUT r6CIFBDqJgbELcwJvgLmEUd9gtC/VfLnanTKiIfUtmDwaHpuA276nG8zQWeU/Mvo9TGNkfZ7dF6fc NdzINL+wCN7KEAGWJS2jntRlfA63Q63q7vY/AdwA4ruF9cx/6D3wnV1Zr+bd6mcF3oK7uFTHflpv1 +8BEL7IM1q0p74RItydhtABEimxEH5FKaKnIz6dheJSRVoEoYzI2xBaK7LBe2FA3kSVpSJHZFJVCZ n549uF+A==; 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 1fWObC-00065I-Si; Fri, 22 Jun 2018 16:07:46 +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-0005qE-TQ for linux-mtd@lists.infradead.org; Fri, 22 Jun 2018 16:07:21 +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 w5MG6m5d022587; Sat, 23 Jun 2018 01:06:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w5MG6m5d022587 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1529683612; bh=bDbRzl/Y7hMBUMFMuM7lmIwqpkfuICtect6xSmzsPQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AQczH5FQ4yZ551ASNksC9ntV1Bq1IQh5c+idQ6JtH7GaylyRdYblxD/DSmUgicjUS xBkh3tjVhpP/M3YRkNOqeRzq6TyI6+TKMcKO0ntlDW4B1CrTWIqGUJdyppPU4+/mmh a+hOj19SoPk8dLCo9RP0CRQKqMT6XI3BjkvaMnFOeZPGc0jweYG8QAtPXSUufZDFoh fDYrvRF2R/JfBD3sHd5oUfMzRBfwxuHgEiUmw9B/eeoeWaWraIPGCaqQS3wbgR0h/B A/IBUGSs04uD/bK0zhWAmMQPesy9L+XfEZ/XuoWQBxWTpnrNI3df5/zIIEzoPy3GJR +80n0625x/4Vw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon Subject: [PATCH v4 3/5] dt-binding: mtd: denali_dt: document clock property Date: Sat, 23 Jun 2018 01:06:36 +0900 Message-Id: <1529683598-25783-4-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_332849_6F08B08A X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. 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: Mark Rutland , devicetree@vger.kernel.org, Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, 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 Commit 30f9f2fb7ba0 ("mtd: denali: add a DT driver") supported the clock enablement, but did not document it in the DT binding. In addition to the existing clock, this commit adds more clocks based on the IP specification. According to the Denali User's Guide, this IP needs three clocks: - clk: controller core clock - clk_x: bus interface clock - ecc_clk: clock at which ECC circuitry is run The driver should accept the current single clock for the backward compatibility, but the DT binding should represent the real hardware, and future platforms must follow this. Signed-off-by: Masahiro Yamada --- Changes in v4: - split into a separate patch Documentation/devicetree/bindings/mtd/denali-nand.txt | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt b/Documentation/devicetree/bindings/mtd/denali-nand.txt index 0ee8edb..f33da87 100644 --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt @@ -8,6 +8,9 @@ Required properties: - reg : should contain registers location and length for data and reg. - reg-names: Should contain the reg names "nand_data" and "denali_reg" - interrupts : The interrupt number. + - clocks: should contain phandle of the controller core clock, the bus + interface clock, and the ECC circuit clock. + - clock-names: should contain "nand", "nand_x", "ecc" Optional properties: - nand-ecc-step-size: see nand.txt for details. If present, the value must be @@ -31,5 +34,7 @@ nand: nand@ff900000 { compatible = "altr,socfpga-denali-nand"; reg = <0xff900000 0x20>, <0xffb80000 0x1000>; reg-names = "nand_data", "denali_reg"; + clocks = <&nand_clk>, <&nand_x_clk>, <&nand_ecc_clk>; + clock-names = "nand", "nand_x", "ecc"; interrupts = <0 144 4>; };