diff options
author | Sekhar Nori <nsekhar@ti.com> | 2009-11-16 06:51:38 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-02-04 16:29:39 -0500 |
commit | 7aad472bb5602242113718fc170e61b127460cbe (patch) | |
tree | 4a3cd317ee79094b86217eac216ef96c5f4b72b8 | |
parent | 948c66df0d5e23dbcb84bee39a11b56c8a0d3e41 (diff) |
davinci: da850/omap-l138: unlock PLL registers during init
On omap-l1 devices the PLL registers can be locked from
writes. Currently the cpufreq rate setting code unlocks
PLL0 before the write actually happens. With suspend
support getting added PLL1 registers need be be unlocked
as well.
To facilitate this, unlock both PLLs during the init time
itself.
This also obviates the need to unlock PLL registers for
each CPUFreq transtition.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r-- | arch/arm/mach-davinci/da850.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 4f84ab4bb221..fcfde2a72f8f 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #define DA850_REF_FREQ 24000000 | 40 | #define DA850_REF_FREQ 24000000 |
41 | 41 | ||
42 | #define CFGCHIP3_ASYNC3_CLKSRC BIT(4) | 42 | #define CFGCHIP3_ASYNC3_CLKSRC BIT(4) |
43 | #define CFGCHIP3_PLL1_MASTER_LOCK BIT(5) | ||
43 | #define CFGCHIP0_PLL_MASTER_LOCK BIT(4) | 44 | #define CFGCHIP0_PLL_MASTER_LOCK BIT(4) |
44 | 45 | ||
45 | static int da850_set_armrate(struct clk *clk, unsigned long rate); | 46 | static int da850_set_armrate(struct clk *clk, unsigned long rate); |
@@ -987,7 +988,6 @@ static int da850_set_pll0rate(struct clk *clk, unsigned long index) | |||
987 | unsigned int prediv, mult, postdiv; | 988 | unsigned int prediv, mult, postdiv; |
988 | struct da850_opp *opp; | 989 | struct da850_opp *opp; |
989 | struct pll_data *pll = clk->pll_data; | 990 | struct pll_data *pll = clk->pll_data; |
990 | unsigned int v; | ||
991 | int ret; | 991 | int ret; |
992 | 992 | ||
993 | opp = (struct da850_opp *) da850_freq_table[index].index; | 993 | opp = (struct da850_opp *) da850_freq_table[index].index; |
@@ -995,11 +995,6 @@ static int da850_set_pll0rate(struct clk *clk, unsigned long index) | |||
995 | mult = opp->mult; | 995 | mult = opp->mult; |
996 | postdiv = opp->postdiv; | 996 | postdiv = opp->postdiv; |
997 | 997 | ||
998 | /* Unlock writing to PLL registers */ | ||
999 | v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG)); | ||
1000 | v &= ~CFGCHIP0_PLL_MASTER_LOCK; | ||
1001 | __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG)); | ||
1002 | |||
1003 | ret = davinci_set_pllrate(pll, prediv, mult, postdiv); | 998 | ret = davinci_set_pllrate(pll, prediv, mult, postdiv); |
1004 | if (WARN_ON(ret)) | 999 | if (WARN_ON(ret)) |
1005 | return ret; | 1000 | return ret; |
@@ -1053,6 +1048,8 @@ static struct davinci_soc_info davinci_soc_info_da850 = { | |||
1053 | 1048 | ||
1054 | void __init da850_init(void) | 1049 | void __init da850_init(void) |
1055 | { | 1050 | { |
1051 | unsigned int v; | ||
1052 | |||
1056 | da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); | 1053 | da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); |
1057 | if (WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module")) | 1054 | if (WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module")) |
1058 | return; | 1055 | return; |
@@ -1075,4 +1072,14 @@ void __init da850_init(void) | |||
1075 | * be any noticible change even in non-DVFS use cases. | 1072 | * be any noticible change even in non-DVFS use cases. |
1076 | */ | 1073 | */ |
1077 | da850_set_async3_src(1); | 1074 | da850_set_async3_src(1); |
1075 | |||
1076 | /* Unlock writing to PLL0 registers */ | ||
1077 | v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG)); | ||
1078 | v &= ~CFGCHIP0_PLL_MASTER_LOCK; | ||
1079 | __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG)); | ||
1080 | |||
1081 | /* Unlock writing to PLL1 registers */ | ||
1082 | v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); | ||
1083 | v &= ~CFGCHIP3_PLL1_MASTER_LOCK; | ||
1084 | __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); | ||
1078 | } | 1085 | } |