aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-spear3xx/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-spear3xx/clock.c')
-rw-r--r--arch/arm/mach-spear3xx/clock.c66
1 files changed, 58 insertions, 8 deletions
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c
index 18febf92f20..7ea8749ddf2 100644
--- a/arch/arm/mach-spear3xx/clock.c
+++ b/arch/arm/mach-spear3xx/clock.c
@@ -39,10 +39,25 @@ static struct clk rtc_clk = {
39}; 39};
40 40
41/* clock derived from 24 MHz osc clk */ 41/* clock derived from 24 MHz osc clk */
42/* pll masks structure */
43static struct pll_clk_masks pll1_masks = {
44 .mode_mask = PLL_MODE_MASK,
45 .mode_shift = PLL_MODE_SHIFT,
46 .norm_fdbk_m_mask = PLL_NORM_FDBK_M_MASK,
47 .norm_fdbk_m_shift = PLL_NORM_FDBK_M_SHIFT,
48 .dith_fdbk_m_mask = PLL_DITH_FDBK_M_MASK,
49 .dith_fdbk_m_shift = PLL_DITH_FDBK_M_SHIFT,
50 .div_p_mask = PLL_DIV_P_MASK,
51 .div_p_shift = PLL_DIV_P_SHIFT,
52 .div_n_mask = PLL_DIV_N_MASK,
53 .div_n_shift = PLL_DIV_N_SHIFT,
54};
55
42/* pll1 configuration structure */ 56/* pll1 configuration structure */
43static struct pll_clk_config pll1_config = { 57static struct pll_clk_config pll1_config = {
44 .mode_reg = PLL1_CTR, 58 .mode_reg = PLL1_CTR,
45 .cfg_reg = PLL1_FRQ, 59 .cfg_reg = PLL1_FRQ,
60 .masks = &pll1_masks,
46}; 61};
47 62
48/* PLL1 clock */ 63/* PLL1 clock */
@@ -50,7 +65,7 @@ static struct clk pll1_clk = {
50 .pclk = &osc_24m_clk, 65 .pclk = &osc_24m_clk,
51 .en_reg = PLL1_CTR, 66 .en_reg = PLL1_CTR,
52 .en_reg_bit = PLL_ENABLE, 67 .en_reg_bit = PLL_ENABLE,
53 .recalc = &pll1_clk_recalc, 68 .recalc = &pll_clk_recalc,
54 .private_data = &pll1_config, 69 .private_data = &pll1_config,
55}; 70};
56 71
@@ -76,11 +91,16 @@ static struct clk cpu_clk = {
76 .recalc = &follow_parent, 91 .recalc = &follow_parent,
77}; 92};
78 93
94/* ahb masks structure */
95static struct bus_clk_masks ahb_masks = {
96 .mask = PLL_HCLK_RATIO_MASK,
97 .shift = PLL_HCLK_RATIO_SHIFT,
98};
99
79/* ahb configuration structure */ 100/* ahb configuration structure */
80static struct bus_clk_config ahb_config = { 101static struct bus_clk_config ahb_config = {
81 .reg = CORE_CLK_CFG, 102 .reg = CORE_CLK_CFG,
82 .mask = PLL_HCLK_RATIO_MASK, 103 .masks = &ahb_masks,
83 .shift = PLL_HCLK_RATIO_SHIFT,
84}; 104};
85 105
86/* ahb clock */ 106/* ahb clock */
@@ -91,9 +111,22 @@ static struct clk ahb_clk = {
91 .private_data = &ahb_config, 111 .private_data = &ahb_config,
92}; 112};
93 113
114/* auxiliary synthesizers masks */
115static struct aux_clk_masks aux_masks = {
116 .eq_sel_mask = AUX_EQ_SEL_MASK,
117 .eq_sel_shift = AUX_EQ_SEL_SHIFT,
118 .eq1_mask = AUX_EQ1_SEL,
119 .eq2_mask = AUX_EQ2_SEL,
120 .xscale_sel_mask = AUX_XSCALE_MASK,
121 .xscale_sel_shift = AUX_XSCALE_SHIFT,
122 .yscale_sel_mask = AUX_YSCALE_MASK,
123 .yscale_sel_shift = AUX_YSCALE_SHIFT,
124};
125
94/* uart configurations */ 126/* uart configurations */
95static struct aux_clk_config uart_config = { 127static struct aux_clk_config uart_config = {
96 .synth_reg = UART_CLK_SYNT, 128 .synth_reg = UART_CLK_SYNT,
129 .masks = &aux_masks,
97}; 130};
98 131
99/* uart parents */ 132/* uart parents */
@@ -130,6 +163,7 @@ static struct clk uart_clk = {
130/* firda configurations */ 163/* firda configurations */
131static struct aux_clk_config firda_config = { 164static struct aux_clk_config firda_config = {
132 .synth_reg = FIRDA_CLK_SYNT, 165 .synth_reg = FIRDA_CLK_SYNT,
166 .masks = &aux_masks,
133}; 167};
134 168
135/* firda parents */ 169/* firda parents */
@@ -184,9 +218,18 @@ static struct pclk_sel gpt_pclk_sel = {
184 .pclk_sel_mask = GPT_CLK_MASK, 218 .pclk_sel_mask = GPT_CLK_MASK,
185}; 219};
186 220
221/* gpt synthesizer masks */
222static struct gpt_clk_masks gpt_masks = {
223 .mscale_sel_mask = GPT_MSCALE_MASK,
224 .mscale_sel_shift = GPT_MSCALE_SHIFT,
225 .nscale_sel_mask = GPT_NSCALE_MASK,
226 .nscale_sel_shift = GPT_NSCALE_SHIFT,
227};
228
187/* gpt0 configurations */ 229/* gpt0 configurations */
188static struct aux_clk_config gpt0_config = { 230static struct gpt_clk_config gpt0_config = {
189 .synth_reg = PRSC1_CLK_CFG, 231 .synth_reg = PRSC1_CLK_CFG,
232 .masks = &gpt_masks,
190}; 233};
191 234
192/* gpt0 timer clock */ 235/* gpt0 timer clock */
@@ -199,8 +242,9 @@ static struct clk gpt0_clk = {
199}; 242};
200 243
201/* gpt1 configurations */ 244/* gpt1 configurations */
202static struct aux_clk_config gpt1_config = { 245static struct gpt_clk_config gpt1_config = {
203 .synth_reg = PRSC2_CLK_CFG, 246 .synth_reg = PRSC2_CLK_CFG,
247 .masks = &gpt_masks,
204}; 248};
205 249
206/* gpt1 timer clock */ 250/* gpt1 timer clock */
@@ -214,8 +258,9 @@ static struct clk gpt1_clk = {
214}; 258};
215 259
216/* gpt2 configurations */ 260/* gpt2 configurations */
217static struct aux_clk_config gpt2_config = { 261static struct gpt_clk_config gpt2_config = {
218 .synth_reg = PRSC3_CLK_CFG, 262 .synth_reg = PRSC3_CLK_CFG,
263 .masks = &gpt_masks,
219}; 264};
220 265
221/* gpt2 timer clock */ 266/* gpt2 timer clock */
@@ -253,11 +298,16 @@ static struct clk clcd_clk = {
253}; 298};
254 299
255/* clock derived from ahb clk */ 300/* clock derived from ahb clk */
301/* apb masks structure */
302static struct bus_clk_masks apb_masks = {
303 .mask = HCLK_PCLK_RATIO_MASK,
304 .shift = HCLK_PCLK_RATIO_SHIFT,
305};
306
256/* apb configuration structure */ 307/* apb configuration structure */
257static struct bus_clk_config apb_config = { 308static struct bus_clk_config apb_config = {
258 .reg = CORE_CLK_CFG, 309 .reg = CORE_CLK_CFG,
259 .mask = HCLK_PCLK_RATIO_MASK, 310 .masks = &apb_masks,
260 .shift = HCLK_PCLK_RATIO_SHIFT,
261}; 311};
262 312
263/* apb clock */ 313/* apb clock */