diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/clk-imx1.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx21.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx25.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx27.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx31.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx35.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx51-imx53.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx6q.c | 22 | ||||
-rw-r--r-- | arch/arm/plat-mxc/epit.c | 11 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/common.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/time.c | 24 |
11 files changed, 44 insertions, 50 deletions
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c index 0f0beb580b73..516ddee1948e 100644 --- a/arch/arm/mach-imx/clk-imx1.c +++ b/arch/arm/mach-imx/clk-imx1.c | |||
@@ -108,8 +108,7 @@ int __init mx1_clocks_init(unsigned long fref) | |||
108 | clk_register_clkdev(clk[clk32], NULL, "mxc_rtc.0"); | 108 | clk_register_clkdev(clk[clk32], NULL, "mxc_rtc.0"); |
109 | clk_register_clkdev(clk[clko], "clko", NULL); | 109 | clk_register_clkdev(clk[clko], "clko", NULL); |
110 | 110 | ||
111 | mxc_timer_init(NULL, MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), | 111 | mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT); |
112 | MX1_TIM1_INT); | ||
113 | 112 | ||
114 | return 0; | 113 | return 0; |
115 | } | 114 | } |
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c index 4e4f384ee8dd..ea13e61bd5f3 100644 --- a/arch/arm/mach-imx/clk-imx21.c +++ b/arch/arm/mach-imx/clk-imx21.c | |||
@@ -180,7 +180,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href) | |||
180 | clk_register_clkdev(clk[sdhc1_ipg_gate], "sdhc1", NULL); | 180 | clk_register_clkdev(clk[sdhc1_ipg_gate], "sdhc1", NULL); |
181 | clk_register_clkdev(clk[sdhc2_ipg_gate], "sdhc2", NULL); | 181 | clk_register_clkdev(clk[sdhc2_ipg_gate], "sdhc2", NULL); |
182 | 182 | ||
183 | mxc_timer_init(NULL, MX21_IO_ADDRESS(MX21_GPT1_BASE_ADDR), | 183 | mxc_timer_init(MX21_IO_ADDRESS(MX21_GPT1_BASE_ADDR), MX21_INT_GPT1); |
184 | MX21_INT_GPT1); | 184 | |
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index d9833bb5fd61..fdd8cc87c9fe 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
@@ -243,6 +243,6 @@ int __init mx25_clocks_init(void) | |||
243 | clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); | 243 | clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); |
244 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); | 244 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); |
245 | 245 | ||
246 | mxc_timer_init(NULL, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); | 246 | mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); |
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index 50a7ebd8d1b2..295cbd7c08dc 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c | |||
@@ -263,8 +263,7 @@ int __init mx27_clocks_init(unsigned long fref) | |||
263 | clk_register_clkdev(clk[ssi1_baud_gate], "bitrate" , "imx-ssi.0"); | 263 | clk_register_clkdev(clk[ssi1_baud_gate], "bitrate" , "imx-ssi.0"); |
264 | clk_register_clkdev(clk[ssi2_baud_gate], "bitrate" , "imx-ssi.1"); | 264 | clk_register_clkdev(clk[ssi2_baud_gate], "bitrate" , "imx-ssi.1"); |
265 | 265 | ||
266 | mxc_timer_init(NULL, MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR), | 266 | mxc_timer_init(MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR), MX27_INT_GPT1); |
267 | MX27_INT_GPT1); | ||
268 | 267 | ||
269 | clk_prepare_enable(clk[emi_ahb_gate]); | 268 | clk_prepare_enable(clk[emi_ahb_gate]); |
270 | 269 | ||
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c index a854b9cae5ea..c9a06d800f8e 100644 --- a/arch/arm/mach-imx/clk-imx31.c +++ b/arch/arm/mach-imx/clk-imx31.c | |||
@@ -175,8 +175,7 @@ int __init mx31_clocks_init(unsigned long fref) | |||
175 | mx31_revision(); | 175 | mx31_revision(); |
176 | clk_disable_unprepare(clk[iim_gate]); | 176 | clk_disable_unprepare(clk[iim_gate]); |
177 | 177 | ||
178 | mxc_timer_init(NULL, MX31_IO_ADDRESS(MX31_GPT1_BASE_ADDR), | 178 | mxc_timer_init(MX31_IO_ADDRESS(MX31_GPT1_BASE_ADDR), MX31_INT_GPT); |
179 | MX31_INT_GPT); | ||
180 | 179 | ||
181 | return 0; | 180 | return 0; |
182 | } | 181 | } |
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c index a9e60bf7dd75..920a8cc42726 100644 --- a/arch/arm/mach-imx/clk-imx35.c +++ b/arch/arm/mach-imx/clk-imx35.c | |||
@@ -267,11 +267,9 @@ int __init mx35_clocks_init() | |||
267 | imx_print_silicon_rev("i.MX35", mx35_revision()); | 267 | imx_print_silicon_rev("i.MX35", mx35_revision()); |
268 | 268 | ||
269 | #ifdef CONFIG_MXC_USE_EPIT | 269 | #ifdef CONFIG_MXC_USE_EPIT |
270 | epit_timer_init(&epit1_clk, | 270 | epit_timer_init(MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1); |
271 | MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1); | ||
272 | #else | 271 | #else |
273 | mxc_timer_init(NULL, MX35_IO_ADDRESS(MX35_GPT1_BASE_ADDR), | 272 | mxc_timer_init(MX35_IO_ADDRESS(MX35_GPT1_BASE_ADDR), MX35_INT_GPT); |
274 | MX35_INT_GPT); | ||
275 | #endif | 273 | #endif |
276 | 274 | ||
277 | return 0; | 275 | return 0; |
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index fcd94f3b0f0e..a2200c77bf70 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c | |||
@@ -104,12 +104,12 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, | |||
104 | periph_apm_sel, ARRAY_SIZE(periph_apm_sel)); | 104 | periph_apm_sel, ARRAY_SIZE(periph_apm_sel)); |
105 | clk[main_bus] = imx_clk_mux("main_bus", MXC_CCM_CBCDR, 25, 1, | 105 | clk[main_bus] = imx_clk_mux("main_bus", MXC_CCM_CBCDR, 25, 1, |
106 | main_bus_sel, ARRAY_SIZE(main_bus_sel)); | 106 | main_bus_sel, ARRAY_SIZE(main_bus_sel)); |
107 | clk[per_lp_apm] = imx_clk_mux("per_lp_apm", MXC_CCM_CBCDR, 1, 1, | 107 | clk[per_lp_apm] = imx_clk_mux("per_lp_apm", MXC_CCM_CBCMR, 1, 1, |
108 | per_lp_apm_sel, ARRAY_SIZE(per_lp_apm_sel)); | 108 | per_lp_apm_sel, ARRAY_SIZE(per_lp_apm_sel)); |
109 | clk[per_pred1] = imx_clk_divider("per_pred1", "per_lp_apm", MXC_CCM_CBCDR, 6, 2); | 109 | clk[per_pred1] = imx_clk_divider("per_pred1", "per_lp_apm", MXC_CCM_CBCDR, 6, 2); |
110 | clk[per_pred2] = imx_clk_divider("per_pred2", "per_pred1", MXC_CCM_CBCDR, 3, 3); | 110 | clk[per_pred2] = imx_clk_divider("per_pred2", "per_pred1", MXC_CCM_CBCDR, 3, 3); |
111 | clk[per_podf] = imx_clk_divider("per_podf", "per_pred2", MXC_CCM_CBCDR, 0, 3); | 111 | clk[per_podf] = imx_clk_divider("per_podf", "per_pred2", MXC_CCM_CBCDR, 0, 3); |
112 | clk[per_root] = imx_clk_mux("per_root", MXC_CCM_CBCDR, 1, 0, | 112 | clk[per_root] = imx_clk_mux("per_root", MXC_CCM_CBCMR, 0, 1, |
113 | per_root_sel, ARRAY_SIZE(per_root_sel)); | 113 | per_root_sel, ARRAY_SIZE(per_root_sel)); |
114 | clk[ahb] = imx_clk_divider("ahb", "main_bus", MXC_CCM_CBCDR, 10, 3); | 114 | clk[ahb] = imx_clk_divider("ahb", "main_bus", MXC_CCM_CBCDR, 10, 3); |
115 | clk[ahb_max] = imx_clk_gate2("ahb_max", "ahb", MXC_CCM_CCGR0, 28); | 115 | clk[ahb_max] = imx_clk_gate2("ahb_max", "ahb", MXC_CCM_CCGR0, 28); |
@@ -172,7 +172,7 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, | |||
172 | clk[pwm1_hf_gate] = imx_clk_gate2("pwm1_hf_gate", "ipg", MXC_CCM_CCGR2, 12); | 172 | clk[pwm1_hf_gate] = imx_clk_gate2("pwm1_hf_gate", "ipg", MXC_CCM_CCGR2, 12); |
173 | clk[pwm2_ipg_gate] = imx_clk_gate2("pwm2_ipg_gate", "ipg", MXC_CCM_CCGR2, 14); | 173 | clk[pwm2_ipg_gate] = imx_clk_gate2("pwm2_ipg_gate", "ipg", MXC_CCM_CCGR2, 14); |
174 | clk[pwm2_hf_gate] = imx_clk_gate2("pwm2_hf_gate", "ipg", MXC_CCM_CCGR2, 16); | 174 | clk[pwm2_hf_gate] = imx_clk_gate2("pwm2_hf_gate", "ipg", MXC_CCM_CCGR2, 16); |
175 | clk[gpt_gate] = imx_clk_gate2("gpt_gate", "ipg", MXC_CCM_CCGR2, 18); | 175 | clk[gpt_gate] = imx_clk_gate2("gpt_gate", "per_root", MXC_CCM_CCGR2, 18); |
176 | clk[fec_gate] = imx_clk_gate2("fec_gate", "ipg", MXC_CCM_CCGR2, 24); | 176 | clk[fec_gate] = imx_clk_gate2("fec_gate", "ipg", MXC_CCM_CCGR2, 24); |
177 | clk[usboh3_gate] = imx_clk_gate2("usboh3_gate", "ipg", MXC_CCM_CCGR2, 26); | 177 | clk[usboh3_gate] = imx_clk_gate2("usboh3_gate", "ipg", MXC_CCM_CCGR2, 26); |
178 | clk[usboh3_per_gate] = imx_clk_gate2("usboh3_per_gate", "usboh3_podf", MXC_CCM_CCGR2, 28); | 178 | clk[usboh3_per_gate] = imx_clk_gate2("usboh3_per_gate", "usboh3_podf", MXC_CCM_CCGR2, 28); |
@@ -366,8 +366,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, | |||
366 | clk_set_rate(clk[esdhc_b_podf], 166250000); | 366 | clk_set_rate(clk[esdhc_b_podf], 166250000); |
367 | 367 | ||
368 | /* System timer */ | 368 | /* System timer */ |
369 | mxc_timer_init(NULL, MX51_IO_ADDRESS(MX51_GPT1_BASE_ADDR), | 369 | mxc_timer_init(MX51_IO_ADDRESS(MX51_GPT1_BASE_ADDR), MX51_INT_GPT); |
370 | MX51_INT_GPT); | ||
371 | 370 | ||
372 | clk_prepare_enable(clk[iim_gate]); | 371 | clk_prepare_enable(clk[iim_gate]); |
373 | imx_print_silicon_rev("i.MX51", mx51_revision()); | 372 | imx_print_silicon_rev("i.MX51", mx51_revision()); |
@@ -452,8 +451,7 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, | |||
452 | clk_set_rate(clk[esdhc_b_podf], 200000000); | 451 | clk_set_rate(clk[esdhc_b_podf], 200000000); |
453 | 452 | ||
454 | /* System timer */ | 453 | /* System timer */ |
455 | mxc_timer_init(NULL, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR), | 454 | mxc_timer_init(MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR), MX53_INT_GPT); |
456 | MX53_INT_GPT); | ||
457 | 455 | ||
458 | clk_prepare_enable(clk[iim_gate]); | 456 | clk_prepare_enable(clk[iim_gate]); |
459 | imx_print_silicon_rev("i.MX53", mx53_revision()); | 457 | imx_print_silicon_rev("i.MX53", mx53_revision()); |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index cab02d0a15d6..17dc66a085a5 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -122,10 +122,6 @@ static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5 | |||
122 | "dummy", "axi", "enfc", "ipu1_di0", "ipu1_di1", "ipu2_di0", | 122 | "dummy", "axi", "enfc", "ipu1_di0", "ipu1_di1", "ipu2_di0", |
123 | "ipu2_di1", "ahb", "ipg", "ipg_per", "ckil", "pll4_audio", }; | 123 | "ipu2_di1", "ahb", "ipg", "ipg_per", "ckil", "pll4_audio", }; |
124 | 124 | ||
125 | static const char * const clks_init_on[] __initconst = { | ||
126 | "mmdc_ch0_axi", "mmdc_ch1_axi", "usboh3", | ||
127 | }; | ||
128 | |||
129 | enum mx6q_clks { | 125 | enum mx6q_clks { |
130 | dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m, | 126 | dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m, |
131 | pll3_pfd0_720m, pll3_pfd1_540m, pll3_pfd2_508m, pll3_pfd3_454m, | 127 | pll3_pfd0_720m, pll3_pfd1_540m, pll3_pfd2_508m, pll3_pfd3_454m, |
@@ -161,11 +157,14 @@ enum mx6q_clks { | |||
161 | 157 | ||
162 | static struct clk *clk[clk_max]; | 158 | static struct clk *clk[clk_max]; |
163 | 159 | ||
160 | static enum mx6q_clks const clks_init_on[] __initconst = { | ||
161 | mmdc_ch0_axi, mmdc_ch1_axi, | ||
162 | }; | ||
163 | |||
164 | int __init mx6q_clocks_init(void) | 164 | int __init mx6q_clocks_init(void) |
165 | { | 165 | { |
166 | struct device_node *np; | 166 | struct device_node *np; |
167 | void __iomem *base; | 167 | void __iomem *base; |
168 | struct clk *c; | ||
169 | int i, irq; | 168 | int i, irq; |
170 | 169 | ||
171 | clk[dummy] = imx_clk_fixed("dummy", 0); | 170 | clk[dummy] = imx_clk_fixed("dummy", 0); |
@@ -424,21 +423,14 @@ int __init mx6q_clocks_init(void) | |||
424 | clk_register_clkdev(clk[ahb], "ahb", NULL); | 423 | clk_register_clkdev(clk[ahb], "ahb", NULL); |
425 | clk_register_clkdev(clk[cko1], "cko1", NULL); | 424 | clk_register_clkdev(clk[cko1], "cko1", NULL); |
426 | 425 | ||
427 | for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) { | 426 | for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) |
428 | c = clk_get_sys(clks_init_on[i], NULL); | 427 | clk_prepare_enable(clk[clks_init_on[i]]); |
429 | if (IS_ERR(c)) { | ||
430 | pr_err("%s: failed to get clk %s", __func__, | ||
431 | clks_init_on[i]); | ||
432 | return PTR_ERR(c); | ||
433 | } | ||
434 | clk_prepare_enable(c); | ||
435 | } | ||
436 | 428 | ||
437 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt"); | 429 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt"); |
438 | base = of_iomap(np, 0); | 430 | base = of_iomap(np, 0); |
439 | WARN_ON(!base); | 431 | WARN_ON(!base); |
440 | irq = irq_of_parse_and_map(np, 0); | 432 | irq = irq_of_parse_and_map(np, 0); |
441 | mxc_timer_init(NULL, base, irq); | 433 | mxc_timer_init(base, irq); |
442 | 434 | ||
443 | return 0; | 435 | return 0; |
444 | } | 436 | } |
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c index 9129c9e7d532..88726f4dbbfa 100644 --- a/arch/arm/plat-mxc/epit.c +++ b/arch/arm/plat-mxc/epit.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/irq.h> | 50 | #include <linux/irq.h> |
51 | #include <linux/clockchips.h> | 51 | #include <linux/clockchips.h> |
52 | #include <linux/clk.h> | 52 | #include <linux/clk.h> |
53 | #include <linux/err.h> | ||
53 | 54 | ||
54 | #include <mach/hardware.h> | 55 | #include <mach/hardware.h> |
55 | #include <asm/mach/time.h> | 56 | #include <asm/mach/time.h> |
@@ -201,8 +202,16 @@ static int __init epit_clockevent_init(struct clk *timer_clk) | |||
201 | return 0; | 202 | return 0; |
202 | } | 203 | } |
203 | 204 | ||
204 | void __init epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | 205 | void __init epit_timer_init(void __iomem *base, int irq) |
205 | { | 206 | { |
207 | struct clk *timer_clk; | ||
208 | |||
209 | timer_clk = clk_get_sys("imx-epit.0", NULL); | ||
210 | if (IS_ERR(timer_clk)) { | ||
211 | pr_err("i.MX epit: unable to get clk\n"); | ||
212 | return; | ||
213 | } | ||
214 | |||
206 | clk_prepare_enable(timer_clk); | 215 | clk_prepare_enable(timer_clk); |
207 | 216 | ||
208 | timer_base = base; | 217 | timer_base = base; |
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index cf663d84e7c1..e429ca1b814a 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h | |||
@@ -54,8 +54,8 @@ extern void imx50_soc_init(void); | |||
54 | extern void imx51_soc_init(void); | 54 | extern void imx51_soc_init(void); |
55 | extern void imx53_soc_init(void); | 55 | extern void imx53_soc_init(void); |
56 | extern void imx51_init_late(void); | 56 | extern void imx51_init_late(void); |
57 | extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq); | 57 | extern void epit_timer_init(void __iomem *base, int irq); |
58 | extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); | 58 | extern void mxc_timer_init(void __iomem *, int); |
59 | extern int mx1_clocks_init(unsigned long fref); | 59 | extern int mx1_clocks_init(unsigned long fref); |
60 | extern int mx21_clocks_init(unsigned long lref, unsigned long fref); | 60 | extern int mx21_clocks_init(unsigned long lref, unsigned long fref); |
61 | extern int mx25_clocks_init(void); | 61 | extern int mx25_clocks_init(void); |
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c index 99f958ca6cb8..00e8e659e667 100644 --- a/arch/arm/plat-mxc/time.c +++ b/arch/arm/plat-mxc/time.c | |||
@@ -58,6 +58,7 @@ | |||
58 | /* MX31, MX35, MX25, MX5 */ | 58 | /* MX31, MX35, MX25, MX5 */ |
59 | #define V2_TCTL_WAITEN (1 << 3) /* Wait enable mode */ | 59 | #define V2_TCTL_WAITEN (1 << 3) /* Wait enable mode */ |
60 | #define V2_TCTL_CLK_IPG (1 << 6) | 60 | #define V2_TCTL_CLK_IPG (1 << 6) |
61 | #define V2_TCTL_CLK_PER (2 << 6) | ||
61 | #define V2_TCTL_FRR (1 << 9) | 62 | #define V2_TCTL_FRR (1 << 9) |
62 | #define V2_IR 0x0c | 63 | #define V2_IR 0x0c |
63 | #define V2_TSTAT 0x08 | 64 | #define V2_TSTAT 0x08 |
@@ -280,23 +281,22 @@ static int __init mxc_clockevent_init(struct clk *timer_clk) | |||
280 | return 0; | 281 | return 0; |
281 | } | 282 | } |
282 | 283 | ||
283 | void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | 284 | void __init mxc_timer_init(void __iomem *base, int irq) |
284 | { | 285 | { |
285 | uint32_t tctl_val; | 286 | uint32_t tctl_val; |
287 | struct clk *timer_clk; | ||
286 | struct clk *timer_ipg_clk; | 288 | struct clk *timer_ipg_clk; |
287 | 289 | ||
288 | if (!timer_clk) { | 290 | timer_clk = clk_get_sys("imx-gpt.0", "per"); |
289 | timer_clk = clk_get_sys("imx-gpt.0", "per"); | 291 | if (IS_ERR(timer_clk)) { |
290 | if (IS_ERR(timer_clk)) { | 292 | pr_err("i.MX timer: unable to get clk\n"); |
291 | pr_err("i.MX timer: unable to get clk\n"); | 293 | return; |
292 | return; | ||
293 | } | ||
294 | |||
295 | timer_ipg_clk = clk_get_sys("imx-gpt.0", "ipg"); | ||
296 | if (!IS_ERR(timer_ipg_clk)) | ||
297 | clk_prepare_enable(timer_ipg_clk); | ||
298 | } | 294 | } |
299 | 295 | ||
296 | timer_ipg_clk = clk_get_sys("imx-gpt.0", "ipg"); | ||
297 | if (!IS_ERR(timer_ipg_clk)) | ||
298 | clk_prepare_enable(timer_ipg_clk); | ||
299 | |||
300 | clk_prepare_enable(timer_clk); | 300 | clk_prepare_enable(timer_clk); |
301 | 301 | ||
302 | timer_base = base; | 302 | timer_base = base; |
@@ -309,7 +309,7 @@ void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | |||
309 | __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ | 309 | __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ |
310 | 310 | ||
311 | if (timer_is_v2()) | 311 | if (timer_is_v2()) |
312 | tctl_val = V2_TCTL_CLK_IPG | V2_TCTL_FRR | V2_TCTL_WAITEN | MXC_TCTL_TEN; | 312 | tctl_val = V2_TCTL_CLK_PER | V2_TCTL_FRR | V2_TCTL_WAITEN | MXC_TCTL_TEN; |
313 | else | 313 | else |
314 | tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN; | 314 | tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN; |
315 | 315 | ||