All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues
@ 2015-03-24 17:22 Chen-Yu Tsai
  2015-03-24 17:22 ` [PATCH v2 1/3] clk: sunxi: Make divs clocks specify which output is the base factor clock Chen-Yu Tsai
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Chen-Yu Tsai @ 2015-03-24 17:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi everyone,

This is v2 of the sun5i muxable AHB clock series.

Changes since v1:

  - Dropped patches 1~3 that are merged
  - Extend comments to clarify what the "base factor clock" refers to,
    and what the divs clocks outputs should be.


This series adds support for the muxable ahb clock on sun5/7i. The mux
has inputs such as the axi clock, the cpu clock on sun5i, and pll6 with
various dividers. The goal is to have ahb muxed to pll6, which should
be a fixed rate albeit configurable clock. This fixes issues with
cpufreq changing the cpu frequency, which would affect the hstimer
clocked from ahb.

Patch 1 makes divs clocks explicitly specify in the driver which output
is the base factor clock, instead of always putting it in last. This is
done to ensure DT bindings compatibility when we add outputs.

Patch 2 adds the new pll6/4 output, which is used on sun7i as an input
to ahb mux.

Patch 3 updates the dtsi files with the new drivers.

The series is also available at

    https://github.com/wens/linux/commits/sun5i-ahb-v2


Regards
ChenYu

Chen-Yu Tsai (3):
  clk: sunxi: Make divs clocks specify which output is the base factor
    clock
  clk: sunxi: Add pll6 / 4 clock output to sun4i-a10-pll6
  ARM: dts: sunxi: Update ahb clocks for sun5i and sun7i

 arch/arm/boot/dts/sun5i.dtsi     | 10 ++++++++--
 arch/arm/boot/dts/sun7i-a20.dtsi | 13 ++++++++++---
 drivers/clk/sunxi/clk-sunxi.c    | 38 ++++++++++++++++++++++++++------------
 3 files changed, 44 insertions(+), 17 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/3] clk: sunxi: Make divs clocks specify which output is the base factor clock
  2015-03-24 17:22 [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Chen-Yu Tsai
@ 2015-03-24 17:22 ` Chen-Yu Tsai
  2015-03-24 17:22 ` [PATCH v2 2/3] clk: sunxi: Add pll6 / 4 clock output to sun4i-a10-pll6 Chen-Yu Tsai
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Chen-Yu Tsai @ 2015-03-24 17:22 UTC (permalink / raw)
  To: linux-arm-kernel

The current sunxi clock driver has the base factor clock of divs clocks
as the last clock output of the clock node. This makes it rather difficult
to add new outputs, such as fixed dividers, which were previously unknown.

This patch makes the divs clocks data structure specify which output is
the factor clock, and updates all current divs clocks accordingly.

We can then add new outputs after the factor clocks, at least not breaking
backward compatibility with regards to the devicetree bindings.

Also replace kzalloc with kcalloc in sunxi_divs_clk_setup().

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/clk/sunxi/clk-sunxi.c | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index d92e30371d8a..9f31314a9cd7 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -1046,13 +1046,20 @@ static void __init sunxi_gates_clk_setup(struct device_node *node,
  * sunxi_divs_clk_setup() helper data
  */
 
-#define SUNXI_DIVS_MAX_QTY	2
+#define SUNXI_DIVS_MAX_QTY	4
 #define SUNXI_DIVISOR_WIDTH	2
 
 struct divs_data {
 	const struct factors_data *factors; /* data for the factor clock */
-	int ndivs; /* number of children */
+	int ndivs; /* number of outputs */
+	/*
+	 * List of outputs. Refer to the diagram for sunxi_divs_clk_setup():
+	 * self or base factor clock refers to the output from the pll
+	 * itself. The remaining refer to fixed or configurable divider
+	 * outputs.
+	 */
 	struct {
+		u8 self; /* is it the base factor clock? (only one) */
 		u8 fixed; /* is it a fixed divisor? if not... */
 		struct clk_div_table *table; /* is it a table based divisor? */
 		u8 shift; /* otherwise it's a normal divisor with this shift */
@@ -1075,23 +1082,26 @@ static const struct divs_data pll5_divs_data __initconst = {
 	.div = {
 		{ .shift = 0, .pow = 0, }, /* M, DDR */
 		{ .shift = 16, .pow = 1, }, /* P, other */
+		/* No output for the base factor clock */
 	}
 };
 
 static const struct divs_data pll6_divs_data __initconst = {
 	.factors = &sun4i_pll6_data,
-	.ndivs = 2,
+	.ndivs = 3,
 	.div = {
 		{ .shift = 0, .table = pll6_sata_tbl, .gate = 14 }, /* M, SATA */
 		{ .fixed = 2 }, /* P, other */
+		{ .self = 1 }, /* base factor clock, 2x */
 	}
 };
 
 static const struct divs_data sun6i_a31_pll6_divs_data __initconst = {
 	.factors = &sun6i_a31_pll6_data,
-	.ndivs = 1,
+	.ndivs = 2,
 	.div = {
 		{ .fixed = 2 }, /* normal output */
+		{ .self = 1 }, /* base factor clock, 2x */
 	}
 };
 
@@ -1122,6 +1132,10 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
 	int ndivs = SUNXI_DIVS_MAX_QTY, i = 0;
 	int flags, clkflags;
 
+	/* if number of children known, use it */
+	if (data->ndivs)
+		ndivs = data->ndivs;
+
 	/* Set up factor clock that we will be dividing */
 	pclk = sunxi_factors_clk_setup(node, data->factors);
 	parent = __clk_get_name(pclk);
@@ -1132,7 +1146,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
 	if (!clk_data)
 		return;
 
-	clks = kzalloc((SUNXI_DIVS_MAX_QTY+1) * sizeof(*clks), GFP_KERNEL);
+	clks = kcalloc(ndivs, sizeof(*clks), GFP_KERNEL);
 	if (!clks)
 		goto free_clkdata;
 
@@ -1142,15 +1156,17 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
 	 * our RAM clock! */
 	clkflags = !strcmp("pll5", parent) ? 0 : CLK_SET_RATE_PARENT;
 
-	/* if number of children known, use it */
-	if (data->ndivs)
-		ndivs = data->ndivs;
-
 	for (i = 0; i < ndivs; i++) {
 		if (of_property_read_string_index(node, "clock-output-names",
 						  i, &clk_name) != 0)
 			break;
 
+		/* If this is the base factor clock, only update clks */
+		if (data->div[i].self) {
+			clk_data->clks[i] = pclk;
+			continue;
+		}
+
 		gate_hw = NULL;
 		rate_hw = NULL;
 		rate_ops = NULL;
@@ -1209,9 +1225,6 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
 		clk_register_clkdev(clks[i], clk_name, NULL);
 	}
 
-	/* The last clock available on the getter is the parent */
-	clks[i++] = pclk;
-
 	/* Adjust to the real max */
 	clk_data->clk_num = i;
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/3] clk: sunxi: Add pll6 / 4 clock output to sun4i-a10-pll6
  2015-03-24 17:22 [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Chen-Yu Tsai
  2015-03-24 17:22 ` [PATCH v2 1/3] clk: sunxi: Make divs clocks specify which output is the base factor clock Chen-Yu Tsai
@ 2015-03-24 17:22 ` Chen-Yu Tsai
  2015-03-24 17:22 ` [PATCH v2 3/3] ARM: dts: sunxi: Update ahb clocks for sun5i and sun7i Chen-Yu Tsai
  2015-03-25 18:51 ` [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Maxime Ripard
  3 siblings, 0 replies; 9+ messages in thread
From: Chen-Yu Tsai @ 2015-03-24 17:22 UTC (permalink / raw)
  To: linux-arm-kernel

The pll6 has a /4 output that is used as an input to the ahb mux clock.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/clk/sunxi/clk-sunxi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 9f31314a9cd7..7e1e2bd189b6 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -1088,11 +1088,12 @@ static const struct divs_data pll5_divs_data __initconst = {
 
 static const struct divs_data pll6_divs_data __initconst = {
 	.factors = &sun4i_pll6_data,
-	.ndivs = 3,
+	.ndivs = 4,
 	.div = {
 		{ .shift = 0, .table = pll6_sata_tbl, .gate = 14 }, /* M, SATA */
 		{ .fixed = 2 }, /* P, other */
 		{ .self = 1 }, /* base factor clock, 2x */
+		{ .fixed = 4 }, /* pll6 / 4, used as ahb input */
 	}
 };
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/3] ARM: dts: sunxi: Update ahb clocks for sun5i and sun7i
  2015-03-24 17:22 [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Chen-Yu Tsai
  2015-03-24 17:22 ` [PATCH v2 1/3] clk: sunxi: Make divs clocks specify which output is the base factor clock Chen-Yu Tsai
  2015-03-24 17:22 ` [PATCH v2 2/3] clk: sunxi: Add pll6 / 4 clock output to sun4i-a10-pll6 Chen-Yu Tsai
@ 2015-03-24 17:22 ` Chen-Yu Tsai
  2015-03-25 18:51 ` [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Maxime Ripard
  3 siblings, 0 replies; 9+ messages in thread
From: Chen-Yu Tsai @ 2015-03-24 17:22 UTC (permalink / raw)
  To: linux-arm-kernel

The clock driver now supports a muxable ahb clock. Update the dtsi
with the proper compatible and add the new parent clocks.

This also adds the new pll6/4 output for pll6 on sun7i-a20. The
output is not used on sun4/5i.

Also use assigned-clocks to reparent ahb to pll6. We want ahb to
have a stable, non-changing clock rate. cpu/axi clock rate changes
as a result of newly added cpufreq support.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun5i.dtsi     | 10 ++++++++--
 arch/arm/boot/dts/sun7i-a20.dtsi | 13 ++++++++++---
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
index e42cbb03620f..df79b4c75b34 100644
--- a/arch/arm/boot/dts/sun5i.dtsi
+++ b/arch/arm/boot/dts/sun5i.dtsi
@@ -150,10 +150,16 @@
 
 		ahb: ahb at 01c20054 {
 			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-ahb-clk";
+			compatible = "allwinner,sun5i-a13-ahb-clk";
 			reg = <0x01c20054 0x4>;
-			clocks = <&axi>;
+			clocks = <&axi>, <&cpu>, <&pll6 1>;
 			clock-output-names = "ahb";
+			/*
+			 * Use PLL6 as parent, instead of CPU/AXI
+			 * which has rate changes due to cpufreq
+			 */
+			assigned-clocks = <&ahb>;
+			assigned-clock-parents = <&pll6 1>;
 		};
 
 		apb0: apb0 at 01c20054 {
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index 3a8530b79f1c..52538beb969a 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -225,7 +225,8 @@
 			compatible = "allwinner,sun4i-a10-pll6-clk";
 			reg = <0x01c20028 0x4>;
 			clocks = <&osc24M>;
-			clock-output-names = "pll6_sata", "pll6_other", "pll6";
+			clock-output-names = "pll6_sata", "pll6_other", "pll6",
+					     "pll6_div_4";
 		};
 
 		pll8: clk at 01c20040 {
@@ -254,10 +255,16 @@
 
 		ahb: ahb at 01c20054 {
 			#clock-cells = <0>;
-			compatible = "allwinner,sun4i-a10-ahb-clk";
+			compatible = "allwinner,sun5i-a13-ahb-clk";
 			reg = <0x01c20054 0x4>;
-			clocks = <&axi>;
+			clocks = <&axi>, <&pll6 3>, <&pll6 1>;
 			clock-output-names = "ahb";
+			/*
+			 * Use PLL6 as parent, instead of CPU/AXI
+			 * which has rate changes due to cpufreq
+			 */
+			assigned-clocks = <&ahb>;
+			assigned-clock-parents = <&pll6 3>;
 		};
 
 		ahb_gates: clk at 01c20060 {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues
  2015-03-24 17:22 [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2015-03-24 17:22 ` [PATCH v2 3/3] ARM: dts: sunxi: Update ahb clocks for sun5i and sun7i Chen-Yu Tsai
@ 2015-03-25 18:51 ` Maxime Ripard
  2015-03-25 20:13   ` Chen-Yu Tsai
  3 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2015-03-25 18:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 25, 2015 at 01:22:06AM +0800, Chen-Yu Tsai wrote:
> Hi everyone,
> 
> This is v2 of the sun5i muxable AHB clock series.
> 
> Changes since v1:
> 
>   - Dropped patches 1~3 that are merged
>   - Extend comments to clarify what the "base factor clock" refers to,
>     and what the divs clocks outputs should be.
> 
> 
> This series adds support for the muxable ahb clock on sun5/7i. The mux
> has inputs such as the axi clock, the cpu clock on sun5i, and pll6 with
> various dividers. The goal is to have ahb muxed to pll6, which should
> be a fixed rate albeit configurable clock. This fixes issues with
> cpufreq changing the cpu frequency, which would affect the hstimer
> clocked from ahb.
> 
> Patch 1 makes divs clocks explicitly specify in the driver which output
> is the base factor clock, instead of always putting it in last. This is
> done to ensure DT bindings compatibility when we add outputs.
> 
> Patch 2 adds the new pll6/4 output, which is used on sun7i as an input
> to ahb mux.
> 
> Patch 3 updates the dtsi files with the new drivers.
> 
> The series is also available at
> 
>     https://github.com/wens/linux/commits/sun5i-ahb-v2

Applied all three. I think it would be great to convert the later SoCs
to that too, just to make sure we have the same policy on all SoCs.

Thanks!
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: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150325/55170eb9/attachment.sig>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues
  2015-03-25 18:51 ` [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Maxime Ripard
@ 2015-03-25 20:13   ` Chen-Yu Tsai
  2015-03-25 21:53     ` Maxime Ripard
  0 siblings, 1 reply; 9+ messages in thread
From: Chen-Yu Tsai @ 2015-03-25 20:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 25, 2015 at 11:51 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Wed, Mar 25, 2015 at 01:22:06AM +0800, Chen-Yu Tsai wrote:
>> Hi everyone,
>>
>> This is v2 of the sun5i muxable AHB clock series.
>>
>> Changes since v1:
>>
>>   - Dropped patches 1~3 that are merged
>>   - Extend comments to clarify what the "base factor clock" refers to,
>>     and what the divs clocks outputs should be.
>>
>>
>> This series adds support for the muxable ahb clock on sun5/7i. The mux
>> has inputs such as the axi clock, the cpu clock on sun5i, and pll6 with
>> various dividers. The goal is to have ahb muxed to pll6, which should
>> be a fixed rate albeit configurable clock. This fixes issues with
>> cpufreq changing the cpu frequency, which would affect the hstimer
>> clocked from ahb.
>>
>> Patch 1 makes divs clocks explicitly specify in the driver which output
>> is the base factor clock, instead of always putting it in last. This is
>> done to ensure DT bindings compatibility when we add outputs.
>>
>> Patch 2 adds the new pll6/4 output, which is used on sun7i as an input
>> to ahb mux.
>>
>> Patch 3 updates the dtsi files with the new drivers.
>>
>> The series is also available at
>>
>>     https://github.com/wens/linux/commits/sun5i-ahb-v2
>
> Applied all three. I think it would be great to convert the later SoCs
> to that too, just to make sure we have the same policy on all SoCs.

For sun6i this is already doable. We just move the assignment from the
dmaengine node to the clock node.

For sun8i the default divider results in 300 MHz for AHB, which might
be too fast. And we can't do clock rate assignment yet. The clock
drivers need to be split out.

For sun9i it is already the default.

ChenYu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues
  2015-03-25 20:13   ` Chen-Yu Tsai
@ 2015-03-25 21:53     ` Maxime Ripard
  2015-03-25 22:04       ` Chen-Yu Tsai
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2015-03-25 21:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 25, 2015 at 01:13:46PM -0700, Chen-Yu Tsai wrote:
> On Wed, Mar 25, 2015 at 11:51 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Wed, Mar 25, 2015 at 01:22:06AM +0800, Chen-Yu Tsai wrote:
> >> Hi everyone,
> >>
> >> This is v2 of the sun5i muxable AHB clock series.
> >>
> >> Changes since v1:
> >>
> >>   - Dropped patches 1~3 that are merged
> >>   - Extend comments to clarify what the "base factor clock" refers to,
> >>     and what the divs clocks outputs should be.
> >>
> >>
> >> This series adds support for the muxable ahb clock on sun5/7i. The mux
> >> has inputs such as the axi clock, the cpu clock on sun5i, and pll6 with
> >> various dividers. The goal is to have ahb muxed to pll6, which should
> >> be a fixed rate albeit configurable clock. This fixes issues with
> >> cpufreq changing the cpu frequency, which would affect the hstimer
> >> clocked from ahb.
> >>
> >> Patch 1 makes divs clocks explicitly specify in the driver which output
> >> is the base factor clock, instead of always putting it in last. This is
> >> done to ensure DT bindings compatibility when we add outputs.
> >>
> >> Patch 2 adds the new pll6/4 output, which is used on sun7i as an input
> >> to ahb mux.
> >>
> >> Patch 3 updates the dtsi files with the new drivers.
> >>
> >> The series is also available at
> >>
> >>     https://github.com/wens/linux/commits/sun5i-ahb-v2
> >
> > Applied all three. I think it would be great to convert the later SoCs
> > to that too, just to make sure we have the same policy on all SoCs.
> 
> For sun6i this is already doable. We just move the assignment from the
> dmaengine node to the clock node.

Yep.

> For sun8i the default divider results in 300 MHz for AHB, which might
> be too fast.

I guess you're talking about AHB1? APB2 should be muxed to PLL6 as
well.

> And we can't do clock rate assignment yet. The clock drivers need
> to be split out.

Why?

> For sun9i it is already the default.

Perfect.

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: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150325/1c880f39/attachment.sig>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues
  2015-03-25 21:53     ` Maxime Ripard
@ 2015-03-25 22:04       ` Chen-Yu Tsai
  2015-03-30 21:58         ` Maxime Ripard
  0 siblings, 1 reply; 9+ messages in thread
From: Chen-Yu Tsai @ 2015-03-25 22:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 25, 2015 at 2:53 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Wed, Mar 25, 2015 at 01:13:46PM -0700, Chen-Yu Tsai wrote:
>> On Wed, Mar 25, 2015 at 11:51 AM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > On Wed, Mar 25, 2015 at 01:22:06AM +0800, Chen-Yu Tsai wrote:
>> >> Hi everyone,
>> >>
>> >> This is v2 of the sun5i muxable AHB clock series.
>> >>
>> >> Changes since v1:
>> >>
>> >>   - Dropped patches 1~3 that are merged
>> >>   - Extend comments to clarify what the "base factor clock" refers to,
>> >>     and what the divs clocks outputs should be.
>> >>
>> >>
>> >> This series adds support for the muxable ahb clock on sun5/7i. The mux
>> >> has inputs such as the axi clock, the cpu clock on sun5i, and pll6 with
>> >> various dividers. The goal is to have ahb muxed to pll6, which should
>> >> be a fixed rate albeit configurable clock. This fixes issues with
>> >> cpufreq changing the cpu frequency, which would affect the hstimer
>> >> clocked from ahb.
>> >>
>> >> Patch 1 makes divs clocks explicitly specify in the driver which output
>> >> is the base factor clock, instead of always putting it in last. This is
>> >> done to ensure DT bindings compatibility when we add outputs.
>> >>
>> >> Patch 2 adds the new pll6/4 output, which is used on sun7i as an input
>> >> to ahb mux.
>> >>
>> >> Patch 3 updates the dtsi files with the new drivers.
>> >>
>> >> The series is also available at
>> >>
>> >>     https://github.com/wens/linux/commits/sun5i-ahb-v2
>> >
>> > Applied all three. I think it would be great to convert the later SoCs
>> > to that too, just to make sure we have the same policy on all SoCs.
>>
>> For sun6i this is already doable. We just move the assignment from the
>> dmaengine node to the clock node.
>
> Yep.

Sent out a patch as part of the sun6i cpufreq series.

>> For sun8i the default divider results in 300 MHz for AHB, which might
>> be too fast.
>
> I guess you're talking about AHB1? APB2 should be muxed to PLL6 as
> well.

Ah, AHB1 yes. Is APB2 muxed from OSC 24MHz too slow?

>> And we can't do clock rate assignment yet. The clock drivers need
>> to be split out.
>
> Why?

The clock rate is propagated down the tree from the root OSC 24M
clock. Unfortunately it is registered after all the A23 clocks,
due to the way the sunxi clock driver works. So at the time the
AHB1 clock is registered, the parent clocks all have rate=0,
as there is no proper reference value for all the factor clocks
to calculate their rates.

ChenYu

>> For sun9i it is already the default.
>
> Perfect.
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues
  2015-03-25 22:04       ` Chen-Yu Tsai
@ 2015-03-30 21:58         ` Maxime Ripard
  0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2015-03-30 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

> >> For sun8i the default divider results in 300 MHz for AHB, which might
> >> be too fast.
> >
> > I guess you're talking about AHB1? APB2 should be muxed to PLL6 as
> > well.
> 
> Ah, AHB1 yes. Is APB2 muxed from OSC 24MHz too slow?

If it's clocked from the HOSC by default, I guess we're fine.

> >> And we can't do clock rate assignment yet. The clock drivers need
> >> to be split out.
> >
> > Why?
> 
> The clock rate is propagated down the tree from the root OSC 24M
> clock. Unfortunately it is registered after all the A23 clocks,
> due to the way the sunxi clock driver works. So at the time the
> AHB1 clock is registered, the parent clocks all have rate=0,
> as there is no proper reference value for all the factor clocks
> to calculate their rates.

Too bad. I guess we will be able to switch to this when we will have
converted all the clocks.

Thanks,
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: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150330/fe9694ef/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-30 21:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 17:22 [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Chen-Yu Tsai
2015-03-24 17:22 ` [PATCH v2 1/3] clk: sunxi: Make divs clocks specify which output is the base factor clock Chen-Yu Tsai
2015-03-24 17:22 ` [PATCH v2 2/3] clk: sunxi: Add pll6 / 4 clock output to sun4i-a10-pll6 Chen-Yu Tsai
2015-03-24 17:22 ` [PATCH v2 3/3] ARM: dts: sunxi: Update ahb clocks for sun5i and sun7i Chen-Yu Tsai
2015-03-25 18:51 ` [PATCH v2 0/3] clk: sunxi: Add muxable AHB clock to fix hstimer issues Maxime Ripard
2015-03-25 20:13   ` Chen-Yu Tsai
2015-03-25 21:53     ` Maxime Ripard
2015-03-25 22:04       ` Chen-Yu Tsai
2015-03-30 21:58         ` Maxime Ripard

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.