devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Tony Lindgren <tony@atomide.com>, Rob Herring <robh@kernel.org>
Cc: linux-omap@vger.kernel.org, paul@pwsan.com,
	mturquette@baylibre.com, sboyd@codeaurora.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-clk@vger.kernel.org
Subject: Re: [PATCH 00/30] ARM: OMAP2+: hwmod module clock type support
Date: Wed, 13 Apr 2016 09:59:50 +0300	[thread overview]
Message-ID: <570DEE66.8030706@ti.com> (raw)
In-Reply-To: <20160412155829.GM5995@atomide.com>

On 04/12/2016 06:58 PM, Tony Lindgren wrote:
> Hi,
>
> * Rob Herring <robh@kernel.org> [160412 07:59]:
>> On Mon, Apr 11, 2016 at 11:18:51AM +0300, Tero Kristo wrote:
>>> Hi,
>>>
>>> This series transfers the hwmod clkctrl handling from the hwmod core
>>> under clock driver, the data is also transferred from hwmod data to
>>> devicetree. Done for most of the OMAP2+ platforms, except OMAP2 / OMAP3,
>>> where work is still under progress.
>>
>> Some high level questions.
>>
>> Why a DT node per clock? We've pretty much decided that is a bad idea
>> in the complex cases. TI chips certainly fall in the complex case.
>
> Well the clkctrl instances are separate independent devices under each
> clockdomain, so having a proper DT node for them makes sense to me.
>
> It's not like the clkctrl registers are just outputs of a single clock.
> A clockdomain typically has multiple inputs that are then routed in
> some combination to the clkctrl modules.
>
> I think we can group them though, here's how I'd like to set these up.
> This from dts point of view modelling omap4 TRM "3.11.16.1 WKUP_CM
> Register Summary":
>
> cm_wkup: clock@1800 {	/* offset from prm_clocks at 0x4a306000 */
> 	...
> 	reg = <0x1800 0x100>;
> 	ranges = <...>;
> 	...
>
> 	gpio1_mod_ck: clock@38 {
> 		compatible = "ti,clock-abc";
> 		reg = <0x38 0x10>;
> 		clocks = <...>;
> 		ranges = <...>;
> 		...
> 		gpio1_dbclk: clock@8 {
> 			#address-cells = <1>;
> 			#size-cells = <0>;
> 			ranges = <...>;
> 			compatible = "ti,clock-db";
> 			reg = <8>;	/* bit offset */
> 			...
> 		};
> 	};
>
> 	counter_32k_mod_ck: clock@50 {
> 		compatible = "ti,clock-xyz";
> 		reg = <0x50 0x10>;
> 		clocks = <...>;
> 		...
> 	};
> 	...
> };
>
> This then allows adding support for the clockdomain CLKSTCTRL and
> DYNAMICKDEP registers later on.
>
> Then I'd like to also have consumers be able to reference these using
> one of the two methods:
>
> 1.	clocks = <&counter_32k_mod_ck>;
> 2.	clocks = <&cm_wkup 0x50>;
>
> And the gpio1 debounce clock could be addressed with one of:
>
> 1.	clocks = <&gpio1_dbclk>;
> 2.	clocks = <&gpio1_mod_ck 8>;
>
>> You are changing compatible strings and possibly breaking compatibility.
>> Don't do that or justify why.
>
> Yes Tero please check those, we need to support the old behavior too.
> Sounds like you figured that out how to do that alreadey by generating
> the clock name for the built-in data.

Some of the old clock nodes are being dropped by this series, namely the 
timer ones, and they are getting merged to the new timerX_mod_ck nodes.

The reason for this is the behavior of the clock driver itself; it 
assumes it gets a clock handle for which it can do clk_set_parent (for 
setting proper source clock to get correct time-base), but normal 
_mod_ck nodes do not support this. So, what happens for example for 
omap4 is following:

old:
	dmt1_clk_mux: dmt1_clk_mux@1840 {
		#clock-cells = <0>;
		compatible = "ti,mux-clock";
		clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
		ti,bit-shift = <24>;
		reg = <0x1840>;
	};

	=> becomes a mux clock

new:
	timer1_mod_ck: timer1_mod_ck@1840 {
		#clock-cells = <0>;
		compatible = "ti,omap4-sw-mux-mod-clock";
		reg = <0x1840>, <0x1840>;
		clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
		ti,bit-shift = <24>;
	};

	=> becomes a composite clock with gate and mux components

These clocks are then directly referenced by hwmod. The reason for 
having two registers under the new timer node is that in some hardwares 
(like AM33xx), the register address for the gate and mux component are 
different.

Anyway, compatibility will be broken once the hwmod_data changes go in 
for individual SoCs, as the clkctrl portion is going to be dropped, and 
the hwmod has no chance to work with old DT data. If this is not 
acceptable, then the whole exercise becomes moot as we need to move the 
data someplace else within the kernel, and forget about the transition 
to DT.

-Tero

  reply	other threads:[~2016-04-13  6:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  8:18 [PATCH 00/30] ARM: OMAP2+: hwmod module clock type support Tero Kristo
2016-04-11  8:18 ` [PATCH 02/30] clk: ti: dpll: use ti_clk_get to fetch ref/bypass clocks Tero Kristo
     [not found] ` <1460362761-4842-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
2016-04-11  8:18   ` [PATCH 01/30] clk: ti: add ti_clk_get helper API Tero Kristo
2016-04-11  8:18   ` [PATCH 03/30] ARM: OMAP2+: omap_device: create clock alias purely from DT data Tero Kristo
2016-04-11  8:18   ` [PATCH 07/30] clk: ti: am33xx: transition to usage of ti_clk_get Tero Kristo
2016-04-11  8:19   ` [PATCH 10/30] clk: ti: omap4: " Tero Kristo
2016-04-11  8:19   ` [PATCH 11/30] clk: ti: omap5: " Tero Kristo
2016-04-11  8:19   ` [PATCH 13/30] clk: ti: dm814x: " Tero Kristo
2016-04-11  8:19   ` [PATCH 14/30] clk: ti: dm816x: cleanup any unnecessary clock aliases Tero Kristo
2016-04-11  8:19   ` [PATCH 15/30] clk: ti: remove un-used definitions from public clk_hw_omap struct Tero Kristo
2016-04-11  8:19   ` [PATCH 17/30] dt-bindings: clk: ti: Document module clock type Tero Kristo
2016-04-11  8:19   ` [PATCH 21/30] ARM: OMAP4: hwmod_data: use module clocks from DT Tero Kristo
2016-04-11  8:19   ` [PATCH 23/30] ARM: dts: am33xx: add hwmod module clocks Tero Kristo
2016-04-11 17:40   ` [PATCH 00/30] ARM: OMAP2+: hwmod module clock type support Tony Lindgren
2016-04-12 13:55     ` Tero Kristo
2016-04-12 16:42       ` Tony Lindgren
2016-04-11  8:18 ` [PATCH 04/30] ARM: OMAP2+: hwmod: use new ti_clk_get API to search for clock handles Tero Kristo
2016-04-11  8:18 ` [PATCH 05/30] ARM: OMAP2+: clock: use the new ti_clk_get for fetching clocks Tero Kristo
2016-04-11  8:18 ` [PATCH 06/30] clk: ti: omap2: transition to usage of ti_clk_get Tero Kristo
2016-04-11  8:18 ` [PATCH 08/30] clk: ti: omap3: " Tero Kristo
2016-04-11  8:19 ` [PATCH 09/30] clk: ti: am43xx: " Tero Kristo
2016-04-11  8:19 ` [PATCH 12/30] clk: ti: dra7: " Tero Kristo
2016-04-11  8:19 ` [PATCH 16/30] clk: ti: mux: export mux clock APIs locally Tero Kristo
2016-04-11  8:19 ` [PATCH 18/30] clk: ti: add support for omap4 module clocks Tero Kristo
2016-04-11  8:19 ` [PATCH 19/30] ARM: dts: omap4: add hwmod " Tero Kristo
2016-04-11  8:19 ` [PATCH 20/30] ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs Tero Kristo
2016-04-11  8:19 ` [PATCH 22/30] ARM: AM33xx: fix module_wait_ready without clkctrl register Tero Kristo
2016-04-11  8:19 ` [PATCH 24/30] ARM: dts: am43xx: add hwmod module clocks Tero Kristo
2016-04-11  8:19 ` [PATCH 25/30] clk: ti: am33xx: fix init time clock setup Tero Kristo
2016-04-11  8:19 ` [PATCH 26/30] ARM: AMx3xx: hwmod_data: use module clocks from DT Tero Kristo
2016-04-11  8:19 ` [PATCH 27/30] ARM: dts: omap5: add hwmod module clocks Tero Kristo
2016-04-11  8:19 ` [PATCH 28/30] ARM: OMAP5: hwmod_data: use module clocks from DT Tero Kristo
2016-04-11  8:19 ` [PATCH 29/30] ARM: dts: dra7: add hwmod module clocks Tero Kristo
2016-04-11  8:19 ` [PATCH 30/30] ARM: DRA7: hwmod_data: use module clocks from DT Tero Kristo
2016-04-12 14:58 ` [PATCH 00/30] ARM: OMAP2+: hwmod module clock type support Rob Herring
2016-04-12 15:58   ` Tony Lindgren
2016-04-13  6:59     ` Tero Kristo [this message]
2016-04-13 15:49       ` Tony Lindgren

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=570DEE66.8030706@ti.com \
    --to=t-kristo@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.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=tony@atomide.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).