diff options
Diffstat (limited to 'arch/arm/mach-mx3/clock-imx35.c')
-rw-r--r-- | arch/arm/mach-mx3/clock-imx35.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index 577ee83d1f60..fe5c4217322e 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
@@ -273,6 +273,19 @@ static unsigned long get_rate_csi(struct clk *clk) | |||
273 | return rate / get_3_3_div((pdr2 >> 16) & 0x3f); | 273 | return rate / get_3_3_div((pdr2 >> 16) & 0x3f); |
274 | } | 274 | } |
275 | 275 | ||
276 | static unsigned long get_rate_otg(struct clk *clk) | ||
277 | { | ||
278 | unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4); | ||
279 | unsigned long rate; | ||
280 | |||
281 | if (pdr4 & (1 << 9)) | ||
282 | rate = get_rate_arm(); | ||
283 | else | ||
284 | rate = get_rate_ppll(); | ||
285 | |||
286 | return rate / get_3_3_div((pdr4 >> 22) & 0x3f); | ||
287 | } | ||
288 | |||
276 | static unsigned long get_rate_ipg_per(struct clk *clk) | 289 | static unsigned long get_rate_ipg_per(struct clk *clk) |
277 | { | 290 | { |
278 | unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); | 291 | unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); |
@@ -365,7 +378,7 @@ DEFINE_CLOCK(ssi2_clk, 1, CCM_CGR2, 14, get_rate_ssi, NULL); | |||
365 | DEFINE_CLOCK(uart1_clk, 0, CCM_CGR2, 16, get_rate_uart, NULL); | 378 | DEFINE_CLOCK(uart1_clk, 0, CCM_CGR2, 16, get_rate_uart, NULL); |
366 | DEFINE_CLOCK(uart2_clk, 1, CCM_CGR2, 18, get_rate_uart, NULL); | 379 | DEFINE_CLOCK(uart2_clk, 1, CCM_CGR2, 18, get_rate_uart, NULL); |
367 | DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL); | 380 | DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL); |
368 | DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, NULL, NULL); | 381 | DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL); |
369 | DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL); | 382 | DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL); |
370 | DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL); | 383 | DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL); |
371 | DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL); | 384 | DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL); |
@@ -426,7 +439,10 @@ static struct clk_lookup lookups[] = { | |||
426 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) | 439 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) |
427 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) | 440 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) |
428 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | 441 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) |
429 | _REGISTER_CLOCK(NULL, "usbotg", usbotg_clk) | 442 | _REGISTER_CLOCK("mxc-ehci.0", "usb", usbotg_clk) |
443 | _REGISTER_CLOCK("mxc-ehci.1", "usb", usbotg_clk) | ||
444 | _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk) | ||
445 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) | ||
430 | _REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk) | 446 | _REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk) |
431 | _REGISTER_CLOCK(NULL, "max", max_clk) | 447 | _REGISTER_CLOCK(NULL, "max", max_clk) |
432 | _REGISTER_CLOCK(NULL, "admux", admux_clk) | 448 | _REGISTER_CLOCK(NULL, "admux", admux_clk) |
@@ -456,7 +472,7 @@ int __init mx35_clocks_init() | |||
456 | __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2); | 472 | __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2); |
457 | __raw_writel(0, CCM_BASE + CCM_CGR3); | 473 | __raw_writel(0, CCM_BASE + CCM_CGR3); |
458 | 474 | ||
459 | mxc_timer_init(&gpt_clk); | 475 | mxc_timer_init(&gpt_clk, IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT); |
460 | 476 | ||
461 | return 0; | 477 | return 0; |
462 | } | 478 | } |