aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/da850.c
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2009-08-31 06:18:05 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-25 13:21:21 -0500
commit5d36a3321bd77418cc55e05680efc35deeaba3f4 (patch)
tree9b43aeb209172c83413e153cf830b029b09230b8 /arch/arm/mach-davinci/da850.c
parentb82a51e8ce560fece675b8e3ca652eee26a47789 (diff)
davinci: DA850/OMAP-L138: allow async3 source to be changed
The patch allows Async3 clock source to be selected between PLL1 SYSCLK2 and PLL0 SYSCLK2. Having Async3 source from PLL1 SYSCLK2 allows peripherals on that domain to remain unaffected by frequency scaling on PLL0. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/da850.c')
-rw-r--r--arch/arm/mach-davinci/da850.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index f5c3a6a71315..575e9ccbb25f 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -30,12 +30,17 @@
30#include "clock.h" 30#include "clock.h"
31#include "mux.h" 31#include "mux.h"
32 32
33/* SoC specific clock flags */
34#define DA850_CLK_ASYNC3 BIT(16)
35
33#define DA850_PLL1_BASE 0x01e1a000 36#define DA850_PLL1_BASE 0x01e1a000
34#define DA850_TIMER64P2_BASE 0x01f0c000 37#define DA850_TIMER64P2_BASE 0x01f0c000
35#define DA850_TIMER64P3_BASE 0x01f0d000 38#define DA850_TIMER64P3_BASE 0x01f0d000
36 39
37#define DA850_REF_FREQ 24000000 40#define DA850_REF_FREQ 24000000
38 41
42#define CFGCHIP3_ASYNC3_CLKSRC BIT(4)
43
39static struct pll_data pll0_data = { 44static struct pll_data pll0_data = {
40 .num = 1, 45 .num = 1,
41 .phys_base = DA8XX_PLL0_BASE, 46 .phys_base = DA8XX_PLL0_BASE,
@@ -232,6 +237,7 @@ static struct clk uart1_clk = {
232 .name = "uart1", 237 .name = "uart1",
233 .parent = &pll0_sysclk2, 238 .parent = &pll0_sysclk2,
234 .lpsc = DA8XX_LPSC1_UART1, 239 .lpsc = DA8XX_LPSC1_UART1,
240 .flags = DA850_CLK_ASYNC3,
235 .psc_ctlr = 1, 241 .psc_ctlr = 1,
236}; 242};
237 243
@@ -239,6 +245,7 @@ static struct clk uart2_clk = {
239 .name = "uart2", 245 .name = "uart2",
240 .parent = &pll0_sysclk2, 246 .parent = &pll0_sysclk2,
241 .lpsc = DA8XX_LPSC1_UART2, 247 .lpsc = DA8XX_LPSC1_UART2,
248 .flags = DA850_CLK_ASYNC3,
242 .psc_ctlr = 1, 249 .psc_ctlr = 1,
243}; 250};
244 251
@@ -790,6 +797,30 @@ static struct davinci_timer_info da850_timer_info = {
790 .clocksource_id = T0_TOP, 797 .clocksource_id = T0_TOP,
791}; 798};
792 799
800static void da850_set_async3_src(int pllnum)
801{
802 struct clk *clk, *newparent = pllnum ? &pll1_sysclk2 : &pll0_sysclk2;
803 struct davinci_clk *c;
804 unsigned int v;
805 int ret;
806
807 for (c = da850_clks; c->lk.clk; c++) {
808 clk = c->lk.clk;
809 if (clk->flags & DA850_CLK_ASYNC3) {
810 ret = clk_set_parent(clk, newparent);
811 WARN(ret, "DA850: unable to re-parent clock %s",
812 clk->name);
813 }
814 }
815
816 v = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG));
817 if (pllnum)
818 v |= CFGCHIP3_ASYNC3_CLKSRC;
819 else
820 v &= ~CFGCHIP3_ASYNC3_CLKSRC;
821 __raw_writel(v, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG));
822}
823
793static struct davinci_soc_info davinci_soc_info_da850 = { 824static struct davinci_soc_info davinci_soc_info_da850 = {
794 .io_desc = da850_io_desc, 825 .io_desc = da850_io_desc,
795 .io_desc_num = ARRAY_SIZE(da850_io_desc), 826 .io_desc_num = ARRAY_SIZE(da850_io_desc),
@@ -823,4 +854,13 @@ void __init da850_init(void)
823 davinci_soc_info_da850.pinmux_base = DA8XX_SYSCFG_VIRT(0x120); 854 davinci_soc_info_da850.pinmux_base = DA8XX_SYSCFG_VIRT(0x120);
824 855
825 davinci_common_init(&davinci_soc_info_da850); 856 davinci_common_init(&davinci_soc_info_da850);
857
858 /*
859 * Move the clock source of Async3 domain to PLL1 SYSCLK2.
860 * This helps keeping the peripherals on this domain insulated
861 * from CPU frequency changes caused by DVFS. The firmware sets
862 * both PLL0 and PLL1 to the same frequency so, there should not
863 * be any noticible change even in non-DVFS use cases.
864 */
865 da850_set_async3_src(1);
826} 866}