[PATCH V3 0/3] move gpt per clk parent from ipg_per to OSC

STALE4343d

2 messages, 2 authors, 2014-09-11 · open the first message on its own page

[PATCH V3 0/3] move gpt per clk parent from ipg_per to OSC

From: Anson Huang <hidden>
Date: 2014-09-11 03:29:39

Currently, gpt timer's clock is from ipg_per, and ipg_per clock is
from ipg on most of i.MX6 series SOCs, but ipg's rate may be scaled
when system enters low bus mode for saving power, then gpt timer's
clock rate will be scaled as well, as system timer should be kept
stable and NOT drift, better to keep gpt timer's clk at fixed rate,
on i.MX6Q TO > 1.0, i.MX6DL and i.MX6SX, there is OSC clk available
for gpt timer, we should enable this feature, the hardware design is
as below:

i.MX6Q TO > 1.0: GPT_CR_CLKSRC, b'101 selects fix clock
    of OSC / 8 for gpt per clk;
i.MX6DL and i.MX6SX: GPT_CR_CLKSRC, b'101 selects OSC
    for gpt per clk, and we must enable GPT_CR_24MEM to
    enable OSC clk source for gpt per, GPT_PR_PRESCALER24M
    is for pre-scaling of this OSC clk, here set it to 8
    to make gpt per clk is 3MHz;
i.MX6SL: ipg_per can be from OSC directly, so no need to
    implement this new clk source for gpt per.

As we still need to make it work on i.MX6Q TO1.0 which has no OSC
clock source for gpt per, so we add a soc_per clock for i.MX6Q,
other SoCs all have OSC clock source available for gpt per, so we
can just replace the original gpt per clk with gpt_3m clock.

Anson Huang (3):
  ARM: imx: add gpt_3m clk for i.mx6qdl
  ARM: dts: imx6: make gpt per clock can be from OSC
  ARM: imx: source gpt per clk from OSC for system timer

 arch/arm/boot/dts/imx6qdl.dtsi            |    5 +++--
 arch/arm/boot/dts/imx6sx.dtsi             |    2 +-
 arch/arm/mach-imx/clk-imx6q.c             |    4 ++++
 arch/arm/mach-imx/time.c                  |   31 ++++++++++++++++++++++++-----
 include/dt-bindings/clock/imx6qdl-clock.h |    3 ++-
 5 files changed, 36 insertions(+), 9 deletions(-)

-- 
1.7.9.5

[PATCH V3 2/3] ARM: dts: imx6: make gpt per clock can be from OSC

From: Anson Huang <hidden>
Date: 2014-09-11 03:29:41

Original gpt per clk parent is from ipg_per clk which
may be scaled when system enter low bus mode, as ipg
clk will be lower in low bus mode, to keep system clk
NOT drift, select gpt per clk parent from OSC which
is at fixed freq always.

On i.mx6qdl, add a osc_per clk source for i.mx6q
TO > 1.0 and all i.MX6dl SoC.

On i.mx6sx, just make gpt per clk from OSC.

Signed-off-by: Anson Huang <redacted>
---
 arch/arm/boot/dts/imx6qdl.dtsi |    5 +++--
 arch/arm/boot/dts/imx6sx.dtsi  |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 70d7207..8de2801 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -401,8 +401,9 @@
 				reg = <0x02098000 0x4000>;
 				interrupts = <0 55 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX6QDL_CLK_GPT_IPG>,
-					 <&clks IMX6QDL_CLK_GPT_IPG_PER>;
-				clock-names = "ipg", "per";
+					 <&clks IMX6QDL_CLK_GPT_IPG_PER>,
+					 <&clks IMX6QDL_CLK_GPT_3M>;
+				clock-names = "ipg", "per", "osc_per";
 			};
 
 			gpio1: gpio at 0209c000 {
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index 63d9d82..b5d8252 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -421,7 +421,7 @@
 				reg = <0x02098000 0x4000>;
 				interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX6SX_CLK_GPT_BUS>,
-					 <&clks IMX6SX_CLK_GPT_SERIAL>;
+					 <&clks IMX6SX_CLK_GPT_3M>;
 				clock-names = "ipg", "per";
 			};
 
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help