Received: by 10.223.176.5 with SMTP id f5csp3444623wra; Mon, 29 Jan 2018 13:16:39 -0800 (PST) X-Google-Smtp-Source: AH8x225FmbBMfnaD/kxcYAa6tPoSbWlKgXx9d88ljdl8ZGmE+cmOf6JCR4mTid5DwgjA0GX8YzTD X-Received: by 2002:a17:902:25ab:: with SMTP id y40-v6mr24041216pla.140.1517260599634; Mon, 29 Jan 2018 13:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517260599; cv=none; d=google.com; s=arc-20160816; b=HdtWNisj6S/I7x3avPoH0+1gXwMpaD3CHhTPm675cZzH3Cf7v1BDBiR4G9cboA9noM dB8ALod0r44qTQrwodoKcuqp7jpVYTROcLAL73P+nyEJnk5mfiYXO8MQH/nkbyXnSUet hgFDyOQvf1DAocb+0wKpOYK4MWZXQj3LGv47LXBWN+dU/wTVUPnaMW0TwJ9vfOvzpDCe +wi75dED/D6ZOO13Ziq2VhjkoXxRzEqDdCQ9TzKMaWIsbCeuw1NpPLyvJeMDM/7+5kaR +fD1+n2287G+Ppq98XSKKsSv1COZzK1YC2yYSNwhErfLL49NwmX6CVs8c0tV6G9kjg+T IuCg== 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=BRizmRFhl85GFtqwJo0LpPAAHTb8ynTvoItHKCFt+wI=; b=mHYyWq0Q9vJlZZyPSPbqLG9knmDsA7y2LpBVDupsxHeQNHq6LlvIyFRpAxzAh0LT4t Y65DVNAJ822j2WeVD418GV8bWE2KIDskL0mbAKAP32zZ3thxSD7KnWWxFKZ93jSGC6Io lYVAZrxWD/Irqc3b2wKyTuXkB7K8vr7INQP9SfD7lqPpv1rSXmRCR1QWMzHNEADedPr/ EooE6778L+VRdVe/ArSngysmpfBs2XHBACk3c8xx3KqvQzFSV4UTDJ239lAayXJ17YWs hKuLNq7JXatOiLy2nLjXyArX0Zvnke8SpUobRBykWM+3HiR0md7SvlanBK3ER2MqBnNz rkVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=QgiHEEIg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si86610pfh.258.2018.01.29.13.16.24; Mon, 29 Jan 2018 13:16:39 -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=fail header.i=@lechnology.com header.s=default header.b=QgiHEEIg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752539AbeA2VOx (ORCPT + 99 others); Mon, 29 Jan 2018 16:14:53 -0500 Received: from vern.gendns.com ([206.190.152.46]:37176 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752569AbeA2VOr (ORCPT ); Mon, 29 Jan 2018 16:14:47 -0500 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:From:References:Cc:To: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=BRizmRFhl85GFtqwJo0LpPAAHTb8ynTvoItHKCFt+wI=; b=QgiHEEIgWry2XltCfzYmGhRy94 X8sWknq0M9TX33K+95vPtXDm7D4rvJdKKwFlhvwaV5f+nRRoIGEdfYvrv3qqzVWBgy3xl+z2qjDsn UURMmhQ8ihQvWGcEtY+dmbUo3T1WkFdbzwkcBIG9NNi2tMKDq2dpFqlU2q5/EBQC5awkW4iyz7gGw az5fouuQdHI2KAfkIaa6ZbKqjRFYgFiiXlWbwQFFhaRrei504ZQfx2HFP6SBh1gW1XX1HhixsL89w XUCasgcGtBuqsGEQv1Yypu9+AeNcoT2byzgSDoB98Yp8p52racDpsvg7sLwnabKvlLsjMretJi7vi 9TET0Tyw==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:53306 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 1egGkY-002ZRz-GP; Mon, 29 Jan 2018 16:14:00 -0500 Subject: Re: [PATCH v6 01/41] dt-bindings: clock: Add new bindings for TI Davinci PLL clocks To: Rob Herring Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Turquette , Stephen Boyd , Mark Rutland , Sekhar Nori , 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> From: David Lechner Message-ID: Date: Mon, 29 Jan 2018 15:14:43 -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: <20180129195315.bjanym7pmeh7bhaa@rob-hp-laptop> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 - vger.kernel.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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 --- I guess it is not too bad (writing a clock lookup function that knows all of these rules could get interesting though).