Skip to contentSkip to conversation

ARM: tegra114: correctly output clk_32k

PATCH RESEND In review Alexandre Courbot 3 participants 4 messages May 26, 2013 – May 31, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ARM: tegra114: correctly output clk_32k

Tegra has a blink timer register that allows to modulate the clk_32k clock before outputting it. Since clk_32k is presented to the kernel as a fixed clock, make sure this register does not tamper with the clock frequency and that clk_32k is outputted as-is, similarly to what is done on t20 and t30.

---
 drivers/clk/tegra/clk-tegra114.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/tegra/clk-tegra114.c +3 -0
index d78e16e..dc76d67 100644
@@ -127,6 +127,7 @@
 #define PMC_DPD_PADS_ORIDE_BLINK_ENB 20
 #define PMC_CTRL 0
 #define PMC_CTRL_BLINK_ENB 7
+#define PMC_BLINK_TIMER 0x40
 
 #define OSC_CTRL			0x50
 #define OSC_CTRL_OSC_FREQ_SHIFT		28
@@ -1625,6 +1626,8 @@ static void __init tegra114_pmc_clk_init(void __iomem *pmc_base)
 	clks[clk_out_3] = clk;
 
 	/* blink */
+	/* clear the blink timer register to directly output clk_32k */
+	writel_relaxed(0, pmc_base + PMC_BLINK_TIMER);
 	clk = clk_register_gate(NULL, "blink_override", "clk_32k", 0,
 				pmc_base + PMC_DPD_PADS_ORIDE,
 				PMC_DPD_PADS_ORIDE_BLINK_ENB, 0, NULL);
Signature · 1 line
1.8.2.3
#1 lore raw
Quoted 5 lines · Alexandre Courbot

Tegra has a blink timer register that allows to modulate the clk_32k clock before outputting it. Since clk_32k is presented to the kernel as a fixed clock, make sure this register does not tamper with the clock frequency and that clk_32k is outputted as-is, similarly to what is done on t20 and t30.

The patch subject here should be "clk: tegra:" rather than "ARM:
tegra114". I assume Mike can fix this up when applying it.

#2 lore raw

Quoting Stephen Warren (2013-05-28 08:19:21)

Quoted 9 lines · Alexandre Courbot
Quoted 5 lines

Tegra has a blink timer register that allows to modulate the clk_32k clock before outputting it. Since clk_32k is presented to the kernel as a fixed clock, make sure this register does not tamper with the clock frequency and that clk_32k is outputted as-is, similarly to what is done on t20 and t30.

The patch subject here should be "clk: tegra:" rather than "ARM:
tegra114". I assume Mike can fix this up when applying it.

I fixed it up. Been fixing up lots of s/ARM/clk/ lately.

Regards,
Mike

#3 lore raw
In reply to Alexandre Courbot

Quoting Alexandre Courbot (2013-05-25 19:56:31)

Quoted 8 lines

Tegra has a blink timer register that allows to modulate the clk_32k clock before outputting it. Since clk_32k is presented to the kernel as a fixed clock, make sure this register does not tamper with the clock frequency and that clk_32k is outputted as-is, similarly to what is done on t20 and t30.

Taken into clk-next.

Regards,
Mike

Quoted 27 lines
---
 drivers/clk/tegra/clk-tegra114.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/tegra/clk-tegra114.c +3 -0
index d78e16e..dc76d67 100644
@@ -127,6 +127,7 @@
 #define PMC_DPD_PADS_ORIDE_BLINK_ENB 20
 #define PMC_CTRL 0
 #define PMC_CTRL_BLINK_ENB 7
+#define PMC_BLINK_TIMER 0x40
 
 #define OSC_CTRL                       0x50
 #define OSC_CTRL_OSC_FREQ_SHIFT                28
@@ -1625,6 +1626,8 @@ static void __init tegra114_pmc_clk_init(void __iomem *pmc_base)
        clks[clk_out_3] = clk;
 
        /* blink */
+       /* clear the blink timer register to directly output clk_32k */
+       writel_relaxed(0, pmc_base + PMC_BLINK_TIMER);
        clk = clk_register_gate(NULL, "blink_override", "clk_32k", 0,
                                pmc_base + PMC_DPD_PADS_ORIDE,
                                PMC_DPD_PADS_ORIDE_BLINK_ENB, 0, NULL);
Signature · 1 line
1.8.2.3