From patchwork Tue Feb 6 18:25:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10203755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E85160247 for ; Tue, 6 Feb 2018 18:25:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DA1B27E5A for ; Tue, 6 Feb 2018 18:25:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51B9F28B4D; Tue, 6 Feb 2018 18:25:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C0C5B27E5A for ; Tue, 6 Feb 2018 18:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:References: To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i0hw4mGE++TGLSwQDc75GoBXJ+QI0C8J7h21sDSVxio=; b=ehSHnXg0h73u4MnN00IYWSaoQ 4unVrFc2Yfok+OeiRc42DnqKKknISz7miJfb9DoCJYrrLVBjIRb80Wpr/iYcEjBffftF+Vu4C0kvm qat3l0PJbqvi7v0Y+bzyJNkpbeoMXQQhLX+BprmRgbcfG1ZAzf0kRcBvclw6MIvsQ27CZeOGhZtNt XXZRJPkLUh6UoMlQTCYP51i1+z947E4MZdreIA/p0cPcHnKZ8Zcxf0ORYJfXBJ7WraoEeIkL956YE Z8YJ+cWiCVKh9/zsYD5g92xQJfsbKm2p2CIJxS+HCiqZgL61t5BQB4w0IzekMLAHaore50wOznmla Zcf/uocwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ej7w1-0008Sl-6T; Tue, 06 Feb 2018 18:25:37 +0000 Received: from vern.gendns.com ([206.190.152.46]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ej7vx-0008RF-FF for linux-arm-kernel@lists.infradead.org; Tue, 06 Feb 2018 18:25:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=z1ZJC57M+poKFqoau+blbQ6yUnbib5AVZEiDBAozLYI=; b=rToCbx4zLUKAbA8JZKzR1qn0uX eywKtRhqaOPaU/Yw0PKrCW0RZrmUXTMdXgNUzvnTqJj4TWQdYpPLR+UP2QxWRYtzqN4kPjZopBpHZ ca03RYD/XIMGWK0Mp4CoaqfeR47CdASURV+VHqTHxSmXO3j+NxOpAx/qKdjPcZ+ScfYfDTIAnIpQI qu8fCDidofh8r8sbpgtxTa5ODabaMzyST0O7PwT9VuoMFst2vtFG4Gi9lTMOFol3JHwP9WA7qPf9x DgE9SBhORCUHrJ92bjSezl/qyH+ecTodaQZUkXQbNK1yCi/exYoVzWo0kgifEX7IRrt2K0pLd0fbR o3DPwk+w==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:59452 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ej7up-004GhU-Nq; Tue, 06 Feb 2018 13:24:23 -0500 Subject: Re: [PATCH] ARM: dts: da850-evm: add clock properties to the nand node From: David Lechner To: Sekhar Nori , Bartosz Golaszewski References: <20180205155222.22189-1-brgl@bgdev.pl> <3f171f6a-bcea-65ec-d56d-f6ae24660f34@ti.com> <54dbdb98-e0e4-c8c9-fec4-2f050745d9be@ti.com> <794024f3-f87a-58ed-2722-a4a2d09df3ce@lechnology.com> Message-ID: <4aa2ab13-7890-6904-86b3-e2dbcb6d6daa@lechnology.com> Date: Tue, 6 Feb 2018 12:25:26 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <794024f3-f87a-58ed-2722-a4a2d09df3ce@lechnology.com> Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-devicetree , Kevin Hilman , Bartosz Golaszewski , Russell King , LKML , Rob Herring , arm-soc Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 02/06/2018 12:16 PM, David Lechner wrote: > On 02/06/2018 07:51 AM, Sekhar Nori wrote: >> On Tuesday 06 February 2018 06:38 PM, Bartosz Golaszewski wrote: >>> 2018-02-06 12:07 GMT+01:00 Sekhar Nori : >>>> On Monday 05 February 2018 09:22 PM, Bartosz Golaszewski wrote: >>>>> From: Bartosz Golaszewski >>>>> >>>>> Make nand work with the common clock framework by specifying which >>>>> clock should be used and what name to look up. >>>>> >>>>> Signed-off-by: Bartosz Golaszewski >>>>> --- >>>>>   arch/arm/boot/dts/da850-evm.dts | 3 +++ >>>>>   1 file changed, 3 insertions(+) >>>>> >>>>> diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts >>>>> index a86a8a1816f2..2602ad8e99ee 100644 >>>>> --- a/arch/arm/boot/dts/da850-evm.dts >>>>> +++ b/arch/arm/boot/dts/da850-evm.dts >>>>> @@ -296,6 +296,9 @@ >>>>>                        reg = <0 0x02000000 0x02000000 >>>>>                               1 0x00000000 0x00008000>; >>>>> >>>>> +                     clocks = <&psc0 3>; >>>>> +                     clock-names = "aemif"; >>>> >>>> Looks like this is being added only to satisfy the devm_clk_get() call >>>> in nand_davinci_probe() which I think is superfluous since we also >>>> enable the same clock in aemif_probe(). >>>> >>>> Perhaps the better solution is to drip the clk code in >>>> drivers/mtd/nand/davinci_nand.c and shift legacy code to start using >>>> drivers/memory/aemif.c as well? This way we can also drop >>>> arch/arm/mach-davinci/aemif.c >>>> >>>> Thanks, >>>> Sekhar >>> >>> Yes, this sounds good, but I think we should leave it for later as an >>> additional improvement, once everything else is in place. I think >>> these patches should be applied together with David's series in order >>> to not break the support on davinci boards and the aemif work would go >>> in later as a follow-up. How about that? >> >> No, I dont think we should add temporary hacks to DT to work around >> driver issues (I do think its a hack since the clock belongs to aemif >> module not NAND flash). >> >> An easier driver hack might be to not treat devm_clk_get() failure in >> davinci_nand.c as catastrophic. It will safely fail in DT case and we >> should get the clock in legacy boot case. >> >> I think we are looking at a driver update dependency anyway. > > It looks like keystone.dtsi is using the clock-ranges property in the > aemif node to pass the clock to child nodes. Could we not do the same > in da850.dtsi? Bartosz, please try this instead of your patch. FYI, this is just following the existing memory-controllers/ti-aemif.txt device tree bindings, so not a "hack". --- --- diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index 3a1f2ce..ff9d807 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi @@ -796,6 +796,8 @@ ranges = <0 0 0x60000000 0x08000000 1 0 0x68000000 0x00008000>; clocks = <&psc0 3>; + clock-names = "aemif"; + clock-ranges; status = "disabled"; }; memctrl: memory-controller@b0000000 {