diff options
author | Gabriel FERNANDEZ <gabriel.fernandez@st.com> | 2014-02-27 10:24:18 -0500 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-03-25 18:59:17 -0400 |
commit | ec8d27b41e3b513b15c4554d9bb02ba10e0861a4 (patch) | |
tree | cc850add30de4660a63a76f95f677f76fa5702a8 /drivers/clk | |
parent | 5f7aa9071e935c8c0e869306c7ef073df6c409f6 (diff) |
clk: st: Support for ClockGenA9/DDR/GPU
The patch added support for DT registration of ClockGenA9/DDR/GPU
ClockgenA9/DDR : It includes c32 type PLL (also in ClockgenA1x), hence
only CLK_OF_DECLARE implementation is required.
ClockgenGPU : It includes c65 type PLL (also in ClockgenAx), hence
only CLK_OF_DECLARE implementation is required.
Signed-off-by: Pankaj Dev <pankaj.dev@st.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/st/clkgen-pll.c | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c index c6b38b05df1c..bca0a0badbfa 100644 --- a/drivers/clk/st/clkgen-pll.c +++ b/drivers/clk/st/clkgen-pll.c | |||
@@ -110,6 +110,76 @@ static struct clkgen_pll_data st_pll3200c32_a1x_1 = { | |||
110 | .ops = &stm_pll3200c32_ops, | 110 | .ops = &stm_pll3200c32_ops, |
111 | }; | 111 | }; |
112 | 112 | ||
113 | /* 415 specific */ | ||
114 | static struct clkgen_pll_data st_pll3200c32_a9_415 = { | ||
115 | .pdn_status = CLKGEN_FIELD(0x0, 0x1, 0), | ||
116 | .locked_status = CLKGEN_FIELD(0x6C, 0x1, 0), | ||
117 | .ndiv = CLKGEN_FIELD(0x0, C32_NDIV_MASK, 9), | ||
118 | .idf = CLKGEN_FIELD(0x0, C32_IDF_MASK, 22), | ||
119 | .num_odfs = 1, | ||
120 | .odf = { CLKGEN_FIELD(0x0, C32_ODF_MASK, 3) }, | ||
121 | .odf_gate = { CLKGEN_FIELD(0x0, 0x1, 28) }, | ||
122 | .ops = &stm_pll3200c32_ops, | ||
123 | }; | ||
124 | |||
125 | static struct clkgen_pll_data st_pll3200c32_ddr_415 = { | ||
126 | .pdn_status = CLKGEN_FIELD(0x0, 0x1, 0), | ||
127 | .locked_status = CLKGEN_FIELD(0x100, 0x1, 0), | ||
128 | .ndiv = CLKGEN_FIELD(0x8, C32_NDIV_MASK, 0), | ||
129 | .idf = CLKGEN_FIELD(0x0, C32_IDF_MASK, 25), | ||
130 | .num_odfs = 2, | ||
131 | .odf = { CLKGEN_FIELD(0x8, C32_ODF_MASK, 8), | ||
132 | CLKGEN_FIELD(0x8, C32_ODF_MASK, 14) }, | ||
133 | .odf_gate = { CLKGEN_FIELD(0x4, 0x1, 28), | ||
134 | CLKGEN_FIELD(0x4, 0x1, 29) }, | ||
135 | .ops = &stm_pll3200c32_ops, | ||
136 | }; | ||
137 | |||
138 | static struct clkgen_pll_data st_pll1200c32_gpu_415 = { | ||
139 | .pdn_status = CLKGEN_FIELD(0x144, 0x1, 3), | ||
140 | .locked_status = CLKGEN_FIELD(0x168, 0x1, 0), | ||
141 | .ldf = CLKGEN_FIELD(0x0, C32_LDF_MASK, 3), | ||
142 | .idf = CLKGEN_FIELD(0x0, C32_IDF_MASK, 0), | ||
143 | .num_odfs = 0, | ||
144 | .odf = { CLKGEN_FIELD(0x0, C32_ODF_MASK, 10) }, | ||
145 | .ops = &st_pll1200c32_ops, | ||
146 | }; | ||
147 | |||
148 | /* 416 specific */ | ||
149 | static struct clkgen_pll_data st_pll3200c32_a9_416 = { | ||
150 | .pdn_status = CLKGEN_FIELD(0x0, 0x1, 0), | ||
151 | .locked_status = CLKGEN_FIELD(0x6C, 0x1, 0), | ||
152 | .ndiv = CLKGEN_FIELD(0x8, C32_NDIV_MASK, 0), | ||
153 | .idf = CLKGEN_FIELD(0x0, C32_IDF_MASK, 25), | ||
154 | .num_odfs = 1, | ||
155 | .odf = { CLKGEN_FIELD(0x8, C32_ODF_MASK, 8) }, | ||
156 | .odf_gate = { CLKGEN_FIELD(0x4, 0x1, 28) }, | ||
157 | .ops = &stm_pll3200c32_ops, | ||
158 | }; | ||
159 | |||
160 | static struct clkgen_pll_data st_pll3200c32_ddr_416 = { | ||
161 | .pdn_status = CLKGEN_FIELD(0x0, 0x1, 0), | ||
162 | .locked_status = CLKGEN_FIELD(0x10C, 0x1, 0), | ||
163 | .ndiv = CLKGEN_FIELD(0x8, C32_NDIV_MASK, 0), | ||
164 | .idf = CLKGEN_FIELD(0x0, C32_IDF_MASK, 25), | ||
165 | .num_odfs = 2, | ||
166 | .odf = { CLKGEN_FIELD(0x8, C32_ODF_MASK, 8), | ||
167 | CLKGEN_FIELD(0x8, C32_ODF_MASK, 14) }, | ||
168 | .odf_gate = { CLKGEN_FIELD(0x4, 0x1, 28), | ||
169 | CLKGEN_FIELD(0x4, 0x1, 29) }, | ||
170 | .ops = &stm_pll3200c32_ops, | ||
171 | }; | ||
172 | |||
173 | static struct clkgen_pll_data st_pll1200c32_gpu_416 = { | ||
174 | .pdn_status = CLKGEN_FIELD(0x8E4, 0x1, 3), | ||
175 | .locked_status = CLKGEN_FIELD(0x90C, 0x1, 0), | ||
176 | .ldf = CLKGEN_FIELD(0x0, C32_LDF_MASK, 3), | ||
177 | .idf = CLKGEN_FIELD(0x0, C32_IDF_MASK, 0), | ||
178 | .num_odfs = 0, | ||
179 | .odf = { CLKGEN_FIELD(0x0, C32_ODF_MASK, 10) }, | ||
180 | .ops = &st_pll1200c32_ops, | ||
181 | }; | ||
182 | |||
113 | /** | 183 | /** |
114 | * DOC: Clock Generated by PLL, rate set and enabled by bootloader | 184 | * DOC: Clock Generated by PLL, rate set and enabled by bootloader |
115 | * | 185 | * |
@@ -484,6 +554,22 @@ static struct of_device_id c32_pll_of_match[] = { | |||
484 | .compatible = "st,plls-c32-a1x-1", | 554 | .compatible = "st,plls-c32-a1x-1", |
485 | .data = &st_pll3200c32_a1x_1, | 555 | .data = &st_pll3200c32_a1x_1, |
486 | }, | 556 | }, |
557 | { | ||
558 | .compatible = "st,stih415-plls-c32-a9", | ||
559 | .data = &st_pll3200c32_a9_415, | ||
560 | }, | ||
561 | { | ||
562 | .compatible = "st,stih415-plls-c32-ddr", | ||
563 | .data = &st_pll3200c32_ddr_415, | ||
564 | }, | ||
565 | { | ||
566 | .compatible = "st,stih416-plls-c32-a9", | ||
567 | .data = &st_pll3200c32_a9_416, | ||
568 | }, | ||
569 | { | ||
570 | .compatible = "st,stih416-plls-c32-ddr", | ||
571 | .data = &st_pll3200c32_ddr_416, | ||
572 | }, | ||
487 | {} | 573 | {} |
488 | }; | 574 | }; |
489 | 575 | ||
@@ -557,3 +643,56 @@ err: | |||
557 | kfree(clk_data); | 643 | kfree(clk_data); |
558 | } | 644 | } |
559 | CLK_OF_DECLARE(clkgen_c32_pll, "st,clkgen-plls-c32", clkgen_c32_pll_setup); | 645 | CLK_OF_DECLARE(clkgen_c32_pll, "st,clkgen-plls-c32", clkgen_c32_pll_setup); |
646 | |||
647 | static struct of_device_id c32_gpu_pll_of_match[] = { | ||
648 | { | ||
649 | .compatible = "st,stih415-gpu-pll-c32", | ||
650 | .data = &st_pll1200c32_gpu_415, | ||
651 | }, | ||
652 | { | ||
653 | .compatible = "st,stih416-gpu-pll-c32", | ||
654 | .data = &st_pll1200c32_gpu_416, | ||
655 | }, | ||
656 | }; | ||
657 | |||
658 | static void __init clkgengpu_c32_pll_setup(struct device_node *np) | ||
659 | { | ||
660 | const struct of_device_id *match; | ||
661 | struct clk *clk; | ||
662 | const char *parent_name; | ||
663 | void __iomem *reg; | ||
664 | const char *clk_name; | ||
665 | struct clkgen_pll_data *data; | ||
666 | |||
667 | match = of_match_node(c32_gpu_pll_of_match, np); | ||
668 | if (!match) { | ||
669 | pr_err("%s: No matching data\n", __func__); | ||
670 | return; | ||
671 | } | ||
672 | |||
673 | data = (struct clkgen_pll_data *)match->data; | ||
674 | |||
675 | parent_name = of_clk_get_parent_name(np, 0); | ||
676 | if (!parent_name) | ||
677 | return; | ||
678 | |||
679 | reg = clkgen_get_register_base(np); | ||
680 | if (!reg) | ||
681 | return; | ||
682 | |||
683 | if (of_property_read_string_index(np, "clock-output-names", | ||
684 | 0, &clk_name)) | ||
685 | return; | ||
686 | |||
687 | /* | ||
688 | * PLL 1200MHz output | ||
689 | */ | ||
690 | clk = clkgen_pll_register(parent_name, data, reg, clk_name); | ||
691 | |||
692 | if (!IS_ERR(clk)) | ||
693 | of_clk_add_provider(np, of_clk_src_simple_get, clk); | ||
694 | |||
695 | return; | ||
696 | } | ||
697 | CLK_OF_DECLARE(clkgengpu_c32_pll, | ||
698 | "st,clkgengpu-pll-c32", clkgengpu_c32_pll_setup); | ||