Received: by 10.223.176.5 with SMTP id f5csp888724wra; Tue, 30 Jan 2018 21:30:43 -0800 (PST) X-Google-Smtp-Source: AH8x226XxW2XJVH2N6LGbzoKgS/zSVARYnKM8KlpdUjj66DpMt/aVNqxhcZDuZRItxQPqnr8l7sB X-Received: by 2002:a17:902:6a89:: with SMTP id n9-v6mr27122157plk.212.1517376643023; Tue, 30 Jan 2018 21:30:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517376642; cv=none; d=google.com; s=arc-20160816; b=lXzOV7Qx6EwxaCLuJJmnWPYItQ+/U4H8KLg6HpGXUYGFqWLOx8nTnAjNPAMlWCMWI/ CIw/5cAaK1zLemDZPGpSmmcUHev0qe7E17EjF0UkQQfgudzTpMA5sBjyl+eX96cwXDj6 /hbf1OHthjn0RPf+s//iwY83EQxLy4sldm7Q+MFd7tN3LidAqR53uw89PyPNNtG5s/4h i4iJzI0l46ob7j84rPeHjEIucQe3YgttC2uELJGp+JVWENTsXvYIxEHR2RCo+sSyillx UCuLTXt+D/aREePkeqlWKUHnrTfSIEHpQBZc6wmxTBYUsExVkz6iJ0QMb/eCOrHWdJcJ 4vkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=lcDxKGsakU6KIru8dBP9WL1u6umf/TvFZJ8AXLV/Cp4=; b=bULs1MZNBsyuNG1Km4XMoze2g74GNlo4iOb0ENsUb053S3mf6nsXx6peEM6gbCyIG9 ZElrXNQ3/g6gFTvuUiBlYaglaJHCRdwe1FbUn4t012AbFz/vpjYuc6hNY581A5FJQ/ID uoqQSRKVTB1LmKjHKhT+U08tdwbKjf9mzT9U2UZqSHQ/l3C+uee1NCnKd/pGiX7Zwu2Z t0r4snf+iIy27ppjCx7Unq/ahTguEisBXymtxG0LsDaSZIFapfMcDkNmTiNjMXrnhhoq N/CKrd4Nc4PFGLgNQ6Y9MzBFKBpFdmSHSxcYwnKiMWjBlx/6rkAWhS2NAM+lP1PmZPZd ZBJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=D0pWG3Q0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si876980pgi.522.2018.01.30.21.30.26; Tue, 30 Jan 2018 21:30:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=D0pWG3Q0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752837AbeAaE76 (ORCPT + 99 others); Tue, 30 Jan 2018 23:59:58 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:21969 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbeAaE74 (ORCPT ); Tue, 30 Jan 2018 23:59:56 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w0V4wjJ0012767; Tue, 30 Jan 2018 22:58:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1517374725; bh=bC4zBKxBw4XlYKxt2D1+hsw7iRJM7/qcdT3mNYUS8G4=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=D0pWG3Q0icl6Ned6a6vpSBlUSmceoH3crY6+aOEvDjeQgwORTqvjCdtnv9tM0zdgD ZChQFCzbJDrWvQIJ9VBZpzwP59Df3ZHIbWfEVbnITjAExya40FFJXaRhZXJN4MmlP7 tK7k4Boe2MPErZIJKJxhS1PYjhtZ/+OscmYLSBA4= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0V4wjVK000469; Tue, 30 Jan 2018 22:58:45 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Tue, 30 Jan 2018 22:58:44 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Tue, 30 Jan 2018 22:58:44 -0600 Received: from [172.24.190.171] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0V4weu2027053; Tue, 30 Jan 2018 22:58:41 -0600 Subject: Re: [PATCH v6 01/41] dt-bindings: clock: Add new bindings for TI Davinci PLL clocks To: David Lechner , Rob Herring CC: linux-clk , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Michael Turquette , Stephen Boyd , Mark Rutland , Kevin Hilman , Bartosz Golaszewski , Adam Ford , "linux-kernel@vger.kernel.org" References: <1516468460-4908-1-git-send-email-david@lechnology.com> <1516468460-4908-2-git-send-email-david@lechnology.com> <20180129195315.bjanym7pmeh7bhaa@rob-hp-laptop> <7064a0d6-0969-81a0-00af-84cca339b813@lechnology.com> From: Sekhar Nori Message-ID: Date: Wed, 31 Jan 2018 10:28:39 +0530 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: <7064a0d6-0969-81a0-00af-84cca339b813@lechnology.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 31 January 2018 12:16 AM, David Lechner wrote: > On 01/30/2018 08:50 AM, Rob Herring wrote: >> On Mon, Jan 29, 2018 at 3:14 PM, David Lechner >> wrote: >>> On 01/29/2018 01:53 PM, Rob Herring wrote: >>>> >>>> On Sat, Jan 20, 2018 at 11:13:40AM -0600, David Lechner wrote: >>>>> >>>>> This adds a new binding for the PLL IP blocks in the mach-davinci >>>>> family of processors. Currently, only da850 has device tree support >>>>> but these bindings can also work for other SoCs in this family just >>>>> by adding new compatible strings. >>>>> >>>>> Note: Although these PLL controllers are very similar to the TI >>>>> Keystone >>>>> SoCs, we are not re-using those bindings. The Keystone bindings use a >>>>> legacy one-node-per-clock binding. Furthermore, the mach-davinici SoCs >>>>> have a slightly different PLL register layout and a number of quirks >>>>> that can't be handled by the existing bindings, so the keystone >>>>> bindings >>>>> could not be used as-is anyway. >>>>> >>>>> Signed-off-by: David Lechner >>>>> --- >>>>> >>>>> v6 changes: >>>>> - Added clock-names property >>>>> - Added ti,clkmode-square-wave property >>>>> - Added pllout child node >>>>> - Added obsclk child node >>>>> - Expanded examples >>>>> >>>>>    .../devicetree/bindings/clock/ti/davinci/pll.txt   | 96 >>>>> ++++++++++++++++++++++ >>>>>    1 file changed, 96 insertions(+) >>>>>    create mode 100644 >>>>> Documentation/devicetree/bindings/clock/ti/davinci/pll.txt >>>>> >>>>> diff --git >>>>> a/Documentation/devicetree/bindings/clock/ti/davinci/pll.txt >>>>> b/Documentation/devicetree/bindings/clock/ti/davinci/pll.txt >>>>> new file mode 100644 >>>>> index 0000000..36998e1 >>>>> --- /dev/null >>>>> +++ b/Documentation/devicetree/bindings/clock/ti/davinci/pll.txt >>>>> @@ -0,0 +1,96 @@ >>>>> +Binding for TI DaVinci PLL Controllers >>>>> + >>>>> +The PLL provides clocks to most of the components on the SoC. In >>>>> addition >>>>> +to the PLL itself, this controller also contains bypasses, gates, >>>>> dividers, >>>>> +an multiplexers for various clock signals. >>>>> + >>>>> +Required properties: >>>>> +- compatible: shall be one of: >>>>> +       - "ti,da850-pll0" for PLL0 on DA850/OMAP-L138/AM18XX >>>>> +       - "ti,da850-pll1" for PLL1 on DA850/OMAP-L138/AM18XX >>>>> +- reg: physical base address and size of the controller's register >>>>> area. >>>>> +- clocks: phandles corresponding to the clock names >>>>> +- clock-names: names of the clock sources - depends on compatible >>>>> string >>>>> +       - for "ti,da850-pll0", shall be "clksrc", "extclksrc" >>>>> +       - for "ti,da850-pll1", shall be "clksrc" >>>>> + >>>>> +Optional properties: >>>>> +- ti,clkmode-square-wave: Indicates that the the board is supplying a >>>>> square >>>>> +       wave input on the OSCIN pin instead of using a crystal >>>>> oscillator. >>>>> +       This property is only valid when compatible = "ti,da850-pll0". >>>>> + >>>>> + >>>>> +Optional child nodes: >>>>> + >>>>> +pllout >>>>> +       Describes the main PLL clock output (before POSTDIV). The node >>>>> name must >>>>> +       be "pllout". >>>>> + >>>>> +       Required properties: >>>>> +       - #clock-cells: shall be 0 >>>>> + >>>>> +sysclk >>>>> +       Describes the PLLDIVn divider clocks that provide the SYSCLKn >>>>> clock >>>>> +       domains. The node name must be "sysclk". Consumers of this >>>>> node >>>>> should >>>>> +       use "n" in "SYSCLKn" as the index parameter for the clock >>>>> cell. >>>>> + >>>>> +       Required properties: >>>>> +       - #clock-cells: shall be 1 >>>>> + >>>>> +auxclk >>>>> +       Describes the AUXCLK output of the PLL. The node name must be >>>>> "auxclk". >>>>> +       This child node is only valid when compatible = >>>>> "ti,da850-pll0". >>>>> + >>>>> +       Required properties: >>>>> +       - #clock-cells: shall be 0 >>>>> + >>>>> +obsclk >>>>> +       Describes the OBSCLK output of the PLL. The node name must be >>>>> "obsclk". >>>>> + >>>>> +       Required properties: >>>>> +       - #clock-cells: shall be 0 >>>> >>>> >>>> So why have all these child nodes vs. just defining a single number >>>> space of clock ids? >>>> >>>> Rob >>>> >>> >>> I think that it makes the bindings more self-documenting. Not all >>> PLLs have >>> all of possible types of output clocks, so the presence or absence of a >>> child node indicates if a PLL actually has that output or not. >> >> Doesn't the compatible string do that? > > Sure. > >> >>> It is also complicated by the fact that one of the child nodes (sysclk) >>> is  already an array of clocks. >>> >>> To do what you are suggesting might look something like this... >>> >>> --- >>> >>> Required properties: >>> - compatible: shall be one of: >>>          - "ti,da850-pll0" for PLL0 on DA850/OMAP-L138/AM18XX >>>          - "ti,da850-pll1" for PLL1 on DA850/OMAP-L138/AM18XX >>> - reg: physical base address and size of the controller's register area. >>> - clocks: phandles corresponding to the clock names >>> - clock-names: names of the clock sources - depends on compatible string >>>          - for "ti,da850-pll0", shall be "clksrc", "extclksrc" >>>          - for "ti,da850-pll1", shall be "clksrc" >>> - #clock-cells: shall be set to <2>. >>> >>> Consumers: >>> >>> The clock cell values for consumers work as follows... >>> >>> The first index is one of the constants defined in ti-davinci-pll.h >>> >>> The second index is 0 unless the first index is TI_DAVINCI_SYSCLK. In >>> the >>> case >>> of TI_DAVINCI_SYSCLK the second index the SYSCLK domain ID (n in >>> SYSCLKn). >>> >>> For compatible = "ti,da850-pll0": >>>          - <&pll0 TI_DAVINCI_PLLOUT 0> is the PLLOUT clock >>>          - <&pll0 TI_DAVINCI_SYSCLK n> is one of the SYSCLKn clock >>> domains >>> where n is 1 to 7 >>>          - <&pll0 TI_DAVINCI_AUXCLK 0> is the AUXCLK clock domain >>>          - <&pll0 TI_DAVINCI_OBSCLK 0> is the OBSCLK clock domain >>>          - all other index combinations are invalid >>> >>> For compatible = "ti,da850-pll1": >>>          - <&pll0 TI_DAVINCI_SYSCLK n> is one of the SYSCLKn clock >>> domains >>> where n is 1 to 3 >>>          - <&pll0 TI_DAVINCI_OBSCLK 0> is the OBSCLK clock domain >>>          - all other index combinations are invalid >> >> You don't really need 2 cells here. I guess if you want to keep the >> child nodes, that is fine. > > OK, I can see how it could work with one cell. > > Since this is already implemented and working, I'm inclined to leave it > as-is if it is "good enough". But, I am fine going either way if there > are other opinions on the matter. FWIW, I think the current binding is fine too. The clocks are of different kind (fixed clock, fixed divider, flexible divider etc). So, its slightly better to have child nodes, I guess. Thanks, Sekhar