aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/clk-imx51-imx53.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:05:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:05:15 -0500
commitd027db132b395dabfac208e52a7e510e441bb9d2 (patch)
tree24b055b2385f9848e77e646ce475991d8675c3c4 /arch/arm/mach-imx/clk-imx51-imx53.c
parentd01e4afdbb65e030fd6f1f96c30a558e2eb0f279 (diff)
parent5faf7cbb848da827f6ea1458b5a1c26a44e7510a (diff)
Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC updates from Olof Johansson: "This contains the bulk of new SoC development for this merge window. Two new platforms have been added, the sunxi platforms (Allwinner A1x SoCs) by Maxime Ripard, and a generic Broadcom platform for a new series of ARMv7 platforms from them, where the hope is that we can keep the platform code generic enough to have them all share one mach directory. The new Broadcom platform is contributed by Christian Daudt. Highbank has grown support for Calxeda's next generation of hardware, ECX-2000. clps711x has seen a lot of cleanup from Alexander Shiyan, and he's also taken on maintainership of the platform. Beyond this there has been a bunch of work from a number of people on converting more platforms to IRQ domains, pinctrl conversion, cleanup and general feature enablement across most of the active platforms." Fix up trivial conflicts as per Olof. * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (174 commits) mfd: vexpress-sysreg: Remove LEDs code irqchip: irq-sunxi: Add terminating entry for sunxi_irq_dt_ids clocksource: sunxi_timer: Add terminating entry for sunxi_timer_dt_ids irq: versatile: delete dangling variable ARM: sunxi: add missing include for mdelay() ARM: EXYNOS: Avoid early use of of_machine_is_compatible() ARM: dts: add node for PL330 MDMA1 controller for exynos4 ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412 ARM: EXYNOS: add UART3 to DEBUG_LL ports ARM: S3C24XX: Add clkdev entry for camif-upll clock ARM: SAMSUNG: Add s3c24xx/s3c64xx CAMIF GPIO setup helpers ARM: sunxi: Add missing sun4i.dtsi file pinctrl: samsung: Do not initialise statics to 0 ARM i.MX6: remove gate_mask from pllv3 ARM i.MX6: Fix ethernet PLL clocks ARM i.MX6: rename PLLs according to datasheet ARM i.MX6: Add pwm support ARM i.MX51: Add pwm support ARM i.MX53: Add pwm support ARM: mx5: Replace clk_register_clkdev with clock DT lookup ...
Diffstat (limited to 'arch/arm/mach-imx/clk-imx51-imx53.c')
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index abb71f6b4d60..e8c0473c7568 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -87,6 +87,7 @@ enum imx5_clks {
87}; 87};
88 88
89static struct clk *clk[clk_max]; 89static struct clk *clk[clk_max];
90static struct clk_onecell_data clk_data;
90 91
91static void __init mx5_clocks_common_init(unsigned long rate_ckil, 92static void __init mx5_clocks_common_init(unsigned long rate_ckil,
92 unsigned long rate_osc, unsigned long rate_ckih1, 93 unsigned long rate_osc, unsigned long rate_ckih1,
@@ -305,6 +306,10 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
305 clk_prepare_enable(clk[spba]); 306 clk_prepare_enable(clk[spba]);
306 clk_prepare_enable(clk[emi_fast_gate]); /* fec */ 307 clk_prepare_enable(clk[emi_fast_gate]); /* fec */
307 clk_prepare_enable(clk[emi_slow_gate]); /* eim */ 308 clk_prepare_enable(clk[emi_slow_gate]); /* eim */
309 clk_prepare_enable(clk[mipi_hsc1_gate]);
310 clk_prepare_enable(clk[mipi_hsc2_gate]);
311 clk_prepare_enable(clk[mipi_esc_gate]);
312 clk_prepare_enable(clk[mipi_hsp_gate]);
308 clk_prepare_enable(clk[tmax1]); 313 clk_prepare_enable(clk[tmax1]);
309 clk_prepare_enable(clk[tmax2]); /* esdhc2, fec */ 314 clk_prepare_enable(clk[tmax2]); /* esdhc2, fec */
310 clk_prepare_enable(clk[tmax3]); /* esdhc1, esdhc4 */ 315 clk_prepare_enable(clk[tmax3]); /* esdhc1, esdhc4 */
@@ -314,6 +319,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
314 unsigned long rate_ckih1, unsigned long rate_ckih2) 319 unsigned long rate_ckih1, unsigned long rate_ckih2)
315{ 320{
316 int i; 321 int i;
322 struct device_node *np;
317 323
318 clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX51_DPLL1_BASE); 324 clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX51_DPLL1_BASE);
319 clk[pll2_sw] = imx_clk_pllv2("pll2_sw", "osc", MX51_DPLL2_BASE); 325 clk[pll2_sw] = imx_clk_pllv2("pll2_sw", "osc", MX51_DPLL2_BASE);
@@ -342,16 +348,20 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
342 pr_err("i.MX51 clk %d: register failed with %ld\n", 348 pr_err("i.MX51 clk %d: register failed with %ld\n",
343 i, PTR_ERR(clk[i])); 349 i, PTR_ERR(clk[i]));
344 350
351 np = of_find_compatible_node(NULL, NULL, "fsl,imx51-ccm");
352 clk_data.clks = clk;
353 clk_data.clk_num = ARRAY_SIZE(clk);
354 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
355
345 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2); 356 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
346 357
347 clk_register_clkdev(clk[hsi2c_gate], NULL, "imx21-i2c.2"); 358 clk_register_clkdev(clk[hsi2c_gate], NULL, "imx21-i2c.2");
348 clk_register_clkdev(clk[mx51_mipi], "mipi_hsp", NULL); 359 clk_register_clkdev(clk[mx51_mipi], "mipi_hsp", NULL);
349 clk_register_clkdev(clk[vpu_gate], NULL, "imx51-vpu.0"); 360 clk_register_clkdev(clk[vpu_gate], NULL, "imx51-vpu.0");
350 clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0"); 361 clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
351 clk_register_clkdev(clk[ipu_gate], "bus", "imx51-ipu"); 362 clk_register_clkdev(clk[ipu_gate], "bus", "40000000.ipu");
352 clk_register_clkdev(clk[ipu_di0_gate], "di0", "imx51-ipu"); 363 clk_register_clkdev(clk[ipu_di0_gate], "di0", "40000000.ipu");
353 clk_register_clkdev(clk[ipu_di1_gate], "di1", "imx51-ipu"); 364 clk_register_clkdev(clk[ipu_di1_gate], "di1", "40000000.ipu");
354 clk_register_clkdev(clk[ipu_gate], "hsp", "imx51-ipu");
355 clk_register_clkdev(clk[usb_phy_gate], "phy", "mxc-ehci.0"); 365 clk_register_clkdev(clk[usb_phy_gate], "phy", "mxc-ehci.0");
356 clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx51.0"); 366 clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx51.0");
357 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx51.0"); 367 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx51.0");
@@ -365,10 +375,6 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
365 clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx51.3"); 375 clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx51.3");
366 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx51.3"); 376 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx51.3");
367 clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx51.3"); 377 clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx51.3");
368 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "83fcc000.ssi");
369 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "70014000.ssi");
370 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "83fe8000.ssi");
371 clk_register_clkdev(clk[nfc_gate], NULL, "83fdb000.nand");
372 378
373 /* set the usboh3 parent to pll2_sw */ 379 /* set the usboh3 parent to pll2_sw */
374 clk_set_parent(clk[usboh3_sel], clk[pll2_sw]); 380 clk_set_parent(clk[usboh3_sel], clk[pll2_sw]);
@@ -392,6 +398,7 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
392{ 398{
393 int i; 399 int i;
394 unsigned long r; 400 unsigned long r;
401 struct device_node *np;
395 402
396 clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX53_DPLL1_BASE); 403 clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX53_DPLL1_BASE);
397 clk[pll2_sw] = imx_clk_pllv2("pll2_sw", "osc", MX53_DPLL2_BASE); 404 clk[pll2_sw] = imx_clk_pllv2("pll2_sw", "osc", MX53_DPLL2_BASE);
@@ -436,15 +443,20 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
436 pr_err("i.MX53 clk %d: register failed with %ld\n", 443 pr_err("i.MX53 clk %d: register failed with %ld\n",
437 i, PTR_ERR(clk[i])); 444 i, PTR_ERR(clk[i]));
438 445
446 np = of_find_compatible_node(NULL, NULL, "fsl,imx53-ccm");
447 clk_data.clks = clk;
448 clk_data.clk_num = ARRAY_SIZE(clk);
449 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
450
439 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2); 451 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
440 452
441 clk_register_clkdev(clk[vpu_gate], NULL, "imx53-vpu.0"); 453 clk_register_clkdev(clk[vpu_gate], NULL, "imx53-vpu.0");
442 clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2"); 454 clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
443 clk_register_clkdev(clk[fec_gate], NULL, "imx25-fec.0"); 455 clk_register_clkdev(clk[fec_gate], NULL, "imx25-fec.0");
444 clk_register_clkdev(clk[ipu_gate], "bus", "imx53-ipu"); 456 clk_register_clkdev(clk[ipu_gate], "bus", "18000000.ipu");
445 clk_register_clkdev(clk[ipu_di0_gate], "di0", "imx53-ipu"); 457 clk_register_clkdev(clk[ipu_di0_gate], "di0", "18000000.ipu");
446 clk_register_clkdev(clk[ipu_di1_gate], "di1", "imx53-ipu"); 458 clk_register_clkdev(clk[ipu_di1_gate], "di1", "18000000.ipu");
447 clk_register_clkdev(clk[ipu_gate], "hsp", "imx53-ipu"); 459 clk_register_clkdev(clk[ipu_gate], "hsp", "18000000.ipu");
448 clk_register_clkdev(clk[usb_phy1_gate], "usb_phy1", "mxc-ehci.0"); 460 clk_register_clkdev(clk[usb_phy1_gate], "usb_phy1", "mxc-ehci.0");
449 clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx53.0"); 461 clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx53.0");
450 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.0"); 462 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.0");
@@ -458,14 +470,6 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
458 clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx53.3"); 470 clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx53.3");
459 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.3"); 471 clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.3");
460 clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx53.3"); 472 clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx53.3");
461 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "63fcc000.ssi");
462 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "50014000.ssi");
463 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "63fd0000.ssi");
464 clk_register_clkdev(clk[nfc_gate], NULL, "63fdb000.nand");
465 clk_register_clkdev(clk[can1_ipg_gate], "ipg", "53fc8000.can");
466 clk_register_clkdev(clk[can1_serial_gate], "per", "53fc8000.can");
467 clk_register_clkdev(clk[can2_ipg_gate], "ipg", "53fcc000.can");
468 clk_register_clkdev(clk[can2_serial_gate], "per", "53fcc000.can");
469 473
470 /* set SDHC root clock to 200MHZ*/ 474 /* set SDHC root clock to 200MHZ*/
471 clk_set_rate(clk[esdhc_a_podf], 200000000); 475 clk_set_rate(clk[esdhc_a_podf], 200000000);