All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: James Liao <jamesjj.liao@mediatek.com>
Cc: linux-mediatek@lists.infradead.org,
	Eddie Huang <eddie.huang@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	devicetree@vger.kernel.org, Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, djkurtz@chromium.org
Subject: Re: [PATCH] arm64: dts: mt8173: add clock_null
Date: Wed, 24 Jun 2015 12:24:42 +0200	[thread overview]
Message-ID: <1510058.fTE6dlSRsH@diego> (raw)
In-Reply-To: <1435132455.28866.21.camel@mtksdaap41>

Hi James,

Am Mittwoch, 24. Juni 2015, 15:54:15 schrieb James Liao:
> On Mon, 2015-06-22 at 14:53 +0200, Heiko Stübner wrote:
> > Hi James,
> > 
> > Am Montag, 22. Juni 2015, 11:38:37 schrieb James Liao:
> > > On Fri, 2015-06-19 at 13:36 +0200, Heiko Stuebner wrote:
> > > 
> > > Some clocks such as clkph_mck_o, we don't really care where they come
> > > from and what frequencies are. We model these clocks just because they
> > > or their derived clocks can be the source of topckgen muxes. Is there a
> > > better way to model "don't care" clocks?
> > 
> > There are two different concepts at work here. You might not care in your
> > kernel driver implementation _at the moment_ where the clocks come from;
> > but the devicetree is supposed to model how the hardware is structured
> > and not contain implementation specific details.
> 
> If we model "don't care" clocks inside the driver (i.e. create clk_null
> in clock driver), then we don't need to model the dummy clock in device.
> Is it an acceptable way?
> 
> > So the clock tree should be modeled according to how the hardware is layed
> > out not how you want to use the clocks at the moment :-) .
> > 
> > It would it any case be good, if you could describe where these clocks
> > come
> > from in the hardware, so we can find the best solution on how to model
> > those.
> In fact, I don't know where these clocks come from at all, especially
> when they come from outside of SoC. Besides, some clocks don't need to
> model in CCF, but they can be the source of clocks that controlled by
> CCF.

If a clock is used inside the ccf driver, its tree should be modeled according 
to the hardware - including these external clocks. Somebody (at least some 
chip designer or so) should know where these clocks actually come from ;-) .


> I don't think ALL clocks on a SoC need to be handled in CCF, so there
> should be some clocks don't have a "real" or "correct" parent. In
> current implementation I use a dummy clock (clk_null) to be the unreal
> parent.

You are right that not all clocks needs to be implemented in a ccf _driver_, 
but as the devicetree binding describes the hardware and is supposed to be 
stable and (nearly) unchangeable outside-connections of the clock block need 
to be defined carefully.


> Do you think we should model as more clocks as we can in CCF even we
> don't need them? If no, how do we handle those clocks which are not
> handled in CCF but can be parent of CCF clocks?

In general I think everything that has a connection to the outside (external 
source clock and clocks used by soc ips) should be modeled precisely. What 
then happens inside the clock controller is less important, as it normally can 
be fixed later on too.


Citing my own code [which got inspired on how Samsung did this], Rockchip 
clock controllers also have numerous possible external clock inputs with only 
the 24MHz oscillator being required [0].

All the other clocks may or may not be present. For example xin32k normally 
comes from an i2c-connected rtc or pmic chip which gets probed a lot later in 
the boot process, so we rely on the orphan-handling of the ccf for these.


So please really try to find out what these clocks are in the first place ... 
somebody must know this ;-)


Heiko


[0] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt#n26



WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
To: James Liao <jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Eddie Huang <eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Matthias Brugger
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org
Subject: Re: [PATCH] arm64: dts: mt8173: add clock_null
Date: Wed, 24 Jun 2015 12:24:42 +0200	[thread overview]
Message-ID: <1510058.fTE6dlSRsH@diego> (raw)
In-Reply-To: <1435132455.28866.21.camel@mtksdaap41>

Hi James,

Am Mittwoch, 24. Juni 2015, 15:54:15 schrieb James Liao:
> On Mon, 2015-06-22 at 14:53 +0200, Heiko Stübner wrote:
> > Hi James,
> > 
> > Am Montag, 22. Juni 2015, 11:38:37 schrieb James Liao:
> > > On Fri, 2015-06-19 at 13:36 +0200, Heiko Stuebner wrote:
> > > 
> > > Some clocks such as clkph_mck_o, we don't really care where they come
> > > from and what frequencies are. We model these clocks just because they
> > > or their derived clocks can be the source of topckgen muxes. Is there a
> > > better way to model "don't care" clocks?
> > 
> > There are two different concepts at work here. You might not care in your
> > kernel driver implementation _at the moment_ where the clocks come from;
> > but the devicetree is supposed to model how the hardware is structured
> > and not contain implementation specific details.
> 
> If we model "don't care" clocks inside the driver (i.e. create clk_null
> in clock driver), then we don't need to model the dummy clock in device.
> Is it an acceptable way?
> 
> > So the clock tree should be modeled according to how the hardware is layed
> > out not how you want to use the clocks at the moment :-) .
> > 
> > It would it any case be good, if you could describe where these clocks
> > come
> > from in the hardware, so we can find the best solution on how to model
> > those.
> In fact, I don't know where these clocks come from at all, especially
> when they come from outside of SoC. Besides, some clocks don't need to
> model in CCF, but they can be the source of clocks that controlled by
> CCF.

If a clock is used inside the ccf driver, its tree should be modeled according 
to the hardware - including these external clocks. Somebody (at least some 
chip designer or so) should know where these clocks actually come from ;-) .


> I don't think ALL clocks on a SoC need to be handled in CCF, so there
> should be some clocks don't have a "real" or "correct" parent. In
> current implementation I use a dummy clock (clk_null) to be the unreal
> parent.

You are right that not all clocks needs to be implemented in a ccf _driver_, 
but as the devicetree binding describes the hardware and is supposed to be 
stable and (nearly) unchangeable outside-connections of the clock block need 
to be defined carefully.


> Do you think we should model as more clocks as we can in CCF even we
> don't need them? If no, how do we handle those clocks which are not
> handled in CCF but can be parent of CCF clocks?

In general I think everything that has a connection to the outside (external 
source clock and clocks used by soc ips) should be modeled precisely. What 
then happens inside the clock controller is less important, as it normally can 
be fixed later on too.


Citing my own code [which got inspired on how Samsung did this], Rockchip 
clock controllers also have numerous possible external clock inputs with only 
the 24MHz oscillator being required [0].

All the other clocks may or may not be present. For example xin32k normally 
comes from an i2c-connected rtc or pmic chip which gets probed a lot later in 
the boot process, so we rely on the orphan-handling of the ccf for these.


So please really try to find out what these clocks are in the first place ... 
somebody must know this ;-)


Heiko


[0] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt#n26


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: dts: mt8173: add clock_null
Date: Wed, 24 Jun 2015 12:24:42 +0200	[thread overview]
Message-ID: <1510058.fTE6dlSRsH@diego> (raw)
In-Reply-To: <1435132455.28866.21.camel@mtksdaap41>

Hi James,

Am Mittwoch, 24. Juni 2015, 15:54:15 schrieb James Liao:
> On Mon, 2015-06-22 at 14:53 +0200, Heiko St?bner wrote:
> > Hi James,
> > 
> > Am Montag, 22. Juni 2015, 11:38:37 schrieb James Liao:
> > > On Fri, 2015-06-19 at 13:36 +0200, Heiko Stuebner wrote:
> > > 
> > > Some clocks such as clkph_mck_o, we don't really care where they come
> > > from and what frequencies are. We model these clocks just because they
> > > or their derived clocks can be the source of topckgen muxes. Is there a
> > > better way to model "don't care" clocks?
> > 
> > There are two different concepts at work here. You might not care in your
> > kernel driver implementation _at the moment_ where the clocks come from;
> > but the devicetree is supposed to model how the hardware is structured
> > and not contain implementation specific details.
> 
> If we model "don't care" clocks inside the driver (i.e. create clk_null
> in clock driver), then we don't need to model the dummy clock in device.
> Is it an acceptable way?
> 
> > So the clock tree should be modeled according to how the hardware is layed
> > out not how you want to use the clocks at the moment :-) .
> > 
> > It would it any case be good, if you could describe where these clocks
> > come
> > from in the hardware, so we can find the best solution on how to model
> > those.
> In fact, I don't know where these clocks come from at all, especially
> when they come from outside of SoC. Besides, some clocks don't need to
> model in CCF, but they can be the source of clocks that controlled by
> CCF.

If a clock is used inside the ccf driver, its tree should be modeled according 
to the hardware - including these external clocks. Somebody (at least some 
chip designer or so) should know where these clocks actually come from ;-) .


> I don't think ALL clocks on a SoC need to be handled in CCF, so there
> should be some clocks don't have a "real" or "correct" parent. In
> current implementation I use a dummy clock (clk_null) to be the unreal
> parent.

You are right that not all clocks needs to be implemented in a ccf _driver_, 
but as the devicetree binding describes the hardware and is supposed to be 
stable and (nearly) unchangeable outside-connections of the clock block need 
to be defined carefully.


> Do you think we should model as more clocks as we can in CCF even we
> don't need them? If no, how do we handle those clocks which are not
> handled in CCF but can be parent of CCF clocks?

In general I think everything that has a connection to the outside (external 
source clock and clocks used by soc ips) should be modeled precisely. What 
then happens inside the clock controller is less important, as it normally can 
be fixed later on too.


Citing my own code [which got inspired on how Samsung did this], Rockchip 
clock controllers also have numerous possible external clock inputs with only 
the 24MHz oscillator being required [0].

All the other clocks may or may not be present. For example xin32k normally 
comes from an i2c-connected rtc or pmic chip which gets probed a lot later in 
the boot process, so we rely on the orphan-handling of the ccf for these.


So please really try to find out what these clocks are in the first place ... 
somebody must know this ;-)


Heiko


[0] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt#n26

  reply	other threads:[~2015-06-24 10:24 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18  5:29 [PATCH] arm64: dts: mt8173: add clock_null Eddie Huang
2015-06-18  5:29 ` Eddie Huang
2015-06-18  5:29 ` Eddie Huang
2015-06-18 16:15 ` Heiko Stuebner
2015-06-18 16:15   ` Heiko Stuebner
2015-06-18 16:15   ` Heiko Stuebner
2015-06-19 11:36   ` Heiko Stuebner
2015-06-19 11:36     ` Heiko Stuebner
2015-06-19 11:36     ` Heiko Stuebner
2015-06-22  3:38     ` James Liao
2015-06-22  3:38       ` James Liao
2015-06-22  3:38       ` James Liao
2015-06-22 12:53       ` Heiko Stübner
2015-06-22 12:53         ` Heiko Stübner
2015-06-22 12:53         ` Heiko Stübner
2015-06-24  7:54         ` James Liao
2015-06-24  7:54           ` James Liao
2015-06-24  7:54           ` James Liao
2015-06-24 10:24           ` Heiko Stübner [this message]
2015-06-24 10:24             ` Heiko Stübner
2015-06-24 10:24             ` Heiko Stübner
2015-06-30  9:07             ` James Liao
2015-06-30  9:07               ` James Liao
2015-06-30  9:07               ` James Liao
2015-07-01  6:49               ` Sascha Hauer
2015-07-01  6:49                 ` Sascha Hauer
2015-07-01  6:49                 ` Sascha Hauer
2015-07-01 11:54                 ` Daniel Kurtz
2015-07-01 11:54                   ` Daniel Kurtz
2015-07-02  3:06                   ` James Liao
2015-07-02  3:06                     ` James Liao
2015-07-02  3:06                     ` James Liao
2015-07-02  4:23                     ` Daniel Kurtz
2015-07-02  4:23                       ` Daniel Kurtz
2015-07-02  4:23                       ` Daniel Kurtz
2015-07-03  7:45                       ` James Liao
2015-07-03  7:45                         ` James Liao
2015-07-03  7:45                         ` James Liao
2015-07-03  8:38                         ` Heiko Stübner
2015-07-03  8:38                           ` Heiko Stübner
2015-07-03  8:38                           ` Heiko Stübner
2015-07-02  2:05                 ` James Liao
2015-07-02  2:05                   ` James Liao
2015-07-02  2:05                   ` James Liao
2015-07-07 13:07 ` Sascha Hauer
2015-07-07 13:07   ` Sascha Hauer
2015-07-07 13:07   ` Sascha Hauer
2015-07-07 14:15   ` Daniel Kurtz
2015-07-07 14:15     ` Daniel Kurtz
2015-07-07 14:15     ` Daniel Kurtz
2015-07-07 14:36     ` Sascha Hauer
2015-07-07 14:36       ` Sascha Hauer
2015-07-07 14:36       ` Sascha Hauer
2015-07-07 15:10       ` Daniel Kurtz
2015-07-07 15:10         ` Daniel Kurtz
2015-07-07 15:10         ` Daniel Kurtz
2015-07-08  2:37         ` Eddie Huang
2015-07-08  2:37           ` Eddie Huang
2015-07-08  2:37           ` Eddie Huang
2015-07-08  5:44           ` Sascha Hauer
2015-07-08  5:44             ` Sascha Hauer
2015-07-08  5:44             ` Sascha Hauer
2015-07-10  7:27             ` Eddie Huang
2015-07-10  7:27               ` Eddie Huang
2015-07-10  8:11               ` Daniel Kurtz
2015-07-10  8:11                 ` Daniel Kurtz
2015-07-10 10:29                 ` Eddie Huang
2015-07-10 10:29                   ` Eddie Huang
2015-07-10 10:29                   ` Eddie Huang

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=1510058.fTE6dlSRsH@diego \
    --to=heiko@sntech.de \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=eddie.huang@mediatek.com \
    --cc=jamesjj.liao@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.