Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1171156 > unrolled thread
| Started by | James Liao <jamesjj.liao@mediatek.com> |
|---|---|
| First post | 2015-06-24 10:00 +0200 |
| Last post | 2015-07-02 04:10 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] arm64: dts: mt8173: add clock_null James Liao <jamesjj.liao@mediatek.com> - 2015-06-24 10:00 +0200
Re: [PATCH] arm64: dts: mt8173: add clock_null James Liao <jamesjj.liao@mediatek.com> - 2015-07-02 04:10 +0200
| From | James Liao <jamesjj.liao@mediatek.com> |
|---|---|
| Date | 2015-06-24 10:00 +0200 |
| Subject | Re: [PATCH] arm64: dts: mt8173: add clock_null |
| Message-ID | <pENLc-3Bl-3@gated-at.bofh.it> |
Hi Heiko, 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. 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. 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? Best regards, James -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | James Liao <jamesjj.liao@mediatek.com> |
|---|---|
| Date | 2015-07-02 04:10 +0200 |
| Message-ID | <pHC6S-4VO-17@gated-at.bofh.it> |
| In reply to | #1171156 |
Hi Sascha,
On Wed, 2015-07-01 at 08:49 +0200, Sascha Hauer wrote:
> On Tue, Jun 30, 2015 at 05:07:09PM +0800, James Liao wrote:
> > There are 4 clocks which are derived from clk_null directly in current
> > topckgen implementation:
> >
> > clkph_mck_o, dpi_ck, usb_syspll_125m, hdmitx_dig_cts
> >
> > Our designer mentioned 2 things about external clocks:
> >
> > 1. These 4 clocks come from analog macro, not from PLL, nor from
> > external clocks directly.
>
> Ok, this means there actually are clocks. We can't control these clock and
> they have some known or unknown rate. This makes them fixed clocks. Just
> specify them in the device tree and you are done. Give them reasonable
> names and the rate if you know it, 0 otherwise.
>
> The problem is not that you use fixed clocks for non software
> controllable clocks of unknwown rates, but that you try to use a single
> clock for all of them and name it 'dummy' or 'null'. Name it
>
> dpi_ck {
> compatible = "fixed-clock";
> rate = <0>; /* unknown, generated by some Analog block */
> };
>
> Technically it's the same, but it sounds much more professional and like
> you know what you are doing ;)
These clocks are SoC internal clocks. Is it suitable to specify them in
the device tree?
According to your and Heiko's suggestion, it looks the best way should
be specifying these clocks in the driver code without a dummy parent.
i.e.:
Original code:
FACTOR(CLK_TOP_CLKPH_MCK_O, "clkph_mck_o", "clk_null", 1, 1),
FACTOR(CLK_TOP_DPI, "dpi_ck", "clk_null", 1, 1),
FACTOR(CLK_TOP_USB_SYSPLL_125M, "usb_syspll_125m", "clk_null", 1, 1),
FACTOR(CLK_TOP_HDMITX_DIG_CTS, "hdmitx_dig_cts", "clk_null", 1, 1),
New code:
FIXED(CLK_TOP_CLKPH_MCK_O, "clkph_mck_o", UNKNOWN_RATE),
FIXED(CLK_TOP_DPI, "dpi_ck", UNKNOWN_RATE),
FIXED(CLK_TOP_USB_SYSPLL_125M, "usb_syspll_125m", UNKNOWN_RATE),
FIXED(CLK_TOP_HDMITX_DIG_CTS, "hdmitx_dig_cts", UNKNOWN_RATE),
Then we don't need to specify a dummy clock such as clk_null in device
tree.
Best regards,
James
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web