diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-28 09:01:53 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-01 05:06:36 -0400 |
commit | e89d53e60593ee7066e1d36ab5c1ccf2648f5f53 (patch) | |
tree | 8635daedf7a7e4f66a978586c058122189335258 /arch/sh | |
parent | 6881e8bf3d86b23dd124134fae113ebd05fae08a (diff) |
sh: hook up shared mstp32 clock code to sh7785
Hook up the shared 32-bit module stop bit code to sh7785.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 80 |
1 files changed, 25 insertions, 55 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c index 705b023f8220..7d557068f4a3 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c | |||
@@ -193,65 +193,34 @@ static struct clk *clks[] = { | |||
193 | &umem_clk, | 193 | &umem_clk, |
194 | }; | 194 | }; |
195 | 195 | ||
196 | static int mstpcr_clk_enable(struct clk *clk) | ||
197 | { | ||
198 | __raw_writel(__raw_readl(clk->enable_reg) & ~(1 << clk->enable_bit), | ||
199 | clk->enable_reg); | ||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static void mstpcr_clk_disable(struct clk *clk) | ||
204 | { | ||
205 | __raw_writel(__raw_readl(clk->enable_reg) | (1 << clk->enable_bit), | ||
206 | clk->enable_reg); | ||
207 | } | ||
208 | |||
209 | static struct clk_ops mstpcr_clk_ops = { | ||
210 | .enable = mstpcr_clk_enable, | ||
211 | .disable = mstpcr_clk_disable, | ||
212 | .recalc = followparent_recalc, | ||
213 | }; | ||
214 | |||
215 | #define MSTPCR0 0xffc80030 | 196 | #define MSTPCR0 0xffc80030 |
216 | #define MSTPCR1 0xffc80034 | 197 | #define MSTPCR1 0xffc80034 |
217 | 198 | ||
218 | #define CLK(_name, _id, _parent, _enable_reg, \ | 199 | static struct clk mstp_clks[] = { |
219 | _enable_bit, _flags) \ | ||
220 | { \ | ||
221 | .name = _name, \ | ||
222 | .id = _id, \ | ||
223 | .parent = _parent, \ | ||
224 | .enable_reg = (void __iomem *)_enable_reg, \ | ||
225 | .enable_bit = _enable_bit, \ | ||
226 | .flags = _flags, \ | ||
227 | .ops = &mstpcr_clk_ops, \ | ||
228 | } | ||
229 | |||
230 | static struct clk mstpcr_clks[] = { | ||
231 | /* MSTPCR0 */ | 200 | /* MSTPCR0 */ |
232 | CLK("scif_fck", 5, &peripheral_clk, MSTPCR0, 29, 0), | 201 | SH_CLK_MSTP32("scif_fck", 5, &peripheral_clk, MSTPCR0, 29, 0), |
233 | CLK("scif_fck", 4, &peripheral_clk, MSTPCR0, 28, 0), | 202 | SH_CLK_MSTP32("scif_fck", 4, &peripheral_clk, MSTPCR0, 28, 0), |
234 | CLK("scif_fck", 3, &peripheral_clk, MSTPCR0, 27, 0), | 203 | SH_CLK_MSTP32("scif_fck", 3, &peripheral_clk, MSTPCR0, 27, 0), |
235 | CLK("scif_fck", 2, &peripheral_clk, MSTPCR0, 26, 0), | 204 | SH_CLK_MSTP32("scif_fck", 2, &peripheral_clk, MSTPCR0, 26, 0), |
236 | CLK("scif_fck", 1, &peripheral_clk, MSTPCR0, 25, 0), | 205 | SH_CLK_MSTP32("scif_fck", 1, &peripheral_clk, MSTPCR0, 25, 0), |
237 | CLK("scif_fck", 0, &peripheral_clk, MSTPCR0, 24, 0), | 206 | SH_CLK_MSTP32("scif_fck", 0, &peripheral_clk, MSTPCR0, 24, 0), |
238 | CLK("ssi_fck", 1, &peripheral_clk, MSTPCR0, 21, 0), | 207 | SH_CLK_MSTP32("ssi_fck", 1, &peripheral_clk, MSTPCR0, 21, 0), |
239 | CLK("ssi_fck", 0, &peripheral_clk, MSTPCR0, 20, 0), | 208 | SH_CLK_MSTP32("ssi_fck", 0, &peripheral_clk, MSTPCR0, 20, 0), |
240 | CLK("hac_fck", 1, &peripheral_clk, MSTPCR0, 17, 0), | 209 | SH_CLK_MSTP32("hac_fck", 1, &peripheral_clk, MSTPCR0, 17, 0), |
241 | CLK("hac_fck", 0, &peripheral_clk, MSTPCR0, 16, 0), | 210 | SH_CLK_MSTP32("hac_fck", 0, &peripheral_clk, MSTPCR0, 16, 0), |
242 | CLK("mmcif_fck", -1, &peripheral_clk, MSTPCR0, 13, 0), | 211 | SH_CLK_MSTP32("mmcif_fck", -1, &peripheral_clk, MSTPCR0, 13, 0), |
243 | CLK("flctl_fck", -1, &peripheral_clk, MSTPCR0, 12, 0), | 212 | SH_CLK_MSTP32("flctl_fck", -1, &peripheral_clk, MSTPCR0, 12, 0), |
244 | CLK("tmu345_fck", -1, &peripheral_clk, MSTPCR0, 9, 0), | 213 | SH_CLK_MSTP32("tmu345_fck", -1, &peripheral_clk, MSTPCR0, 9, 0), |
245 | CLK("tmu012_fck", -1, &peripheral_clk, MSTPCR0, 8, 0), | 214 | SH_CLK_MSTP32("tmu012_fck", -1, &peripheral_clk, MSTPCR0, 8, 0), |
246 | CLK("siof_fck", -1, &peripheral_clk, MSTPCR0, 3, 0), | 215 | SH_CLK_MSTP32("siof_fck", -1, &peripheral_clk, MSTPCR0, 3, 0), |
247 | CLK("hspi_fck", -1, &peripheral_clk, MSTPCR0, 2, 0), | 216 | SH_CLK_MSTP32("hspi_fck", -1, &peripheral_clk, MSTPCR0, 2, 0), |
248 | 217 | ||
249 | /* MSTPCR1 */ | 218 | /* MSTPCR1 */ |
250 | CLK("hudi_fck", -1, NULL, MSTPCR1, 19, 0), | 219 | SH_CLK_MSTP32("hudi_fck", -1, NULL, MSTPCR1, 19, 0), |
251 | CLK("ubc_fck", -1, NULL, MSTPCR1, 17, 0), | 220 | SH_CLK_MSTP32("ubc_fck", -1, NULL, MSTPCR1, 17, 0), |
252 | CLK("dmac_11_6_fck", -1, NULL, MSTPCR1, 5, 0), | 221 | SH_CLK_MSTP32("dmac_11_6_fck", -1, NULL, MSTPCR1, 5, 0), |
253 | CLK("dmac_5_0_fck", -1, NULL, MSTPCR1, 4, 0), | 222 | SH_CLK_MSTP32("dmac_5_0_fck", -1, NULL, MSTPCR1, 4, 0), |
254 | CLK("gdta_fck", -1, NULL, MSTPCR1, 0, 0), | 223 | SH_CLK_MSTP32("gdta_fck", -1, NULL, MSTPCR1, 0, 0), |
255 | }; | 224 | }; |
256 | 225 | ||
257 | int __init arch_clk_init(void) | 226 | int __init arch_clk_init(void) |
@@ -260,8 +229,9 @@ int __init arch_clk_init(void) | |||
260 | 229 | ||
261 | for (i = 0; i < ARRAY_SIZE(clks); i++) | 230 | for (i = 0; i < ARRAY_SIZE(clks); i++) |
262 | ret |= clk_register(clks[i]); | 231 | ret |= clk_register(clks[i]); |
263 | for (i = 0; i < ARRAY_SIZE(mstpcr_clks); i++) | 232 | |
264 | ret |= clk_register(&mstpcr_clks[i]); | 233 | if (!ret) |
234 | ret = sh_clk_mstp32_register(mstp_clks, ARRAY_SIZE(mstp_clks)); | ||
265 | 235 | ||
266 | return ret; | 236 | return ret; |
267 | } | 237 | } |