All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@marvell.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	<sboyd@codeaurora.org>
Cc: <mark.rutland@arm.com>, <devicetree@vger.kernel.org>,
	<pawel.moll@arm.com>, <ijc+devicetree@hellion.org.uk>,
	<catalin.marinas@arm.com>, <mturquette@baylibre.com>,
	<will.deacon@arm.com>, <linux-kernel@vger.kernel.org>,
	<linux-clk@vger.kernel.org>, <antoine.tenart@free-electrons.com>,
	<robh+dt@kernel.org>, <galak@codeaurora.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 6/6] arm64: dts: berlin4ct: add pll and clock nodes
Date: Tue, 24 Nov 2015 10:35:04 +0800	[thread overview]
Message-ID: <20151124103504.0a07b258@xhacker> (raw)
In-Reply-To: <20151123165444.740b457c@xhacker>

Dear Sebastian,

On Mon, 23 Nov 2015 16:54:44 +0800
Jisheng Zhang wrote:

> On Mon, 23 Nov 2015 09:30:42 +0100
> Sebastian Hesselbarth wrote:
> 
> > On 23.11.2015 08:21, Jisheng Zhang wrote:  
> > > On Fri, 20 Nov 2015 22:06:59 +0100
> > > Sebastian Hesselbarth wrote:    
> > >> On 20.11.2015 09:42, Jisheng Zhang wrote:    
> > >>> Add syspll, mempll, cpupll, gateclk and berlin-clk nodes.
> > >>>
> > >>> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > >>> ---    
> > [...]  
> > >>> +		syspll: syspll {
> > >>> +			compatible = "marvell,berlin-pll";
> > >>> +			reg = <0xea0200 0x14>, <0xea0710 4>;
> > >>> +			#clock-cells = <0>;
> > >>> +			clocks = <&osc>;
> > >>> +			bypass-shift = /bits/ 8 <0>;
> > >>> +		};
> > >>> +
> > >>> +		gateclk: gateclk {
> > >>> +			compatible = "marvell,berlin4ct-gateclk";
> > >>> +			reg = <0xea0700 4>;
> > >>> +			#clock-cells = <1>;
> > >>> +		};
> > >>> +
> > >>> +		clk: clk {
> > >>> +			compatible = "marvell,berlin4ct-clk";
> > >>> +			reg = <0xea0720 0x144>;    
> > >>
> > >> Looking at the reg ranges, I'd say that they are all clock related
> > >> and pretty close to each other:
> > >>
> > >> gateclk: reg = <0xea0700 4>;
> > >> bypass:  reg = <0xea0710 4>;
> > >> clk:     reg = <0xea0720 0x144>;    
> > >
> > > Although these ranges sit close, but we should represent HW structure as you
> > > said.    
> > 
> > Then how do you argue that you have to share the gate clock register
> > with every PLL? The answer is quite simple: You are not separating by
> > HW either but existing SW API.  
> 
> No, PLLs don't share register any more. You can find what all clock nodes will
> look like in:
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-November/387322.html
> 
> > 
> > If you would really want to just describe the HW, then you'd have to
> > have a single node for _all_ clocks that get controlled by 0xea0700/0x4,
> > feed some 32+ clocks into the node, and out again. Obviously, this
> > isn't what we want, right?  
> 
> I represented the HW by "kind", for example, gateclks, common-clks, pllclk.
> And let common PLLs follow this rule as well:
> 
> one node for all common plls
> 
> reg <0x922000 0x14>, <0x940034 0x14>, <0xea0200 0x14>
> 
> > 
> > So, the idea of berlin2 sysctrl nodes (and similar other SoCs) is: Some
> > SoCs just dump some functions into a bunch of registers with no
> > particular order. We'd never find a good representation for that in DT,
> > so we don't bother to try but let the driver implementation deal with
> > the mess. Using "simple-mfd" is a nice solution to scattered registers
> > please have a look at it and come up with a cleaner separation for bg4
> > clock.
> >   
> > > First of all, let me describe the clks/plls in BG4CT. BG4CT contains:
> > >
> > > two kinds of PLL: normal PLL and AVPLL. These PLLs are put with their users
> > > together. For example: mempll pll registers <0xf7940034, 0x14> is put together
> > > with mem controller registers. AVPLL control registers are put with AV devices.    
> > 
> > Why didn't you choose to have a memory-controller node that provides
> > mempll clock then? I am open to having multiple nodes providing clocks
> > but having a node for every clock in any subsystem is something I'll
> > not even think about.  
> 
> OK. As you said, "SoCs just dump some functions into a bunch of registers with
> no particular order", BG4CT is now cleaner, all common-clks are put together,
> gate-clks are put together, pllclks are put together, only the common PLLs
> are dumped here and there. So how about representing the HW by "kind", one
> node for common plls, one node for gateclks, one node for common clks and 
> one node for pllclks?
> 
>                 pll: pll {
>                         compatible = "marvell,berlin4ct-pll";
>                         reg = <0x922000 0x14>, <0x940034 0x14>, <0xea0200 0x14>
>                         #clock-cells = <0>;

should be "#clock-cells = <1>;"

>                         clocks = <&osc>;
>                 };
> 
> 		pllclk: pllclk {
>                         compatible = "marvell,berlin4ct-pllclk";
>                         reg = <0xea0710 4>
>                         #clock-cells = <1>;
> 		};
> 
>                 gateclk: gateclk {
>                         compatible = "marvell,berlin4ct-gateclk";
>                         reg = <0xea0700 4>;
>                         #clock-cells = <1>;
>                 };
> 
>                 clk: clk {
>                         compatible = "marvell,berlin4ct-clk";
>                         reg = <0xea0720 0x144>;
>                         #clock-cells = <1>;
>                         clocks = <&pllclk SYSPLLCLK>;
>                 };
> 

there's no a node for every clock with this proposal, all clks/plls are separated
by "kind". Is this OK for you?

thanks

WARNING: multiple messages have this Message-ID (diff)
From: jszhang@marvell.com (Jisheng Zhang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 6/6] arm64: dts: berlin4ct: add pll and clock nodes
Date: Tue, 24 Nov 2015 10:35:04 +0800	[thread overview]
Message-ID: <20151124103504.0a07b258@xhacker> (raw)
In-Reply-To: <20151123165444.740b457c@xhacker>

Dear Sebastian,

On Mon, 23 Nov 2015 16:54:44 +0800
Jisheng Zhang wrote:

> On Mon, 23 Nov 2015 09:30:42 +0100
> Sebastian Hesselbarth wrote:
> 
> > On 23.11.2015 08:21, Jisheng Zhang wrote:  
> > > On Fri, 20 Nov 2015 22:06:59 +0100
> > > Sebastian Hesselbarth wrote:    
> > >> On 20.11.2015 09:42, Jisheng Zhang wrote:    
> > >>> Add syspll, mempll, cpupll, gateclk and berlin-clk nodes.
> > >>>
> > >>> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > >>> ---    
> > [...]  
> > >>> +		syspll: syspll {
> > >>> +			compatible = "marvell,berlin-pll";
> > >>> +			reg = <0xea0200 0x14>, <0xea0710 4>;
> > >>> +			#clock-cells = <0>;
> > >>> +			clocks = <&osc>;
> > >>> +			bypass-shift = /bits/ 8 <0>;
> > >>> +		};
> > >>> +
> > >>> +		gateclk: gateclk {
> > >>> +			compatible = "marvell,berlin4ct-gateclk";
> > >>> +			reg = <0xea0700 4>;
> > >>> +			#clock-cells = <1>;
> > >>> +		};
> > >>> +
> > >>> +		clk: clk {
> > >>> +			compatible = "marvell,berlin4ct-clk";
> > >>> +			reg = <0xea0720 0x144>;    
> > >>
> > >> Looking at the reg ranges, I'd say that they are all clock related
> > >> and pretty close to each other:
> > >>
> > >> gateclk: reg = <0xea0700 4>;
> > >> bypass:  reg = <0xea0710 4>;
> > >> clk:     reg = <0xea0720 0x144>;    
> > >
> > > Although these ranges sit close, but we should represent HW structure as you
> > > said.    
> > 
> > Then how do you argue that you have to share the gate clock register
> > with every PLL? The answer is quite simple: You are not separating by
> > HW either but existing SW API.  
> 
> No, PLLs don't share register any more. You can find what all clock nodes will
> look like in:
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-November/387322.html
> 
> > 
> > If you would really want to just describe the HW, then you'd have to
> > have a single node for _all_ clocks that get controlled by 0xea0700/0x4,
> > feed some 32+ clocks into the node, and out again. Obviously, this
> > isn't what we want, right?  
> 
> I represented the HW by "kind", for example, gateclks, common-clks, pllclk.
> And let common PLLs follow this rule as well:
> 
> one node for all common plls
> 
> reg <0x922000 0x14>, <0x940034 0x14>, <0xea0200 0x14>
> 
> > 
> > So, the idea of berlin2 sysctrl nodes (and similar other SoCs) is: Some
> > SoCs just dump some functions into a bunch of registers with no
> > particular order. We'd never find a good representation for that in DT,
> > so we don't bother to try but let the driver implementation deal with
> > the mess. Using "simple-mfd" is a nice solution to scattered registers
> > please have a look at it and come up with a cleaner separation for bg4
> > clock.
> >   
> > > First of all, let me describe the clks/plls in BG4CT. BG4CT contains:
> > >
> > > two kinds of PLL: normal PLL and AVPLL. These PLLs are put with their users
> > > together. For example: mempll pll registers <0xf7940034, 0x14> is put together
> > > with mem controller registers. AVPLL control registers are put with AV devices.    
> > 
> > Why didn't you choose to have a memory-controller node that provides
> > mempll clock then? I am open to having multiple nodes providing clocks
> > but having a node for every clock in any subsystem is something I'll
> > not even think about.  
> 
> OK. As you said, "SoCs just dump some functions into a bunch of registers with
> no particular order", BG4CT is now cleaner, all common-clks are put together,
> gate-clks are put together, pllclks are put together, only the common PLLs
> are dumped here and there. So how about representing the HW by "kind", one
> node for common plls, one node for gateclks, one node for common clks and 
> one node for pllclks?
> 
>                 pll: pll {
>                         compatible = "marvell,berlin4ct-pll";
>                         reg = <0x922000 0x14>, <0x940034 0x14>, <0xea0200 0x14>
>                         #clock-cells = <0>;

should be "#clock-cells = <1>;"

>                         clocks = <&osc>;
>                 };
> 
> 		pllclk: pllclk {
>                         compatible = "marvell,berlin4ct-pllclk";
>                         reg = <0xea0710 4>
>                         #clock-cells = <1>;
> 		};
> 
>                 gateclk: gateclk {
>                         compatible = "marvell,berlin4ct-gateclk";
>                         reg = <0xea0700 4>;
>                         #clock-cells = <1>;
>                 };
> 
>                 clk: clk {
>                         compatible = "marvell,berlin4ct-clk";
>                         reg = <0xea0720 0x144>;
>                         #clock-cells = <1>;
>                         clocks = <&pllclk SYSPLLCLK>;
>                 };
> 

there's no a node for every clock with this proposal, all clks/plls are separated
by "kind". Is this OK for you?

thanks

WARNING: multiple messages have this Message-ID (diff)
From: Jisheng Zhang <jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
To: Sebastian Hesselbarth
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	catalin.marinas-5wv7dgnIgG8@public.gmane.org,
	mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2 6/6] arm64: dts: berlin4ct: add pll and clock nodes
Date: Tue, 24 Nov 2015 10:35:04 +0800	[thread overview]
Message-ID: <20151124103504.0a07b258@xhacker> (raw)
In-Reply-To: <20151123165444.740b457c@xhacker>

Dear Sebastian,

On Mon, 23 Nov 2015 16:54:44 +0800
Jisheng Zhang wrote:

> On Mon, 23 Nov 2015 09:30:42 +0100
> Sebastian Hesselbarth wrote:
> 
> > On 23.11.2015 08:21, Jisheng Zhang wrote:  
> > > On Fri, 20 Nov 2015 22:06:59 +0100
> > > Sebastian Hesselbarth wrote:    
> > >> On 20.11.2015 09:42, Jisheng Zhang wrote:    
> > >>> Add syspll, mempll, cpupll, gateclk and berlin-clk nodes.
> > >>>
> > >>> Signed-off-by: Jisheng Zhang <jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> > >>> ---    
> > [...]  
> > >>> +		syspll: syspll {
> > >>> +			compatible = "marvell,berlin-pll";
> > >>> +			reg = <0xea0200 0x14>, <0xea0710 4>;
> > >>> +			#clock-cells = <0>;
> > >>> +			clocks = <&osc>;
> > >>> +			bypass-shift = /bits/ 8 <0>;
> > >>> +		};
> > >>> +
> > >>> +		gateclk: gateclk {
> > >>> +			compatible = "marvell,berlin4ct-gateclk";
> > >>> +			reg = <0xea0700 4>;
> > >>> +			#clock-cells = <1>;
> > >>> +		};
> > >>> +
> > >>> +		clk: clk {
> > >>> +			compatible = "marvell,berlin4ct-clk";
> > >>> +			reg = <0xea0720 0x144>;    
> > >>
> > >> Looking at the reg ranges, I'd say that they are all clock related
> > >> and pretty close to each other:
> > >>
> > >> gateclk: reg = <0xea0700 4>;
> > >> bypass:  reg = <0xea0710 4>;
> > >> clk:     reg = <0xea0720 0x144>;    
> > >
> > > Although these ranges sit close, but we should represent HW structure as you
> > > said.    
> > 
> > Then how do you argue that you have to share the gate clock register
> > with every PLL? The answer is quite simple: You are not separating by
> > HW either but existing SW API.  
> 
> No, PLLs don't share register any more. You can find what all clock nodes will
> look like in:
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-November/387322.html
> 
> > 
> > If you would really want to just describe the HW, then you'd have to
> > have a single node for _all_ clocks that get controlled by 0xea0700/0x4,
> > feed some 32+ clocks into the node, and out again. Obviously, this
> > isn't what we want, right?  
> 
> I represented the HW by "kind", for example, gateclks, common-clks, pllclk.
> And let common PLLs follow this rule as well:
> 
> one node for all common plls
> 
> reg <0x922000 0x14>, <0x940034 0x14>, <0xea0200 0x14>
> 
> > 
> > So, the idea of berlin2 sysctrl nodes (and similar other SoCs) is: Some
> > SoCs just dump some functions into a bunch of registers with no
> > particular order. We'd never find a good representation for that in DT,
> > so we don't bother to try but let the driver implementation deal with
> > the mess. Using "simple-mfd" is a nice solution to scattered registers
> > please have a look at it and come up with a cleaner separation for bg4
> > clock.
> >   
> > > First of all, let me describe the clks/plls in BG4CT. BG4CT contains:
> > >
> > > two kinds of PLL: normal PLL and AVPLL. These PLLs are put with their users
> > > together. For example: mempll pll registers <0xf7940034, 0x14> is put together
> > > with mem controller registers. AVPLL control registers are put with AV devices.    
> > 
> > Why didn't you choose to have a memory-controller node that provides
> > mempll clock then? I am open to having multiple nodes providing clocks
> > but having a node for every clock in any subsystem is something I'll
> > not even think about.  
> 
> OK. As you said, "SoCs just dump some functions into a bunch of registers with
> no particular order", BG4CT is now cleaner, all common-clks are put together,
> gate-clks are put together, pllclks are put together, only the common PLLs
> are dumped here and there. So how about representing the HW by "kind", one
> node for common plls, one node for gateclks, one node for common clks and 
> one node for pllclks?
> 
>                 pll: pll {
>                         compatible = "marvell,berlin4ct-pll";
>                         reg = <0x922000 0x14>, <0x940034 0x14>, <0xea0200 0x14>
>                         #clock-cells = <0>;

should be "#clock-cells = <1>;"

>                         clocks = <&osc>;
>                 };
> 
> 		pllclk: pllclk {
>                         compatible = "marvell,berlin4ct-pllclk";
>                         reg = <0xea0710 4>
>                         #clock-cells = <1>;
> 		};
> 
>                 gateclk: gateclk {
>                         compatible = "marvell,berlin4ct-gateclk";
>                         reg = <0xea0700 4>;
>                         #clock-cells = <1>;
>                 };
> 
>                 clk: clk {
>                         compatible = "marvell,berlin4ct-clk";
>                         reg = <0xea0720 0x144>;
>                         #clock-cells = <1>;
>                         clocks = <&pllclk SYSPLLCLK>;
>                 };
> 

there's no a node for every clock with this proposal, all clks/plls are separated
by "kind". Is this OK for you?

thanks
--
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

  reply	other threads:[~2015-11-24  2:35 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  8:42 [PATCH v2 0/6] Add Marvell berlin4ct clk support Jisheng Zhang
2015-11-20  8:42 ` Jisheng Zhang
2015-11-20  8:42 ` Jisheng Zhang
2015-11-20  8:42 ` [PATCH v2 1/6] clk: berlin: add common pll driver Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20 20:46   ` Sebastian Hesselbarth
2015-11-20 20:46     ` Sebastian Hesselbarth
2015-11-20  8:42 ` [PATCH v2 2/6] clk: berlin: add common clk driver for newer SoCs Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20 20:54   ` Sebastian Hesselbarth
2015-11-20 20:54     ` Sebastian Hesselbarth
2015-11-20  8:42 ` [PATCH v2 3/6] clk: berlin: add common gateclk " Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20  8:42 ` [PATCH v2 4/6] clk: berlin: add clk support for berlin4ct Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20 20:56   ` Sebastian Hesselbarth
2015-11-20 20:56     ` Sebastian Hesselbarth
2015-11-23  5:56     ` Jisheng Zhang
2015-11-23  5:56       ` Jisheng Zhang
2015-11-23  5:56       ` Jisheng Zhang
2015-11-20  8:42 ` [PATCH v2 5/6] dt-bindings: add binding for marvell berlin4ct SoC Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20 14:37   ` Rob Herring
2015-11-20 14:37     ` Rob Herring
2015-11-20  8:42 ` [PATCH v2 6/6] arm64: dts: berlin4ct: add pll and clock nodes Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20  8:42   ` Jisheng Zhang
2015-11-20 21:06   ` Sebastian Hesselbarth
2015-11-20 21:06     ` Sebastian Hesselbarth
2015-11-20 21:06     ` Sebastian Hesselbarth
2015-11-23  7:21     ` Jisheng Zhang
2015-11-23  7:21       ` Jisheng Zhang
2015-11-23  7:21       ` Jisheng Zhang
2015-11-23  7:21       ` Jisheng Zhang
2015-11-23  8:14       ` Jisheng Zhang
2015-11-23  8:14         ` Jisheng Zhang
2015-11-23  8:14         ` Jisheng Zhang
2015-11-23  8:30       ` Sebastian Hesselbarth
2015-11-23  8:30         ` Sebastian Hesselbarth
2015-11-23  8:54         ` Jisheng Zhang
2015-11-23  8:54           ` Jisheng Zhang
2015-11-23  8:54           ` Jisheng Zhang
2015-11-24  2:35           ` Jisheng Zhang [this message]
2015-11-24  2:35             ` Jisheng Zhang
2015-11-24  2:35             ` Jisheng Zhang
2015-11-27  7:51             ` Sebastian Hesselbarth
2015-11-27  7:51               ` Sebastian Hesselbarth
2015-11-27  8:39               ` Jisheng Zhang
2015-11-27  8:39                 ` Jisheng Zhang
2015-11-27  8:39                 ` Jisheng Zhang
2015-11-27  8:45                 ` Jisheng Zhang
2015-11-27  8:45                   ` Jisheng Zhang
2015-11-27  8:45                   ` Jisheng Zhang

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=20151124103504.0a07b258@xhacker \
    --to=jszhang@marvell.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=will.deacon@arm.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 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.