diff options
author | Vikas Sajjan <vikas.sajjan@linaro.org> | 2013-06-11 05:31:16 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2013-08-02 16:24:18 -0400 |
commit | d2127ac4518d81fa5edcaf922fdd34b54a2888a7 (patch) | |
tree | c7283bee9d4425f139f2fc393ad3e90154c2ece6 | |
parent | 8bc2eeb83ed9d07c82f2ff22655018eae426fe33 (diff) |
clk: samsung: Add EPLL and VPLL freq table for exynos5250 SoC
Adds the EPLL and VPLL freq table for exynos5250 SoC.
Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
-rw-r--r-- | drivers/clk/samsung/clk-exynos5250.c | 38 | ||||
-rw-r--r-- | drivers/clk/samsung/clk.h | 2 |
2 files changed, 40 insertions, 0 deletions
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index 7404084a3a1d..df3628cf2597 100644 --- a/drivers/clk/samsung/clk-exynos5250.c +++ b/drivers/clk/samsung/clk-exynos5250.c | |||
@@ -494,6 +494,29 @@ static struct samsung_gate_clock exynos5250_gate_clks[] __initdata = { | |||
494 | GATE(g2d, "g2d", "aclk200", GATE_IP_ACP, 3, 0, 0), | 494 | GATE(g2d, "g2d", "aclk200", GATE_IP_ACP, 3, 0, 0), |
495 | }; | 495 | }; |
496 | 496 | ||
497 | static __initdata struct samsung_pll_rate_table vpll_24mhz_tbl[] = { | ||
498 | /* sorted in descending order */ | ||
499 | /* PLL_36XX_RATE(rate, m, p, s, k) */ | ||
500 | PLL_36XX_RATE(266000000, 266, 3, 3, 0), | ||
501 | /* Not in UM, but need for eDP on snow */ | ||
502 | PLL_36XX_RATE(70500000, 94, 2, 4, 0), | ||
503 | { }, | ||
504 | }; | ||
505 | |||
506 | static __initdata struct samsung_pll_rate_table epll_24mhz_tbl[] = { | ||
507 | /* sorted in descending order */ | ||
508 | /* PLL_36XX_RATE(rate, m, p, s, k) */ | ||
509 | PLL_36XX_RATE(192000000, 64, 2, 2, 0), | ||
510 | PLL_36XX_RATE(180633600, 90, 3, 2, 20762), | ||
511 | PLL_36XX_RATE(180000000, 90, 3, 2, 0), | ||
512 | PLL_36XX_RATE(73728000, 98, 2, 4, 19923), | ||
513 | PLL_36XX_RATE(67737600, 90, 2, 4, 20762), | ||
514 | PLL_36XX_RATE(49152000, 98, 3, 4, 19923), | ||
515 | PLL_36XX_RATE(45158400, 90, 3, 4, 20762), | ||
516 | PLL_36XX_RATE(32768000, 131, 3, 5, 4719), | ||
517 | { }, | ||
518 | }; | ||
519 | |||
497 | struct __initdata samsung_pll_clock exynos5250_plls[nr_plls] = { | 520 | struct __initdata samsung_pll_clock exynos5250_plls[nr_plls] = { |
498 | [apll] = PLL_A(pll_35xx, fout_apll, "fout_apll", "fin_pll", APLL_LOCK, | 521 | [apll] = PLL_A(pll_35xx, fout_apll, "fout_apll", "fin_pll", APLL_LOCK, |
499 | APLL_CON0, "fout_apll", NULL), | 522 | APLL_CON0, "fout_apll", NULL), |
@@ -520,6 +543,8 @@ static __initdata struct of_device_id ext_clk_match[] = { | |||
520 | static void __init exynos5250_clk_init(struct device_node *np) | 543 | static void __init exynos5250_clk_init(struct device_node *np) |
521 | { | 544 | { |
522 | void __iomem *reg_base; | 545 | void __iomem *reg_base; |
546 | struct clk *vpllsrc; | ||
547 | unsigned long fin_pll_rate, mout_vpllsrc_rate = 0; | ||
523 | 548 | ||
524 | if (np) { | 549 | if (np) { |
525 | reg_base = of_iomap(np, 0); | 550 | reg_base = of_iomap(np, 0); |
@@ -537,6 +562,19 @@ static void __init exynos5250_clk_init(struct device_node *np) | |||
537 | ext_clk_match); | 562 | ext_clk_match); |
538 | samsung_clk_register_mux(exynos5250_pll_pmux_clks, | 563 | samsung_clk_register_mux(exynos5250_pll_pmux_clks, |
539 | ARRAY_SIZE(exynos5250_pll_pmux_clks)); | 564 | ARRAY_SIZE(exynos5250_pll_pmux_clks)); |
565 | |||
566 | fin_pll_rate = _get_rate("fin_pll"); | ||
567 | |||
568 | if (fin_pll_rate == 24 * MHZ) | ||
569 | exynos5250_plls[epll].rate_table = epll_24mhz_tbl; | ||
570 | |||
571 | vpllsrc = __clk_lookup("mout_vpllsrc"); | ||
572 | if (vpllsrc) | ||
573 | mout_vpllsrc_rate = clk_get_rate(vpllsrc); | ||
574 | |||
575 | if (mout_vpllsrc_rate == 24 * MHZ) | ||
576 | exynos5250_plls[vpll].rate_table = vpll_24mhz_tbl; | ||
577 | |||
540 | samsung_clk_register_pll(exynos5250_plls, ARRAY_SIZE(exynos5250_plls), | 578 | samsung_clk_register_pll(exynos5250_plls, ARRAY_SIZE(exynos5250_plls), |
541 | reg_base); | 579 | reg_base); |
542 | samsung_clk_register_fixed_rate(exynos5250_fixed_rate_clks, | 580 | samsung_clk_register_fixed_rate(exynos5250_fixed_rate_clks, |
diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index b3f2532823d5..e7dfccb5d981 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h | |||
@@ -40,6 +40,8 @@ struct samsung_clock_alias { | |||
40 | .alias = a, \ | 40 | .alias = a, \ |
41 | } | 41 | } |
42 | 42 | ||
43 | #define MHZ (1000 * 1000) | ||
44 | |||
43 | /** | 45 | /** |
44 | * struct samsung_fixed_rate_clock: information about fixed-rate clock | 46 | * struct samsung_fixed_rate_clock: information about fixed-rate clock |
45 | * @id: platform specific id of the clock. | 47 | * @id: platform specific id of the clock. |