This is v2 of the clock node renaming patch series, which renames
the clock nodes in sunxi dts to conform to device tree naming
conventions, i.e. clk at N. Dummy clocks that will be renamed/removed
later, or clocks sharing registers are not renamed.
Renamed clock nodes have clock-output-names properties added to
desginate their names. Support for this is added in the first
patch.
The last patch, which enables i2c controllers on Cubietruck, is
not related to the clocks. Just submitting them together.
Changes since v1:
* Fixed pll5, pll6 divs clock name handling
Cheers
ChenYu
Chen-Yu Tsai (8):
clk: sunxi: add clock-output-names dt property support
clk: sunxi: choose correct name for multiple output factor clocks
clk: sunxi: get divs parent clock name from parent factor clock
arm: dts: sun4i: rename clock node names to clk at N
arm: dts: sun5i: rename clock node names to clk at N
arm: dts: sun6i: rename clock node names to clk at N
arm: dts: sun7i: rename clock node names to clk at N
arm: sun7i: cubietruck: Enable the i2c controllers
arch/arm/boot/dts/sun4i-a10.dtsi | 26 +++++++++++++++-----------
arch/arm/boot/dts/sun5i-a10s.dtsi | 26 +++++++++++++++-----------
arch/arm/boot/dts/sun5i-a13.dtsi | 26 +++++++++++++++-----------
arch/arm/boot/dts/sun6i-a31.dtsi | 12 +++++++-----
arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 18 ++++++++++++++++++
arch/arm/boot/dts/sun7i-a20.dtsi | 21 ++++++++++++---------
drivers/clk/sunxi/clk-sunxi.c | 27 +++++++++++++++++----------
7 files changed, 99 insertions(+), 57 deletions(-)
--
1.8.5.2
sunxi clock drivers use dt node name as clock name, but clock
nodes should be named clk at X, so the names would be the same.
Let the drivers read clock names from dt clock-output-names
property.
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/clk/sunxi/clk-sunxi.c | 6 ++++++
1 file changed, 6 insertions(+)
Some factor clocks, such as the parent clock of pll5 and pll6, have
multiple output names. Use the last name as the name for the clock
itself.
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/clk/sunxi/clk-sunxi.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
@@ -493,14 +493,14 @@ static struct clk * __init sunxi_factors_clk_setup(struct device_node *node,(parents[i]=of_clk_get_parent_name(node,i))!=NULL)i++;-/* Nodes should be providing the name via clock-output-names-*butoriginallyourdtsdidn't,andsoweusednode->name.-*Thenew,betternodeslooklikeclkatdeadbeef,sowepullthe-*namejustinthiscase*/-if(!strcmp("clk",clk_name)){-of_property_read_string_index(node,"clock-output-names",-0,&clk_name);-}+/*+*factorclocks,suchaspll5andpll6,mayhavemultipleoutputs+*Usethelastclockoutputnameasthisclock'sname.+*Thismatchesthebehaviorofof_clk_get_parent_name()+*/+j=of_property_count_strings(node,"clock-output-names");+of_property_read_string_index(node,"clock-output-names",j-1,+&clk_name);factors=kzalloc(sizeof(structclk_factors),GFP_KERNEL);if(!factors)
Divs clocks consist of a parent factor clock with multiple outputs,
and seperate clocks for each output. Get the name of the parent
clock from the parent factor clock, instead of the DT node name.
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/clk/sunxi/clk-sunxi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -868,6 +868,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,/* Set up factor clock that we will be dividing */pclk=sunxi_factors_clk_setup(node,data->factors);+parent=__clk_get_name(pclk);reg=of_iomap(node,0);
Device tree naming conventions state that node names should match
node function. Change fully functioning clock nodes to match.
Also add the output name for pll5 to use as the clock name.
Signed-off-by: Chen-Yu Tsai <redacted>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
Device tree naming conventions state that node names should match
node function. Change fully functioning clock nodes to match.
Also add the output name for pll5 to use as the clock name.
Signed-off-by: Chen-Yu Tsai <redacted>
---
arch/arm/boot/dts/sun5i-a10s.dtsi | 26 +++++++++++++++-----------
arch/arm/boot/dts/sun5i-a13.dtsi | 26 +++++++++++++++-----------
2 files changed, 30 insertions(+), 22 deletions(-)
Device tree naming conventions state that node names should match
node function. Change fully functioning clock nodes to match.
Also add the output name for pll5 to use as the clock name.
Signed-off-by: Chen-Yu Tsai <redacted>
---
arch/arm/boot/dts/sun7i-a20.dtsi | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
The Cubietruck makes use of the first three i2c controllers found on the
Allwinner A20; i2c-0 is used internally for the PMIC, i2c-1 is exposed on
the board headers, and i2c-2 is used for DDC on the VGA connector. This
patch enables them in the device tree.
Signed-off-by: Chen-Yu Tsai <redacted>
---
arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
From: Maxime Ripard <hidden> Date: 2014-01-07 22:14:30
Hi Chen-Yu,
On Mon, Jan 06, 2014 at 01:58:05PM +0800, Chen-Yu Tsai wrote:
quoted hunk
sunxi clock drivers use dt node name as clock name, but clock
nodes should be named clk at X, so the names would be the same.
Let the drivers read clock names from dt clock-output-names
property.
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/clk/sunxi/clk-sunxi.c | 6 ++++++
1 file changed, 6 insertions(+)
From: Maxime Ripard <hidden> Date: 2014-01-07 22:16:46
On Mon, Jan 06, 2014 at 01:58:06PM +0800, Chen-Yu Tsai wrote:
Some factor clocks, such as the parent clock of pll5 and pll6, have
multiple output names. Use the last name as the name for the clock
itself.
Signed-off-by: Chen-Yu Tsai <redacted>
Acked-by: Maxime Ripard <redacted>
Mike, Emilio,
This changes the clock names with regard to the previous patches
emilio sent that will be merged in 3.14. It would be great if we could
merge this in 3.14 as well.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140107/656231d9/attachment.sig>
From: Maxime Ripard <hidden> Date: 2014-01-07 22:17:40
On Mon, Jan 06, 2014 at 01:58:07PM +0800, Chen-Yu Tsai wrote:
Divs clocks consist of a parent factor clock with multiple outputs,
and seperate clocks for each output. Get the name of the parent
clock from the parent factor clock, instead of the DT node name.
Signed-off-by: Chen-Yu Tsai <redacted>
From: Maxime Ripard <hidden> Date: 2014-01-07 22:38:23
On Mon, Jan 06, 2014 at 01:58:08PM +0800, Chen-Yu Tsai wrote:
quoted hunk
Device tree naming conventions state that node names should match
node function. Change fully functioning clock nodes to match.
Also add the output name for pll5 to use as the clock name.
Signed-off-by: Chen-Yu Tsai <redacted>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
Hmmm, I don't really like that bit too much.
This "pll5" clock doesn't actually exist at the hardware point of
view, which is not really what the DT is used for.
I can think of two ways to do what you want withouth this:
- either hardcode the name, since we have a compatible of our own here
- or use strchr to take anyhing until '_' and use that as a name
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140107/3f84527b/attachment.sig>
From: Maxime Ripard <hidden> Date: 2014-01-07 22:40:20
Hi,
On Mon, Jan 06, 2014 at 01:58:12PM +0800, Chen-Yu Tsai wrote:
The Cubietruck makes use of the first three i2c controllers found on the
Allwinner A20; i2c-0 is used internally for the PMIC, i2c-1 is exposed on
the board headers, and i2c-2 is used for DDC on the VGA connector. This
patch enables them in the device tree.
Signed-off-by: Chen-Yu Tsai <redacted>
It's not really related to the rest of the patches, so I would have
prefered it being send as a separate patch.
Anyway, it's merged now :)
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140107/58bc78e1/attachment.sig>
From: Maxime Ripard <hidden> Date: 2014-01-07 22:41:59
On Tue, Jan 07, 2014 at 11:16:46PM +0100, Maxime Ripard wrote:
On Mon, Jan 06, 2014 at 01:58:06PM +0800, Chen-Yu Tsai wrote:
quoted
Some factor clocks, such as the parent clock of pll5 and pll6, have
multiple output names. Use the last name as the name for the clock
itself.
Signed-off-by: Chen-Yu Tsai <redacted>
Acked-by: Maxime Ripard <redacted>
Mike, Emilio,
This changes the clock names with regard to the previous patches
emilio sent that will be merged in 3.14. It would be great if we could
merge this in 3.14 as well.
I've spoken a bit too fast on this, and I'm not really fond of the
patch 7 i've commented on, that depends on what is done in this patch.
We'll see what the outcome of the discussion is.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140107/b17944c8/attachment.sig>
On Wed, Jan 8, 2014 at 6:38 AM, Maxime Ripard
[off-list ref] wrote:
On Mon, Jan 06, 2014 at 01:58:08PM +0800, Chen-Yu Tsai wrote:
quoted
Device tree naming conventions state that node names should match
node function. Change fully functioning clock nodes to match.
Also add the output name for pll5 to use as the clock name.
Signed-off-by: Chen-Yu Tsai <redacted>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
Hmmm, I don't really like that bit too much.
This "pll5" clock doesn't actually exist at the hardware point of
view, which is not really what the DT is used for.
You are right. pll5 only has 2 outputs. I was matching the format of
pll6, which I'd like to include in this discussion.
Does pll6 actually have 3 outputs? or are we just using the third
output as a shortcut for mbus input of pll6*2 ?
I can think of two ways to do what you want withouth this:
- either hardcode the name, since we have a compatible of our own here
Since we have seperate compatibles for pll5 and pll6, I would prefer
to add a .name to clk_factors_config, instead of adding it in the code.
Emilio, is that okay with you?
- or use strchr to take anyhing until '_' and use that as a name
Hi,
On Wed, Jan 8, 2014 at 6:14 AM, Maxime Ripard
[off-list ref] wrote:
Hi Chen-Yu,
On Mon, Jan 06, 2014 at 01:58:05PM +0800, Chen-Yu Tsai wrote:
quoted
sunxi clock drivers use dt node name as clock name, but clock
nodes should be named clk at X, so the names would be the same.
Let the drivers read clock names from dt clock-output-names
property.
Signed-off-by: Chen-Yu Tsai <redacted>
Please document this in Documentation/devicetree/bindings.
Do you want them in the same patch, or separate?
I think someone asked about this yesterday, but don't remember
the conclusion.
Thanks
ChenYu
From: Maxime Ripard <hidden> Date: 2014-01-09 08:53:39
On Wed, Jan 08, 2014 at 09:38:52AM +0800, Chen-Yu Tsai wrote:
On Wed, Jan 8, 2014 at 6:38 AM, Maxime Ripard
[off-list ref] wrote:
quoted
On Mon, Jan 06, 2014 at 01:58:08PM +0800, Chen-Yu Tsai wrote:
quoted
Device tree naming conventions state that node names should match
node function. Change fully functioning clock nodes to match.
Also add the output name for pll5 to use as the clock name.
Signed-off-by: Chen-Yu Tsai <redacted>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
Hmmm, I don't really like that bit too much.
This "pll5" clock doesn't actually exist at the hardware point of
view, which is not really what the DT is used for.
You are right. pll5 only has 2 outputs. I was matching the format of
pll6, which I'd like to include in this discussion.
Does pll6 actually have 3 outputs? or are we just using the third
output as a shortcut for mbus input of pll6*2 ?
You are right. pll5 only has 2 outputs. I was matching the format of
pll6, which I'd like to include in this discussion.
Does pll6 actually have 3 outputs? or are we just using the third
output as a shortcut for mbus input of pll6*2 ?
Hmmm, indeed. I don't really get why pll6 has a third output
either. Emilio?
Citing the A20 user manual (my comments on the right)
-----8<------
For SATA, the output =(24MHz*N*K)/M/6 <-- we call this pll6_sata
If the SATA is on, the clock output should be equal to 100MHz;
For other module, the clock output = (24MHz*N*K)/2 <-- we call this pll6_other
PLL6*2 = 24MHz*N*K <-- this would be the third output, which we call pll6
-----8<------
This last output is used by things like mbus and LCD
Now, pll5 says
-----8<------
The PLL5 output for DDR = (24MHz*N*K)/M. <-- we call this pll5_ddr
The PLL5 output for other module =(24MHz*N*K)/P. <-- we call this pll5_other
-----8<------
There does not seem to be anything connected to "pll5" with a rate of
24MHz*N*K, but personally I would not be opposed to adding it to the
DT for consistency with pll6. After all, it actually is the common
ancestor of pll5_ddr and pll5_other.
There's also some ASCII art on the code to visualize these clocks better
http://git.linaro.org/people/mike.turquette/linux.git/blob/refs/heads/clk-next:/drivers/clk/sunxi/clk-sunxi.c#l842
I hope this clarifies things.
Cheers,
Emilio
Hi,
On Thu, Jan 9, 2014 at 11:47 PM, Emilio L?pez [off-list ref] wrote:
Hi,
2014/1/9 Maxime Ripard [off-list ref]:
quoted
quoted
You are right. pll5 only has 2 outputs. I was matching the format of
pll6, which I'd like to include in this discussion.
Does pll6 actually have 3 outputs? or are we just using the third
output as a shortcut for mbus input of pll6*2 ?
Hmmm, indeed. I don't really get why pll6 has a third output
either. Emilio?
Citing the A20 user manual (my comments on the right)
-----8<------
For SATA, the output =(24MHz*N*K)/M/6 <-- we call this pll6_sata
If the SATA is on, the clock output should be equal to 100MHz;
For other module, the clock output = (24MHz*N*K)/2 <-- we call this pll6_other
PLL6*2 = 24MHz*N*K <-- this would be the third output, which we call pll6
-----8<------
This last output is used by things like mbus and LCD
A wild guess, maybe those modules have a frequency doubler after the
PLL6 input? Though pll6 direct output seems more reasonable.
Do we want to match the hardware exactly? If so we might want to ask Allwinner.
Now, pll5 says
-----8<------
The PLL5 output for DDR = (24MHz*N*K)/M. <-- we call this pll5_ddr
The PLL5 output for other module =(24MHz*N*K)/P. <-- we call this pll5_other
-----8<------
There does not seem to be anything connected to "pll5" with a rate of
24MHz*N*K, but personally I would not be opposed to adding it to the
DT for consistency with pll6. After all, it actually is the common
ancestor of pll5_ddr and pll5_other.
I already posted a version without adding "pll5". The names are coded into
factors_data instead.
Cheers,
ChenYu