From: Maxime Ripard <maxime.rip...@free-electrons.com>

Signed-off-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Hans de Goede <hdego...@redhat.com>
---
 arch/arm/cpu/armv7/sunxi/clock.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/cpu/armv7/sunxi/clock.c b/arch/arm/cpu/armv7/sunxi/clock.c
index a344971..c4b19da 100644
--- a/arch/arm/cpu/armv7/sunxi/clock.c
+++ b/arch/arm/cpu/armv7/sunxi/clock.c
@@ -56,6 +56,15 @@ int clock_init(void)
        clock_init_safe();
 #endif
 
+#if defined(CONFIG_SUN6I)
+       /* uart clock source is apb2 */
+       sr32(&ccm->apb2_div, 24, 2, APB2_CLK_SRC_OSC24M);
+       sr32(&ccm->apb2_div, 16, 2, APB2_FACTOR_N);
+       sr32(&ccm->apb2_div, 0, 5, APB2_FACTOR_M);
+
+       /* open the clock for uart */
+       sr32(&ccm->apb2_gate, 16 + CONFIG_CONS_INDEX - 1, 1, CLK_GATE_OPEN);
+#else
        /* uart clock source is apb1 */
        sr32(&ccm->apb1_clk_div_cfg, 24, 2, APB1_CLK_SRC_OSC24M);
        sr32(&ccm->apb1_clk_div_cfg, 16, 2, APB1_FACTOR_N);
@@ -63,6 +72,7 @@ int clock_init(void)
 
        /* open the clock for uart */
        sr32(&ccm->apb1_gate, 16 + CONFIG_CONS_INDEX - 1, 1, CLK_GATE_OPEN);
+#endif
 
 #ifdef CONFIG_NAND_SUNXI
        /* nand clock source is osc24m */
-- 
1.9.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to