linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Tero Kristo <t-kristo@ti.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-omap@vger.kernel.org, Paul Walmsley <paul@pwsan.com>,
	Rob Herring <robh@kernel.org>
Subject: Re: [PATCH] Documentation: dt-bindings: Add binding documentation for TI clkctrl clocks
Date: Mon, 16 Jan 2017 09:07:47 -0800	[thread overview]
Message-ID: <20170116170746.GA7403@atomide.com> (raw)
In-Reply-To: <7acb6824-0e64-960b-1490-9b7a8b867b3b@ti.com>

* Tero Kristo <t-kristo@ti.com> [170116 07:20]:
> On 10/01/17 01:42, Tony Lindgren wrote:
> > +Example: Clock controller node:
> > +
> > +&cm_l4per {
> > +	cm_l4per_clkctrl: clk@20 {
> > +		compatible = "ti,clkctrl";
> > +		reg = <0x20 0x1b0>;
> > +		#clock-cells = 1;
> > +		ti,modulemode-auto = <OMAP4_GPIO2_CLKCTRL>;
> > +	};
> > +};
> 
> So, in this example, what would cm_l4per be? Is it a clockdomain? Or is it
> just an arbitrary interconnect instance, and the clockdomain would also be a
> separate node under cm_l4per?

Good question. It's not a clockdomain, those are the CLKSTCTRL registers.
And for example "3.11.33.1 CORE_CM2 Register Summary" for core_cm2 has
multiple clockdomains under it.

Looking at the interconnect target module for cm2, it's range is from
0x4a008000 - 0x4a009fff as listed in "Table 2-3. L4_CFG Memory Space
Mapping". So that's the cm2 parent module, and whatever we can clearly
set up as separate devices under that will make things easier to
understand.

The various device instances under cm2 can be seen in "3.11.29 CM2
Instance Summary".

So how about the following would describe that hardware using the
#clock-cells = <3> as discussed:

&cm2 {	/* 0x4a008000 */
	compatible = "ti,interconnect-socket-cm", "simple-pm-bus";
	reg = <0 0x2000>;
	ranges;
	...

	ckgen_cm2: cm@100 {
		reg = <0x100 0x100>;
		compatible = <"ti,clockmanager", "simple-pm-bus">;
		ranges;
		...
	};

	always_on_cm2: cm@600 {
		reg = <0x100 0x100>;
		compatible = <"ti,clockmanager", "simple-pm-bus">;
		ranges;
		...
	};

	...

	l4per: cm@1400 {
		reg = <0x1400 0x200>;
		compatible = <"ti,clockmanager", "simple-pm-bus">;
		ranges;
		...

		/* drivers/soc/ti/clockdomain.c */
		cm_l4per@0 {
			compatible = "ti,clockdomain";
			reg = <0 0x200>;
			ranges;
			...

			/* drivers/clk/ti/clkctrl.c */
			cm_l4per_clkctrl: clk@20 {
				compatible = "ti,clkctrl";
				reg = <0x20 0x1b0>;
				#clock-cells = <3>;
			};

			...

		}

		...
	};

	...
};

Then on am335x we need to set the ranges at the "ti,clockmanager" level
as the registers are partially sorted and most of the CLKSTCTRL registers
are at the beginning for all the clockdomains. With the ranges we can
have each clkctrl instance be a child of the related clockdomain.

> Shall we add power-domains = <&cm_l4per_clkdm>; entry under the
> cm_l4per_clkctrl in this example? (My thinking is that we will represent
> both OMAP clock and power domains as generic power domains within kernel /
> DT.)

Yeah it seems we can represent both the clock and power domains with just
a single "power-domains" property.

To me it seems the "power-domains" property would then belong to the
"ti,clockdomain" node above. As the clkctrl clock instances are children
of each clockdomain then "simple-pm-bus" should automatically manage
PM runtime usecount for each clockdomain.

Regards,

Tony

      reply	other threads:[~2017-01-16 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 23:42 [PATCH] Documentation: dt-bindings: Add binding documentation for TI clkctrl clocks Tony Lindgren
     [not found] ` <20170109234226.9449-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-10 15:44   ` Tony Lindgren
     [not found]     ` <20170110154400.GT2630-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-13 16:36       ` Rob Herring
2017-01-13 17:13         ` Tony Lindgren
2017-01-16 15:19   ` Tero Kristo
2017-01-16 17:07     ` Tony Lindgren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170116170746.GA7403@atomide.com \
    --to=tony@atomide.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=paul@pwsan.com \
    --cc=robh@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=t-kristo@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).